From cc2c1c738a95997352e47735b457d630e17e6901 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 25 May 2021 16:07:09 +0200 Subject: [PATCH] wait #4491 @1.5 --- js/libs/fluidbook/fluidbook.links.js | 30 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 99edd62a..446358ec 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -519,7 +519,7 @@ FluidbookLinks.prototype = { animation.type = 'none'; } var defaultParams = {}; - var globalDefault = {x: 0, y: 0, yoyo: 0, repeat: 0}; + var globalDefault = {x: 0, y: 0, yoyo: 0, repeat: 0, transformorigin: '50% 50%'}; var w = parseFloat(link.css('width')); var cx = w / 2; var h = parseFloat(link.css('height')); @@ -546,10 +546,24 @@ FluidbookLinks.prototype = { if (animation.delay !== undefined) { to.delay = parseFloat(animation.delay); } - if (animation.type === 'translatefrom') { + if (animation.type === 'scalefrom') { + to.display = 'block'; + to.visibility = 'visible'; + + from.scale = animation.scale; + to.scale = 1; + from.transformOrigin = to.transformOrigin = animation.transformorigin; + } else if (animation.type === 'scale') { + to.display = 'block'; + to.visibility = 'visible'; + + from.scale = 1; + to.scale = animation.scale; + from.transformOrigin = to.transformOrigin = animation.transformorigin; + } else if (animation.type === 'translatefrom') { from.display = 'none'; to.display = 'block'; - to.visibility='visible'; + to.visibility = 'visible'; from.x = animation.x; from.y = animation.y; @@ -559,7 +573,7 @@ FluidbookLinks.prototype = { } else if (animation.type === 'translate') { from.display = 'none'; to.display = 'block'; - to.visibility='visible'; + to.visibility = 'visible'; from.x = 0; from.y = 0; to.x = animation.x; @@ -567,10 +581,10 @@ FluidbookLinks.prototype = { } else if (animation.type === 'zoomin' || animation.type === 'zoomout') { var s = (100 * animation.scale) + "%"; - from.backgroundPosition = to.backgroudPosition = '50% 50%'; + from.backgroundPosition = to.backgroudPosition = animation.transformorigin; from.backgroundSize = animation.type === 'zoomin' ? '100% 100%' : s + ' ' + s; to.backgroundSize = animation.type === 'zoomout' ? '100% 100%' : s + ' ' + s; - to.visibility='visible'; + to.visibility = 'visible'; if (Modernizr.firefox) { to.force3D = true; to.rotation = 0.01; @@ -579,7 +593,7 @@ FluidbookLinks.prototype = { } else if (animation.type === 'fadein') { from.display = 'none'; to.display = 'block'; - to.visibility='visible'; + to.visibility = 'visible'; from.opacity = 0; to.opacity = 1; } else if (animation.type === 'fadeout') { @@ -589,7 +603,7 @@ FluidbookLinks.prototype = { if (animation.type === 'reveal') { from.display = 'none'; to.display = 'block'; - to.visibility='visible'; + to.visibility = 'visible'; } var top = 0; -- 2.39.5