From: Vincent Vanwaelscappel Date: Mon, 17 Dec 2018 18:13:21 +0000 (+0100) Subject: wait #2244 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b8d346616e333d38e204c426eb352c21ba8708f9;p=fluidbook-html5.git wait #2244 @1.5 --- diff --git a/js/libs/fluidbook/fluidbook.3dflip.js b/js/libs/fluidbook/fluidbook.3dflip.js index 41bc5926..c8fa6331 100644 --- a/js/libs/fluidbook/fluidbook.3dflip.js +++ b/js/libs/fluidbook/fluidbook.3dflip.js @@ -247,12 +247,14 @@ Fluidbook3DFlip.prototype = { this.scene.add(new THREE.AmbientLight(0xffffff, 1.5)); } - var far = 24000; + + var zoom = 0.8; + var far = 24000 * zoom; var near = 1000; this.camera = new THREE.PerspectiveCamera(20, 1, near, far); - this.camera.zoom = 1; - this.camera.position.z = 8873 * 2; + this.camera.zoom = zoom; + this.camera.position.z = 8873 * 2 * zoom; this.camera.updateProjectionMatrix(); if (this.enableLight) { @@ -569,7 +571,7 @@ Fluidbook3DFlip.prototype = { this.progressAnimation(0); this.animate(false); - var delay = this.fluidbook.support.iOS ? 0.05 : 0; + var delay = this.fluidbook.support.iOS ? 0.15 : 0; TweenMax.fromTo(this, this.animationTime * timeScale, {progressAnimation: 0,}, @@ -652,7 +654,10 @@ Fluidbook3DFlip.prototype = { this.camera.updateProjectionMatrix(); } - this.jcontainer.css({width: this.pw, height: this.ph}); + var fw = $("#fluidbook").get(0).getBoundingClientRect(); + + this.jcontainer.css({left: fw.left, width: fw.width, height: this.ph}); + this.jcontainer.find('canvas').css({left: -fw.left, width: this.pw, height: this.ph}); if (null !== THREE) { this.renderer.setSize(this.pw, this.ph); this.guessCameraZoom(); diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index ffcd6f60..0bd2a130 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -514,6 +514,7 @@ Fluidbook.prototype = { duration = animationDuration * 0.3; } + var left = true, right = true; if (!this.displayOnePage) { if ((page <= 1 && this.l10n.dir === 'ltr') || (page >= this.contentlock.getMaxPage() && this.l10n.dir === 'rtl')) { @@ -556,7 +557,7 @@ Fluidbook.prototype = { $(s).children(s_in.join(',')).removeClass('hidden'); }, delay); } - if(s_out.length>0) { + if (s_out.length > 0) { $(s).children(s_out.join(',')).addClass('hidden'); } } diff --git a/style/fluidbook.less b/style/fluidbook.less index 848065eb..675964fc 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -2223,7 +2223,6 @@ ul.chapters { /* 3D Flip */ #flip3dcontainer { - width: 100%; height: 100%; position: absolute; top: 0; @@ -2231,10 +2230,10 @@ ul.chapters { z-index: 12; pointer-events: none; display: none; + overflow: hidden; canvas { - position: absolute; - top: 0; + position: relative; left: 0; } }