]> _ Git - fluidbook-html5.git/commitdiff
wip #5116 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Feb 2022 10:19:51 +0000 (11:19 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Feb 2022 10:19:51 +0000 (11:19 +0100)
js/libs/fluidbook/fluidbook.privacy.js
js/libs/fluidbook/fluidbook.splash.js
js/libs/fluidbook/forms/fluidbook.form.bulle.js

index 633ad581a22ffc210df14722ba104b912caeaa3f..4a03c31b291896d2d944f7e4649d1461b2b08508 100644 (file)
@@ -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');
     },
index b13ad446542a4ac7f47c86cf581f99800ff0fc8b..0c98e8e91d1e17e52749acc0b35e4414153c9cf1 100644 (file)
@@ -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');
 
index f650bf5dfbf717a85facab18f79dbbb7cfcc4f6b..f9169bc73a9af755cfac4475d1d64c3eb5b6ced3 100644 (file)
@@ -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 = '<div id="formBulle">';
-               res += '<a href="#" class="close"></a>';
-               res += "<p>";
-               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 += "</p>";
-               res += '<form action="" method="post">';
-               res += '<input type="hidden" name="catalogue" value="' + this.fluidbook.settings.title + '" />';
-               res += '<div><input type="text" name="nom" value="" required="required" placeholder="' + this.fluidbook.l10n.__('your name') + '" /></div>';
-               res += '<div><input type="text" name="prenom" value="" required="required" placeholder="' + this.fluidbook.l10n.__('your first name') + '" /></div>';
-               res += '<div><input type="email" name="email" value="" required="required" placeholder="' + this.fluidbook.l10n.__('your e-mail') + '" /></div>';
-               res += '<div><input type="submit" value="' + this.fluidbook.l10n.__('send') + '" /></div>';
-               res += '</form>';
-               res += '</div>';
-               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 = '<div id="formBulle">';
+        res += '<a href="#" class="close"></a>';
+        res += "<p>";
+        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 += "</p>";
+        res += '<form action="" method="post">';
+        res += '<input type="hidden" name="catalogue" value="' + this.fluidbook.settings.title + '" />';
+        res += '<div><input type="text" name="nom" value="" required="required" placeholder="' + this.fluidbook.l10n.__('your name') + '" /></div>';
+        res += '<div><input type="text" name="prenom" value="" required="required" placeholder="' + this.fluidbook.l10n.__('your first name') + '" /></div>';
+        res += '<div><input type="email" name="email" value="" required="required" placeholder="' + this.fluidbook.l10n.__('your e-mail') + '" /></div>';
+        res += '<div><input type="submit" value="' + this.fluidbook.l10n.__('send') + '" /></div>';
+        res += '</form>';
+        res += '</div>';
+        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