From e0b908fdec7dcff088701642a3f20bdf483766d8 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 21 Feb 2022 19:41:25 +0100 Subject: [PATCH] wip #5116 @0.5 --- js/libs/fluidbook/fluidbook.js | 5 ++- js/libs/fluidbook/fluidbook.links.js | 51 ++++++++-------------------- 2 files changed, 17 insertions(+), 39 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index b86e341f..d63d7171 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -750,12 +750,11 @@ Fluidbook.prototype = { }, hideMenuItems: function () { - $('#menuList > ul > li, #shareLinks,footer#mobile-credits').fadeOut(100); - + gsap.to($('#menuList > ul > li, #shareLinks,footer#mobile-credits'),{duration:0.1, autoAlpha: 0}); }, showMenuItems: function () { - $('#menuList > ul > li, #shareLinks,footer#mobile-credits').fadeIn(300); + gsap.to($('#menuList > ul > li, #shareLinks,footer#mobile-credits'),{duration:0.3,autoAlpha:1}); }, print: function (button) { diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index ebf99e6a..1110d2f2 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -669,17 +669,13 @@ FluidbookLinks.prototype = { var left = 0; var rectinit = 'rect(0px,' + w + 'px,' + h + 'px,0px)'; - if ((animation.direction === 'left' && animation.type === 'unmask') || - (animation.direction === 'right' && animation.type === 'reveal')) { + if ((animation.direction === 'left' && animation.type === 'unmask') || (animation.direction === 'right' && animation.type === 'reveal')) { right = 0; - } else if ((animation.direction === 'right' && animation.type === 'unmask') || - (animation.direction === 'left' && animation.type === 'reveal')) { + } else if ((animation.direction === 'right' && animation.type === 'unmask') || (animation.direction === 'left' && animation.type === 'reveal')) { left = w; - } else if ((animation.direction === 'up' && animation.type === 'unmask') || - (animation.direction === 'down' && animation.type === 'reveal')) { + } else if ((animation.direction === 'up' && animation.type === 'unmask') || (animation.direction === 'down' && animation.type === 'reveal')) { bottom = 0; - } else if ((animation.direction === 'down' && animation.type === 'unmask') || - (animation.direction === 'up' && animation.type === 'reveal')) { + } else if ((animation.direction === 'down' && animation.type === 'unmask') || (animation.direction === 'up' && animation.type === 'reveal')) { top = h; } var rect = 'rect(' + top + 'px,' + right + 'px,' + bottom + 'px,' + left + 'px);'; @@ -719,18 +715,13 @@ FluidbookLinks.prototype = { // init radian var rad = Math.PI / 180; // first circle (bigger) - var x1 = cx + r * Math.cos(-startAngle * rad), - x2 = cx + r * Math.cos(-endAngle * rad), - y1 = cy + r * Math.sin(-startAngle * rad), - y2 = cy + r * Math.sin(-endAngle * rad); + var x1 = cx + r * Math.cos(-startAngle * rad), x2 = cx + r * Math.cos(-endAngle * rad), + y1 = cy + r * Math.sin(-startAngle * rad), y2 = cy + r * Math.sin(-endAngle * rad); // second circle / donut section var r1 = r * pct; - var - x3 = cx + r1 * Math.cos(-endAngle * rad), - y3 = cy + r1 * Math.sin(-endAngle * rad), - x4 = cx + r1 * Math.cos(-startAngle * rad), - y4 = cy + r1 * Math.sin(-startAngle * rad); + var x3 = cx + r1 * Math.cos(-endAngle * rad), y3 = cy + r1 * Math.sin(-endAngle * rad), + x4 = cx + r1 * Math.cos(-startAngle * rad), y4 = cy + r1 * Math.sin(-startAngle * rad); var long = +(endAngle - startAngle > 180); return paper.path(["M", x4, y4, "L", x1, y1, "A", r, r, 0, long, 0, x2, y2, "L", x3, y3, "A", r1, r1, 0, long, 1, x4, y4, "z"]).attr(params); @@ -745,8 +736,7 @@ FluidbookLinks.prototype = { to.onUpdate = function () { paper.clear(); sector(paper, cx, cy, radius, animation.innerradius, linkElement.angle, to.angle, { - fill: bgc, - stroke: 'none' + fill: bgc, stroke: 'none' }); }; } else if (animation.type === 'number') { @@ -801,8 +791,7 @@ FluidbookLinks.prototype = { } else if (animation.type === 'draggable') { $(link).css('pointer-events', 'auto'); var draggable = new Draggable(link, { - type: 'x', - onRelease: function () { + type: 'x', onRelease: function () { var d = this; if (animation.drop === 'click') { $('#links .link a').each(function () { @@ -812,7 +801,7 @@ FluidbookLinks.prototype = { $(e).click(); }, 500); - TweenLite.to($(link), 0.5, {x: 0, y: 0}); + gsap.to($(link), {duration: 0.5, x: 0, y: 0}); return true; } }); @@ -906,10 +895,7 @@ FluidbookLinks.prototype = { if (repetitions > 0) { el.css('opacity', 0); timeline.add(gsap.to(el, { - duration: this.fluidbook.settings.linkBlinkTime * speed, - delay: 0.1, - opacity: 1, - ease: 'none' + duration: this.fluidbook.settings.linkBlinkTime * speed, delay: 0.1, opacity: 1, ease: 'none' })); d = 0; } else { @@ -917,21 +903,14 @@ FluidbookLinks.prototype = { } for (var i = 0; i < repetitions; i++) { timeline.add(gsap.to(el, { - duration: this.fluidbook.settings.linkBlinkTime * speed, - opacity: 0.5, - ease: 'none' + duration: this.fluidbook.settings.linkBlinkTime * speed, opacity: 0.5, ease: 'none' })); timeline.add(gsap.to(el, { - duration: this.fluidbook.settings.linkBlinkTime * speed, - opacity: 1, - ease: 'none' + duration: this.fluidbook.settings.linkBlinkTime * speed, opacity: 1, ease: 'none' })); } timeline.add(gsap.to(el, { - duration: this.fluidbook.settings.linkBlinkTime, - delay: d, - opacity: 0, - onComplete: _complete + duration: this.fluidbook.settings.linkBlinkTime, delay: d, opacity: 0, onComplete: _complete })); timeline.play(); }, -- 2.39.5