]> _ Git - fluidbook-html5.git/commitdiff
wip #809 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 23 Aug 2018 16:50:13 +0000 (18:50 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 23 Aug 2018 16:50:13 +0000 (18:50 +0200)
js/libs/fluidbook/fluidbook.3dflip.js
js/libs/fluidbook/fluidbook.links.js

index fc24ac7e6458707cb88eeca4fd33b6f425c9ee46..f7705e860ab0ee38e3425efd10e9b39bea952b64 100644 (file)
@@ -15,6 +15,7 @@ function Fluidbook3DFlip(fluidbook) {
     this.animation = null;
     this._progressAnimation = 0;
     this._pageRotation = 0;
+    this._callbackAfterNextRender = null;
     this.ready = false;
 
     this.textures = [];
@@ -46,8 +47,16 @@ function Fluidbook3DFlip(fluidbook) {
         this.qualityRatio = 2;
         this.triangles = 5;
     }
+    this.refreshTime = Math.round(1000 / this.maxFps);
     this.pixelRatio = window.devicePixelRatio * this.qualityRatio;
 
+    console.log('Quality ratio: ' + this.qualityRatio);
+    console.log('Triangles: ' + this.triangles);
+    console.log('Animation time: ' + this.animationTime);
+    console.log('Antialias: ' + this.antialias);
+    console.log('Lights enabled: ' + this.enableLight);
+    console.log('Shadows enabled: ' + this.enableShadow);
+
     this.jcontainer = $("#flip3dcontainer");
 
     this.pw = this.fluidbook.resize.ww;
@@ -288,12 +297,13 @@ Fluidbook3DFlip.prototype = {
                 onComplete: function () {
                     $this.turnRunning = false;
                     this.tlname = '';
-                    callback();
+                    $this._callbackAfterNextRender = callback;
                 }
             }
         );
     },
 
+
     animate: function (next) {
         var $this = this;
         if (this.stats === undefined) {
@@ -328,6 +338,11 @@ Fluidbook3DFlip.prototype = {
         } else {
             $("#flip3dcontainer").hide();
         }
+
+        if (this._callbackAfterNextRender !== null) {
+            this._callbackAfterNextRender.apply();
+            this._callbackAfterNextRender = null;
+        }
     },
 
     resize: function () {
@@ -396,7 +411,6 @@ Fluidbook3DFlip.prototype = {
             this.sizePlane.translateY(rect.y - bookBox.top);
         }
 
-
         this.plane.position.y = this.sizePlane.position.y;
         this.plane.scale.x = this.sizePlane.scale.x;
         this.plane.scale.y = this.sizePlane.scale.y;
index 3df6e5ccd4c8ebefcb30ac0f2fa0423b1d5b17ea..3dd5163c64ca345424eb8312c79f0874073fc1b6 100644 (file)
@@ -151,7 +151,7 @@ FluidbookLinks.prototype = {
         if (this.fluidbook.datas.linkBlinkTime > 0 && this.fluidbook.datas.mobileLinksRevealAnim) {
             setTimeout(function () {
                 $this.animateLinks();
-            }, 150);
+            }, 350);
         }
         setTimeout(function () {
             $this.fluidbook.initVideos();