/* # ----------------------------------------------------------------------------- # ~/assets/theme/j1/modules/fam/js/fam.js # MODIFIED FAM JS from project Materialize # Provides JS Core funtions for the J1 FAM Module (Floating Button Menu) # # Product/Info: # https://jekyll.one # https://github.com/Dogfalo/materialize # # Copyright (C) 2023, 2024 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE # ----------------------------------------------------------------------------- # TODO: # jadams, 2020-10-11: module needs to be rewitten to PURE jQuery # ----------------------------------------------------------------------------- */ "use strict";!function(t,e){var s={direction:"top",hoverEnabled:!0,toolbarEnabled:!1};t.fn.reverse=[].reverse;class i{constructor(t,e,s){e instanceof Element||console.error(Error(e+" is not an HTML Element"));var i=t.getInstance(e);i&&i.destroy(),this.el=e,this.$el=cash(e)}static init(t,e,s){var i=null;if(e instanceof Element)i=new t(e,s);else if(e&&(e.jquery||e.cash||e instanceof NodeList)){for(var n=[],o=0;o{e({targets:s,opacity:1,scale:[.4,1],translateY:[this.offsetY,0],translateX:[this.offsetX,0],duration:275,delay:t,easing:"easeInOutQuad"}),t+=40})}_animateOutFAB(){this.$floatingBtnsReverse.each(t=>{e.remove(t),e({targets:t,opacity:0,scale:.4,translateY:this.offsetY,translateX:this.offsetX,duration:175,easing:"easeOutQuad",complete:()=>{this.$el.removeClass("active")}})})}_animateInToolbar(){var e,s=window.innerWidth,i=window.innerHeight,n=this.el.getBoundingClientRect(),o=t('
'),a=this.$anchor.css("background-color");this.$anchor.append(o),this.offsetX=n.left-s/2+n.width/2,this.offsetY=i-n.bottom,e=s/o[0].clientWidth,this.btnBottom=n.bottom,this.btnLeft=n.left,this.btnWidth=n.width,this.$el.addClass("active"),this.$el.css({"text-align":"center",width:"100%",bottom:0,left:0,transform:"translateX("+this.offsetX+"px)",transition:"none"}),this.$anchor.css({transform:"translateY("+-this.offsetY+"px)",transition:"none"}),o.css({"background-color":a}),setTimeout(()=>{this.$el.css({transform:"",transition:"transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s"}),this.$anchor.css({overflow:"visible",transform:"",transition:"transform .2s"}),setTimeout(()=>{this.$el.css({overflow:"hidden","background-color":a}),o.css({transform:"scale("+e+")",transition:"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)"}),this.$menu.children("li").children("a").css({opacity:1}),this._handleDocumentClickBound=this._handleDocumentClick.bind(this),window.addEventListener("scroll",this._handleCloseBound,!0),document.body.addEventListener("click",this._handleDocumentClickBound,!0)},100)},0)}_animateOutToolbar(){var t=window.innerWidth,e=window.innerHeight,s=this.$el.find(".fam-btn-backdrop"),i=this.$anchor.css("background-color");this.offsetX=this.btnLeft-t/2+this.btnWidth/2,this.offsetY=e-this.btnBottom,this.$el.removeClass("active"),this.$el.css({"background-color":"transparent",transition:"none"}),this.$anchor.css({transition:"none"}),s.css({transform:"scale(0)","background-color":i}),this.$menu.children("li").children("a").css({opacity:""}),setTimeout(()=>{s.remove(),this.$el.css({"text-align":"",width:"",bottom:"",left:"",overflow:"","background-color":"",transform:"translate3d("+-this.offsetX+"px,0,0)"}),this.$anchor.css({overflow:"",transform:"translate3d(0,"+this.offsetY+"px,0)"}),setTimeout(()=>{this.$el.css({transform:"translate3d(0,0,0)",transition:"transform .2s"}),this.$anchor.css({transform:"translate3d(0,0,0)",transition:"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)"})},20)},200)}}j1.fab=n,j1.jQueryLoaded=!!window.jQuery,j1.jQueryLoaded&&j1.initializeJqueryWrapper(n,"floatingActionButton","M_FloatingActionButton")}(cash,j1.anime);