!(function ($) { "use strict"; const t = "liquidSectionFlow"; let e = {}; class i { constructor(i, s) { (this._defaults = e), (this._name = t), (this.options = { ...e, ...s }), (this.DOM = {}), (this.DOM.element = i), (this.DOM.panelStart = this.DOM.element.querySelector(".lqd-section-flow-panel-start")), (this.DOM.panelStartInner = this.DOM.panelStart.querySelector(".lqd-section-flow-panel-start-inner")), (this.DOM.panelEnd = this.DOM.element.querySelector(".lqd-section-flow-panel-end")), (this.DOM.itemsStart = [...this.DOM.panelStart.querySelectorAll(".lqd-section-flow-item")]), (this.DOM.itemsEnd = [...this.DOM.panelEnd.querySelectorAll(".lqd-section-flow-item")]), this.sizing(), this.init(); } sizing() { (this.DOM.panelStartInner.style.height = ""), (this.DOM.panelStartInner.style.height = `${$(this.DOM.itemsStart[this.DOM.itemsStart.length - 1]).outerHeight()}px`), this.DOM.itemsStart.forEach((t, e) => { (t.style.zIndex = ""), (t.style.zIndex = this.DOM.itemsStart.length - 1 - e); }); } init() { this.DOM.itemsEnd.forEach((t, e) => { const i = this.DOM.itemsStart[e], s = i.querySelector(".lqd-section-flow-item-inner"); gsap.to(t, { opacity: 1, scrollTrigger: { trigger: t, ease: "linear", start: "top center", end: "bottom center", toggleActions: "play reverse restart reverse", onEnter: () => { 0 !== e && (gsap.fromTo(i, { y: "-100%" }, { y: "0%" }), gsap.fromTo(s, { y: "100%" }, { y: "0%" })); }, onLeave: () => { e !== this.DOM.itemsStart.length - 1 && (gsap.fromTo(i, { y: "0%" }, { y: "100%" }), gsap.fromTo(s, { y: "0%" }, { y: "-100%" })); }, onEnterBack: () => { e !== this.DOM.itemsStart.length - 1 && (gsap.fromTo(i, { y: "100%" }, { y: "0%" }), gsap.fromTo(s, { y: "-100%" }, { y: "0%" })); }, onLeaveBack: () => { 0 !== e && (gsap.fromTo(i, { y: "0%" }, { y: "-100%" }), gsap.fromTo(s, { y: "0%" }, { y: "100%" })); }, }, }); }); } destroy() { this.DOM.itemsStart.forEach((t) => { gsap.killTweensOf(t), gsap.killTweensOf(t.querySelector("lqd-section-flow-item-inner")); }), this.DOM.itemsEnd.forEach((t) => { gsap.killTweensOf(t); }); } } $.fn[t] = function (e) { return this.each(function () { const s = { ...$(this).data("section-flow-options"), ...e }; $.data(this, "plugin_" + t) || $.data(this, "plugin_" + t, new i(this, s)); }); }; })(jQuery), jQuery(document).ready(function ($) { if (/Mobi|Android/i.test(navigator.userAgent)) { // Do nothing if it's a mobile device } else { $("[data-lqd-section-flow]").liquidSectionFlow(); } });