]> _ Git - fluidbook-html5.git/commitdiff
wip #2332 @4
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 7 Jan 2019 18:43:30 +0000 (19:43 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 7 Jan 2019 18:43:30 +0000 (19:43 +0100)
js/libs/fluidbook/fluidbook.3dflip.js
js/libs/fluidbook/fluidbook.js
style/fluidbook.less

index a9660dae960552782b75a0047e1cc7aaafc2cbc8..a5396cf41b872b3a2bdd5006c245f8299f2f9eac 100644 (file)
@@ -449,11 +449,10 @@ Fluidbook3DFlip.prototype = {
     performancesTest: function (callback) {
         var $this = this;
         this.prepareTurn({flip: [1, 2]}, function () {
-            $this.performancesStartTime = new Date();
             $this.playTurn(1, function () {
                 $this.performancesEndTime = new Date();
                 $this.adjustPerformancesSettings(callback);
-            });
+            }, 1);
         });
     },
 
@@ -462,12 +461,13 @@ Fluidbook3DFlip.prototype = {
         var newMode;
 
         var res = this.getPerformancesTestResult();
+        console.log('perf test', res);
         if (!this.lowPerf) {
             if (res < 5) {
                 newMode = 'disable';
             } else if (res < 20) {
                 newMode = 'veryLowPerf';
-            } else if (res < 40) {
+            } else if (res < 35) {
                 newMode = 'lowPerf';
             } else {
                 newMode = 'highPerf';
@@ -493,9 +493,13 @@ Fluidbook3DFlip.prototype = {
             this.init3D(newMode);
             callback();
             this.prepareTurn({flip: [1, 2]}, function () {
-                $this.playTurn(1, function () {
-                    callback();
-                }, 0.1);
+                $this.playTurn(0.1, function () {
+                    this.prepareTurn({flip: [2, 1]}, function () {
+                        $this.playTurn(-1, function () {
+                            callback();
+                        }, 0.1, 0);
+                    });
+                }, 1, 0);
             });
             //console.log('Performances test ok : ' + res);
         } else {
@@ -548,7 +552,7 @@ Fluidbook3DFlip.prototype = {
         callback(texture);
     },
 
-    playTurn: function (dir, callback, timeScale) {
+    playTurn: function (dir, callback, timeScale, delay) {
         if (this.turnRunning) {
             return;
         }
@@ -568,7 +572,9 @@ Fluidbook3DFlip.prototype = {
         this.progressAnimation(0);
         this.animate(false);
 
-        var delay = this.fluidbook.support.iOS ? 0.15 : 0;
+        if (delay === undefined) {
+            delay = this.fluidbook.support.iOS ? 0.15 : 0.06;
+        }
 
         TweenMax.fromTo(this, this.animationTime * timeScale,
             {progressAnimation: 0,},
@@ -576,6 +582,11 @@ Fluidbook3DFlip.prototype = {
                 progressAnimation: 1,
                 ease: Power0.easeIn,
                 delay: delay,
+                onStart: function () {
+                    if ($this.performancesTestRunning) {
+                        $this.performancesStartTime = new Date();
+                    }
+                },
                 onComplete: function () {
                     $this.turnRunning = false;
                     this.tlname = '';
@@ -597,7 +608,6 @@ Fluidbook3DFlip.prototype = {
 
         var render = true;
         if (this._progressAnimation < 1) {
-
             if (this.turnRunning) {
                 if (this.performancesTestRunning) {
                     this.performancesFrames++;
index 468e71d93dd3e04d189af063589c46846eb4d720..da06b9fcf95f3f71cdeb9cfa7588efb8056c6775 100644 (file)
@@ -135,11 +135,7 @@ Fluidbook.prototype = {
             $this.ready();
         });
     },
-    reloadErrorImages: function () {
-        $('img').each(function () {
 
-        });
-    },
     initKeyboardShortcuts: function () {
         var $this = this;
         // General keyboard shortcuts
@@ -168,7 +164,9 @@ Fluidbook.prototype = {
         $(this).trigger('fluidbook.splash.beforehide');
         var $this = this;
         if (this.support.transitions3dacc && this.datas.mobileTransitions === 'flip3d') {
-            this.pauseNetwork(1500);
+            $("#main,#viewOverlay,#view").css('visibility', 'visible');
+            resize();
+            this.pauseNetwork(4000);
             setTimeout(function () {
                 this.fluidbook.pagetransitions.flip3d.performancesTest(function () {
                     $this.pauseNetwork(-1);
@@ -510,7 +508,7 @@ Fluidbook.prototype = {
             delay = 0;
             duration = 0;
         } else {
-            delay = animationDuration * 0.7;
+            delay = animationDuration;
             duration = animationDuration * 0.3;
         }
 
@@ -541,7 +539,7 @@ Fluidbook.prototype = {
             s_out.push(".right:not('.hidden')");
         }
 
-        if (this.support.transitions2d && !this.support.iOS) {
+        if (false && this.support.transitions2d && !this.support.iOS) {
             var transitionIn = {transitionDuration: duration + 'ms', transitionDelay: delay + 'ms'};
             var transitionOut = {transitionDuration: (duration * .5) + 'ms', transitionDelay: '0ms'};
             if (s_in.length > 0) {
index 5c82b78b6fb908d3f5e14f96e9d8b5e8f012a6cf..13d1fcf0f6bb39c18c72131556d88563bf252cd5 100644 (file)
@@ -422,18 +422,8 @@ body, html {
        pointer-events: none;
        mix-blend-mode: multiply;
 
-       transition-property: opacity;
-       transition-duration: 250s;
-
-       &.hidden {
-               transition-duration: 50ms;
-               opacity: 0;
-       }
-
-       .ios & {
-               transition-property: none !important;
-               transition-duration: 0ms !important;
-       }
+       transition-property: none !important;
+       transition-duration: 0ms !important;
 
        > .shadow {
                position: absolute;
@@ -496,11 +486,8 @@ body, html {
 }
 
 #edges {
-
-       .ios & {
-               transition-property: none !important;
-               transition-duration: 0ms !important;
-       }
+       transition-property: none !important;
+       transition-duration: 0ms !important;
 
        position: absolute;
        top: 0px;
@@ -688,13 +675,8 @@ body, html {
        top: @book-page-height;
        color: @page-number-color;
        .hideifnot(@display-page-number);
-       transition: opacity 250ms;
        opacity: 1;
 
-       .ios & {
-               transition: none;
-       }
-
        &.hidden {
                transition: none;
                opacity: 0;
@@ -2383,7 +2365,6 @@ ul.chapters {
        top: 0px;
        left: 0px;
        z-index: 40;
-       opacity: 0;
 }
 
 #splash .logo {