From 67067ca133b5eebe7b0a84a9bfddda7441c5b888 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 22 Feb 2022 11:19:51 +0100 Subject: [PATCH] wip #5116 @0.5 --- js/libs/fluidbook/fluidbook.privacy.js | 2 +- js/libs/fluidbook/fluidbook.splash.js | 8 +- .../fluidbook/forms/fluidbook.form.bulle.js | 138 +++++++++--------- 3 files changed, 77 insertions(+), 71 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.privacy.js b/js/libs/fluidbook/fluidbook.privacy.js index 633ad581..4a03c31b 100644 --- a/js/libs/fluidbook/fluidbook.privacy.js +++ b/js/libs/fluidbook/fluidbook.privacy.js @@ -39,7 +39,7 @@ FluidbookPrivacy.prototype = { }, close: function () { // hide - $('#cookieConsent').fadeOut(); + gsap.to($('#cookieConsent'),{duration:0.5,autoAlpha:0}); // set the flag to avoid to display it for the next fisit localStorage.setItem(this.storageKey, '1'); }, diff --git a/js/libs/fluidbook/fluidbook.splash.js b/js/libs/fluidbook/fluidbook.splash.js index b13ad446..0c98e8e9 100644 --- a/js/libs/fluidbook/fluidbook.splash.js +++ b/js/libs/fluidbook/fluidbook.splash.js @@ -95,9 +95,11 @@ FluidbookSplash.prototype = { $(this).remove(); }); } else { - $("#splash").fadeOut(500, function () { - $(this.remove()); - }) + gsap.to($("#splash"), { + duration: 0.5, autoAlpha: 0, onComplete: function () { + $("#splash").remove(); + } + }); } $("#background").addClass('visible'); diff --git a/js/libs/fluidbook/forms/fluidbook.form.bulle.js b/js/libs/fluidbook/forms/fluidbook.form.bulle.js index f650bf5d..f9169bc7 100644 --- a/js/libs/fluidbook/forms/fluidbook.form.bulle.js +++ b/js/libs/fluidbook/forms/fluidbook.form.bulle.js @@ -1,77 +1,81 @@ function FluidbookBulleForm(fluidbook) { - this.fluidbook = fluidbook; - this.init(); + this.fluidbook = fluidbook; + this.init(); } FluidbookBulleForm.prototype = { - init: function() { - var $this = this; - $(this.fluidbook).on('fluidbook.ready', function() { - setTimeout(function() { - $this.display(); - }, 3000); - }); + init: function () { + var $this = this; + $(this.fluidbook).on('fluidbook.ready', function () { + setTimeout(function () { + $this.display(); + }, 3000); + }); - }, - getHTML: function() { - var res = '
'; - res += ''; - res += "

"; - var lang = this.fluidbook.l10n.getActiveLang(); - if (lang == 'fr') { - res += 'Merci de vous inscrire à l\'envoi électronique de nos catalogues. Vous recevrez ainsi nos prochaines parutions en primeur en plus de nous aider à réduire notre consommation de papier et notre empreinte sur l\'environnement.'; - } else if (lang == 'en') { - res += 'Thank you for subscribing to the electonic version of our catalogues. This will help reduce our paper consumption and our environmental footprint.'; - } - res += "

"; - res += '
'; - res += ''; - res += '
'; - res += '
'; - res += '
'; - res += '
'; - res += '
'; - res += '
'; - return res; - }, - display: function() { - $("#innerView").html(this.getHTML()).show(); - this.resize(); - this.initEvent(); - $("#innerView").hide().fadeIn(500); - }, - hide: function() { - $("#formBulle").fadeOut(500, function() { - $(this).remove(); - $("#innerView").hide(); - }); - }, - initEvent: function() { - var $this = this; + }, + getHTML: function () { + var res = '
'; + res += ''; + res += "

"; + var lang = this.fluidbook.l10n.getActiveLang(); + if (lang == 'fr') { + res += 'Merci de vous inscrire à l\'envoi électronique de nos catalogues. Vous recevrez ainsi nos prochaines parutions en primeur en plus de nous aider à réduire notre consommation de papier et notre empreinte sur l\'environnement.'; + } else if (lang == 'en') { + res += 'Thank you for subscribing to the electonic version of our catalogues. This will help reduce our paper consumption and our environmental footprint.'; + } + res += "

"; + res += '
'; + res += ''; + res += '
'; + res += '
'; + res += '
'; + res += '
'; + res += '
'; + res += '
'; + return res; + }, + display: function () { + var i=$("#innerView"); + i.html(this.getHTML()).show(); + this.resize(); + this.initEvent(); + i.hide(); + gsap.to(i,{duration:0.5,autoAlpha: 1}); + }, + hide: function () { + gsap.to($("#formBulle"), { + duration: 0.5, autoAlpha: 0, onComplete: function () { + $("#formBulle").remove(); + $("#innerView").hide(); + } + }); + }, + initEvent: function () { + var $this = this; - $("#formBulle .close").click(function() { - $this.hide(); - return false; - }); - $('#formBulle form').submit(function() { - $(this).ajaxSubmit({ - url: 'https://workshop.fluidbook.com/services/bulle', - success: function(data) { - $this.hide(); - } - }) + $("#formBulle .close").click(function () { + $this.hide(); + return false; + }); + $('#formBulle form').submit(function () { + $(this).ajaxSubmit({ + url: 'https://workshop.fluidbook.com/services/bulle', + success: function (data) { + $this.hide(); + } + }) - return false; - }); - }, - resize: function() { - var wh = $(window).height(), ww = $(window).width(); - $("#innerView").css({ - width: ww, - height: wh - }); + return false; + }); + }, + resize: function () { + var wh = $(window).height(), ww = $(window).width(); + $("#innerView").css({ + width: ww, + height: wh + }); - $("#formBulle").css({width: 316, height: 316, top: (wh - 316) / 2, left: (ww - 316) / 2}); - } + $("#formBulle").css({width: 316, height: 316, top: (wh - 316) / 2, left: (ww - 316) / 2}); + } }; \ No newline at end of file -- 2.39.5