]> _ Git - fluidbook-html5.git/commitdiff
wait #2244 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Dec 2018 18:13:21 +0000 (19:13 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Dec 2018 18:13:21 +0000 (19:13 +0100)
js/libs/fluidbook/fluidbook.3dflip.js
js/libs/fluidbook/fluidbook.js
style/fluidbook.less

index 41bc5926ea1950caf5e2a4a20c3943fc71f44bd7..c8fa6331c66896c8879dc1423bcb4587ea386ff3 100644 (file)
@@ -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();
index ffcd6f60dabfef077c685800539330a1f03e63bd..0bd2a130234b783b3908bfa3c769e52a75984db3 100644 (file)
@@ -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');
             }
         }
index 848065eb90c0546290ddbf1d2558e616ce5a4b29..675964fc226e7ce5ee71e8f590c243921d05d17f 100644 (file)
@@ -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;
        }
 }