From: Vincent Vanwaelscappel Date: Mon, 7 Jan 2019 18:43:30 +0000 (+0100) Subject: wip #2332 @4 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e8816fc31c706118b687d339e403afc80b965c76;p=fluidbook-html5.git wip #2332 @4 --- diff --git a/js/libs/fluidbook/fluidbook.3dflip.js b/js/libs/fluidbook/fluidbook.3dflip.js index a9660dae..a5396cf4 100644 --- a/js/libs/fluidbook/fluidbook.3dflip.js +++ b/js/libs/fluidbook/fluidbook.3dflip.js @@ -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++; diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 468e71d9..da06b9fc 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -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) { diff --git a/style/fluidbook.less b/style/fluidbook.less index 5c82b78b..13d1fcf0 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -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 {