├── .gitattributes ├── .gitignore ├── .htmlnanorc.uu ├── LICENSE ├── README.md ├── dist ├── 1.1770e3b3.jpg ├── 10.f7990335.jpg ├── 11.ef4a18eb.jpg ├── 12.1c611c29.jpg ├── 2.07ca36b5.jpg ├── 3.f6f48295.jpg ├── 4.516b9c03.jpg ├── 5.95d97ae8.jpg ├── 6.56a5d53b.jpg ├── 7.87dc6e8b.jpg ├── 8.0bda5054.jpg ├── 9.27ccf354.jpg ├── favicon.a64e97b2.ico ├── index.b5e7c14d.js ├── index.d73f7ad5.css ├── index.e9a2d1b4.js └── index.html ├── package.json └── src ├── css └── base.css ├── favicon.ico ├── img ├── 1.jpg ├── 10.jpg ├── 11.jpg ├── 12.jpg ├── 2.jpg ├── 3.jpg ├── 4.jpg ├── 5.jpg ├── 6.jpg ├── 7.jpg ├── 8.jpg └── 9.jpg ├── index.html └── js ├── index.js ├── item.js ├── preloader.js └── utils.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .cache 3 | .parcel-cache 4 | package-lock.json -------------------------------------------------------------------------------- /.htmlnanorc.uu: -------------------------------------------------------------------------------- 1 | { 2 | "minifySvg": false 3 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2009 - 2021 [Codrops](https://tympanus.net/codrops) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # On-Scroll Animation and View Switch 2 | 3 | A layout with some scroll animations and a view switch where the content items animate to a grid. 4 | 5 | ![Image Title](https://i7x7p5b7.stackpathcdn.com/codrops/wp-content/uploads/2022/10/ScrollAnim_feat.jpg) 6 | 7 | [Article on Codrops](https://tympanus.net/codrops/?p=65117) 8 | 9 | [Demo](http://tympanus.net/Development/OnScrollViewSwitch/) 10 | 11 | 12 | ## Installation 13 | 14 | Install dependencies: 15 | 16 | ``` 17 | npm install 18 | ``` 19 | 20 | Compile the code for development and start a local server: 21 | 22 | ``` 23 | npm start 24 | ``` 25 | 26 | Create the build: 27 | 28 | ``` 29 | npm run build 30 | ``` 31 | 32 | ## Credits 33 | 34 | - Images from [Unsplash](https://unsplash.com/) 35 | 36 | ## Misc 37 | 38 | Follow Codrops: [Twitter](http://www.twitter.com/codrops), [Facebook](http://www.facebook.com/codrops), [GitHub](https://github.com/codrops), [Instagram](https://www.instagram.com/codropsss/) 39 | 40 | ## License 41 | [MIT](LICENSE) 42 | 43 | Made with :blue_heart: by [Codrops](http://www.codrops.com) 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /dist/1.1770e3b3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/1.1770e3b3.jpg -------------------------------------------------------------------------------- /dist/10.f7990335.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/10.f7990335.jpg -------------------------------------------------------------------------------- /dist/11.ef4a18eb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/11.ef4a18eb.jpg -------------------------------------------------------------------------------- /dist/12.1c611c29.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/12.1c611c29.jpg -------------------------------------------------------------------------------- /dist/2.07ca36b5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/2.07ca36b5.jpg -------------------------------------------------------------------------------- /dist/3.f6f48295.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/3.f6f48295.jpg -------------------------------------------------------------------------------- /dist/4.516b9c03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/4.516b9c03.jpg -------------------------------------------------------------------------------- /dist/5.95d97ae8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/5.95d97ae8.jpg -------------------------------------------------------------------------------- /dist/6.56a5d53b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/6.56a5d53b.jpg -------------------------------------------------------------------------------- /dist/7.87dc6e8b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/7.87dc6e8b.jpg -------------------------------------------------------------------------------- /dist/8.0bda5054.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/8.0bda5054.jpg -------------------------------------------------------------------------------- /dist/9.27ccf354.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/9.27ccf354.jpg -------------------------------------------------------------------------------- /dist/favicon.a64e97b2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/dist/favicon.a64e97b2.ico -------------------------------------------------------------------------------- /dist/index.b5e7c14d.js: -------------------------------------------------------------------------------- 1 | !function(){function t(t){return t&&t.__esModule?t.default:t}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},r={},i=e.parcelRequire2011;null==i&&((i=function(t){if(t in n)return n[t].exports;if(t in r){var e=r[t];delete r[t];var i={id:t,exports:{}};return n[t]=i,e.call(i.exports,i,i.exports),i.exports}var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(t,e){r[t]=e},e.parcelRequire2011=i),i.register("hobco",(function(t,e){!function(e,n){t.exports?t.exports=n():e.EvEmitter=n()}("undefined"!=typeof window?window:t.exports,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let n=this._events=this._events||{},r=n[t]=n[t]||[];return r.includes(e)||r.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this},e.off=function(t,e){let n=this._events&&this._events[t];if(!n||!n.length)return this;let r=n.indexOf(e);return-1!=r&&n.splice(r,1),this},e.emitEvent=function(t,e){let n=this._events&&this._events[t];if(!n||!n.length)return this;n=n.slice(0),e=e||[];let r=this._onceEvents&&this._onceEvents[t];for(let i of n){r&&r[i]&&(this.off(t,i),delete r[i]),i.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t}))}));var o,s,a={}; 2 | /*! 3 | * imagesLoaded v5.0.0 4 | * JavaScript is all like "You images are done yet or what?" 5 | * MIT License 6 | */o="undefined"!=typeof window?window:a,s=function(t,e){let n=t.jQuery,r=t.console;function i(t,e,o){if(!(this instanceof i))return new i(t,e,o);let s=t;var a;"string"==typeof t&&(s=document.querySelectorAll(t)),s?(this.elements=(a=s,Array.isArray(a)?a:"object"==typeof a&&"number"==typeof a.length?[...a]:[a]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),n&&(this.jqDeferred=new n.Deferred),setTimeout(this.check.bind(this))):r.error(`Bad element for imagesLoaded ${s||t}`)}i.prototype=Object.create(e.prototype),i.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];i.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let n=t.querySelectorAll("img");for(let t of n)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const s=/url\((['"])?(.*?)\1\)/gi;function a(t){this.img=t}function u(t,e){this.url=t,this.element=e,this.img=new Image}return i.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let n=s.exec(e.backgroundImage);for(;null!==n;){let r=n&&n[2];r&&this.addBackground(r,t),n=s.exec(e.backgroundImage)}},i.prototype.addImage=function(t){let e=new a(t);this.images.push(e)},i.prototype.addBackground=function(t,e){let n=new u(t,e);this.images.push(n)},i.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,n)=>{setTimeout((()=>{this.progress(t,e,n)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},i.prototype.progress=function(t,e,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&r&&r.log(`progress: ${n}`,t,e)},i.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},a.prototype=Object.create(e.prototype),a.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},a.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},a.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:n}=this.img,r="PICTURE"===n.nodeName?n:this.img;this.emitEvent("progress",[this,r,e])},a.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},a.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},a.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},a.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},u.prototype=Object.create(a.prototype),u.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},u.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},u.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},i.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(n=e,n.fn.imagesLoaded=function(t,e){return new i(this,t,e).jqDeferred.promise(n(this))})},i.makeJQueryPlugin(),i},a?a=s(o,i("hobco")):o.imagesLoaded=s(o,o.EvEmitter);class u{constructor(t){var e,n,r;r={el:null,caption:null,imageWrap:null,image:null,imageInner:null,title:null,titleInner:null,number:null,numberInner:null,description:null},(n="DOM")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.DOM.el=t,this.DOM.caption=this.DOM.el.querySelector(".item__caption"),this.DOM.imageWrap=this.DOM.el.querySelector(".item__image-wrap"),this.DOM.image=this.DOM.el.querySelector(".item__image"),this.DOM.imageInner=this.DOM.image.querySelector(".item__image-inner"),this.DOM.title=this.DOM.el.querySelector(".item__caption-title"),this.DOM.titleInner=this.DOM.title.querySelector(".oh__inner"),this.DOM.number=this.DOM.el.querySelector(".item__caption-number"),this.DOM.numberInner=this.DOM.number.querySelector(".oh__inner"),this.DOM.description=this.DOM.el.querySelector(".item__caption-description")}}var l={};function c(){}c.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var r=this;function i(){r.off(t,i),e.apply(n,arguments)}return i._=e,this.on(t,i,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,i=n.length;r1,hasPointer:!!window.navigator.msPointerEnabled,hasKeyDown:"onkeydown"in document,isFirefox:navigator.userAgent.indexOf("Firefox")>-1}),n(this,a)[a]=Object.assign({mouseMultiplier:1,touchMultiplier:2,firefoxMultiplier:15,keyStep:120,preventTouch:!1,unpreventTouchClass:"vs-touchmove-allowed",useKeyboard:!0,useTouch:!0},t),n(this,l)[l]=new i,n(this,c)[c]={y:0,x:0,deltaX:0,deltaY:0},n(this,h)[h]={x:null,y:null},n(this,f)[f]=null,void 0!==n(this,a)[a].passive&&(this.listenerOptions={passive:n(this,a)[a].passive})}var e=t.prototype;return e._notify=function(t){var e=n(this,c)[c];e.x+=e.deltaX,e.y+=e.deltaY,n(this,l)[l].emit(s,{x:e.x,y:e.y,deltaX:e.deltaX,deltaY:e.deltaY,originalEvent:t})},e._bind=function(){o.hasWheelEvent&&n(this,u)[u].addEventListener("wheel",this._onWheel,this.listenerOptions),o.hasMouseWheelEvent&&n(this,u)[u].addEventListener("mousewheel",this._onMouseWheel,this.listenerOptions),o.hasTouch&&n(this,a)[a].useTouch&&(n(this,u)[u].addEventListener("touchstart",this._onTouchStart,this.listenerOptions),n(this,u)[u].addEventListener("touchmove",this._onTouchMove,this.listenerOptions)),o.hasPointer&&o.hasTouchWin&&(n(this,f)[f]=document.body.style.msTouchAction,document.body.style.msTouchAction="none",n(this,u)[u].addEventListener("MSPointerDown",this._onTouchStart,!0),n(this,u)[u].addEventListener("MSPointerMove",this._onTouchMove,!0)),o.hasKeyDown&&n(this,a)[a].useKeyboard&&document.addEventListener("keydown",this._onKeyDown)},e._unbind=function(){o.hasWheelEvent&&n(this,u)[u].removeEventListener("wheel",this._onWheel),o.hasMouseWheelEvent&&n(this,u)[u].removeEventListener("mousewheel",this._onMouseWheel),o.hasTouch&&(n(this,u)[u].removeEventListener("touchstart",this._onTouchStart),n(this,u)[u].removeEventListener("touchmove",this._onTouchMove)),o.hasPointer&&o.hasTouchWin&&(document.body.style.msTouchAction=n(this,f)[f],n(this,u)[u].removeEventListener("MSPointerDown",this._onTouchStart,!0),n(this,u)[u].removeEventListener("MSPointerMove",this._onTouchMove,!0)),o.hasKeyDown&&n(this,a)[a].useKeyboard&&document.removeEventListener("keydown",this._onKeyDown)},e.on=function(t,e){n(this,l)[l].on(s,t,e);var r=n(this,l)[l].e;r&&r[s]&&1===r[s].length&&this._bind()},e.off=function(t,e){n(this,l)[l].off(s,t,e);var r=n(this,l)[l].e;(!r[s]||r[s].length<=0)&&this._unbind()},e.destroy=function(){n(this,l)[l].off(),this._unbind()},t}()}();var m=["duration","easing"],v=function(){function t(){}var e=t.prototype;return e.to=function(t,e){var n=this,r=void 0===e?{}:e,i=r.duration,o=void 0===i?1:i,s=r.easing,a=void 0===s?function(t){return t}:s,u=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(r,m);this.target=t,this.fromKeys=d({},u),this.toKeys=d({},u),this.keys=Object.keys(d({},u)),this.keys.forEach((function(e){n.fromKeys[e]=t[e]})),this.duration=o,this.easing=a,this.currentTime=0,this.isRunning=!0},e.stop=function(){this.isRunning=!1},e.raf=function(t){var e=this;if(this.isRunning){this.currentTime=Math.min(this.currentTime+.001*t,this.duration);var n=this.easing(this.progress);this.keys.forEach((function(t){var r=e.fromKeys[t];e.target[t]=r+(e.toKeys[t]-r)*n})),1===n&&(this.isRunning=!1)}},p(t,[{key:"progress",get:function(){return this.currentTime/this.duration}}]),t}(),_=function(e){var n,r;function i(n){var r,i,o,s,a=void 0===n?{}:n,u=a.duration,l=void 0===u?1.2:u,c=a.easing,f=void 0===c?function(t){return 1===t?1:1-Math.pow(2,-10*t)}:c,p=a.smooth,d=void 0===p||p,g=a.smoothTouch,m=void 0!==g&&g,_=a.touchMultiplier,y=void 0===_?2:_,w=a.direction,b=void 0===w?"vertical":w,x=a.wrapper,T=void 0===x?window:x,O=a.content,M=void 0===O?document.body:O;(s=e.call(this)||this).onWindowResize=function(){s.wrapperWidth=window.innerWidth,s.wrapperHeight=window.innerHeight},s.onWrapperResize=function(t){var e=t[0];if(e){var n=e.contentRect;s.wrapperWidth=n.width,s.wrapperHeight=n.height}},s.onContentResize=function(t){var e=t[0];if(e){var n=e.contentRect;s.contentWidth=n.width,s.contentHeight=n.height}},s.onVirtualScroll=function(t){var e=t.deltaY,n=t.originalEvent;n.ctrlKey||(s.smooth=n.changedTouches?s.smoothTouch:s.options.smooth,s.stopped?n.preventDefault():s.smooth&&4!==n.buttons&&(s.smooth&&n.preventDefault(),s.targetScroll-=e,s.targetScroll=Math.max(0,Math.min(s.targetScroll,s.limit)),s.scrollTo(s.targetScroll)))},s.onScroll=function(t){s.isScrolling&&s.smooth||(s.targetScroll=s.scroll=s.lastScroll=s.wrapperNode[s.scrollProperty],s.notify())},window.lenisVersion="0.2.8",s.options={duration:l,easing:f,smooth:d,smoothTouch:m,touchMultiplier:y,direction:b,wrapper:T,content:M},s.wrapperNode=T,s.contentNode=M,s.duration=l,s.easing=f,s.smooth=d,s.smoothTouch=m,s.touchMultiplier=y,s.direction=b,s.wrapperNode.addEventListener("scroll",s.onScroll),s.wrapperNode===window?(s.wrapperNode.addEventListener("resize",s.onWindowResize),s.onWindowResize()):(s.wrapperHeight=s.wrapperNode.offsetHeight,s.wrapperWidth=s.wrapperNode.offsetWidth,s.wrapperObserver=new ResizeObserver(s.onWrapperResize),s.wrapperObserver.observe(s.wrapperNode)),s.contentHeight=s.contentNode.offsetHeight,s.contentWidth=s.contentNode.offsetWidth,s.contentObserver=new ResizeObserver(s.onContentResize),s.contentObserver.observe(s.contentNode),s.targetScroll=s.scroll=s.lastScroll=s.wrapperNode[s.scrollProperty],s.animate=new v;var k=(null==(r=navigator)||null==(i=r.userAgentData)?void 0:i.platform)||(null==(o=navigator)?void 0:o.platform)||"unknown";return s.virtualScroll=new(t(h))({el:s.wrapperNode,firefoxMultiplier:50,mouseMultiplier:k.includes("Win")?1:.4,useKeyboard:!1,touchMultiplier:s.touchMultiplier,useTouch:!0,passive:!1}),s.virtualScroll.on(s.onVirtualScroll),s}r=e,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,g(n,r);var o=i.prototype;return o.start=function(){this.stopped=!1},o.stop=function(){this.stopped=!0,this.animate.stop()},o.destroy=function(){var t;this.wrapperNode===window&&this.wrapperNode.removeEventListener("resize",this.onWindowResize),this.wrapperNode.removeEventListener("scroll",this.onScroll),this.virtualScroll.destroy(),null==(t=this.wrapperObserver)||t.disconnect(),this.contentObserver.disconnect()},o.raf=function(t){var e=t-(this.now||0);this.now=t,!this.stopped&&this.smooth&&(this.lastScroll=this.scroll,this.animate.raf(e),this.scroll===this.targetScroll&&(this.lastScroll=this.scroll),this.isScrolling&&(this.setScroll(this.scroll),this.notify()),this.isScrolling=this.scroll!==this.targetScroll)},o.setScroll=function(t){"horizontal"===this.direction?this.wrapperNode.scrollTo(t,0):this.wrapperNode.scrollTo(0,t)},o.notify=function(){this.emit("scroll",{scroll:this.scroll,limit:this.limit,velocity:this.velocity,direction:this.direction,progress:this.scroll/this.limit})},o.scrollTo=function(t,e){var n,r=void 0===e?{}:e,i=r.offset,o=void 0===i?0:i,s=r.immediate,a=void 0!==s&&s,u=r.duration,l=void 0===u?this.duration:u,c=r.easing,h=void 0===c?this.easing:c;if("number"==typeof t)n=t;else if("top"===t||"#top"===t)n=0;else if("bottom"===t)n=this.limit;else{var f;if("string"==typeof t)f=document.querySelector(t);else{if(null==t||!t.nodeType)return;f=t}if(!t)return;var p=0;if(this.wrapperNode!==window){var d=this.wrapperNode.getBoundingClientRect();p="horizontal"===this.direction?d.left:d.top}var g=f.getBoundingClientRect();n=("horizontal"===this.direction?g.left:g.top)+this.scroll-p}this.targetScroll=n+=o,!this.smooth||a?this.setScroll(this.targetScroll):this.animate.to(this,{duration:l,easing:h,scroll:this.targetScroll})},p(i,[{key:"scrollProperty",get:function(){return this.wrapperNode===window?"horizontal"===this.direction?"scrollX":"scrollY":"horizontal"===this.direction?"scrollLeft":"scrollTop"}},{key:"limit",get:function(){return"horizontal"===this.direction?this.contentWidth-this.wrapperWidth:this.contentHeight-this.wrapperHeight}},{key:"velocity",get:function(){return this.scroll-this.lastScroll}}]),i}(t(l));function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e} 7 | /*! 8 | * GSAP 3.11.2 9 | * https://greensock.com 10 | * 11 | * @license Copyright 2008-2022, GreenSock. All rights reserved. 12 | * Subject to the terms at https://greensock.com/standard-license or for 13 | * Club GreenSock members, the agreement issued with that membership. 14 | * @author: Jack Doyle, jack@greensock.com 15 | */var b,x,T,O,M,k,S,E,C,D,P,A,I,L,R,B,z,V,N,Y,X,F,W,q,j,H,U,K,G,Q,$={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Z={duration:.5,overwrite:!1,delay:0},J=1e8,tt=1e-8,et=2*Math.PI,nt=et/4,rt=0,it=Math.sqrt,ot=Math.cos,st=Math.sin,at=function(t){return"string"==typeof t},ut=function(t){return"function"==typeof t},lt=function(t){return"number"==typeof t},ct=function(t){return void 0===t},ht=function(t){return"object"==typeof t},ft=function(t){return!1!==t},pt=function(){return"undefined"!=typeof window},dt=function(t){return ut(t)||at(t)},gt="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},mt=Array.isArray,vt=/(?:-?\.?\d|\.)+/gi,_t=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,yt=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,wt=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,bt=/[+-]=-?[.\d]+/,xt=/[^,'"\[\]\s]+/gi,Tt=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ot={},Mt={},kt=function(t){return(Mt=ee(t,Ot))&&er},St=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},Et=function(t,e){return!e&&console.warn(t)},Ct=function(t,e){return t&&(Ot[t]=e)&&Mt&&(Mt[t]=e)||Ot},Dt=function(){return 0},Pt={suppressEvents:!0,isStart:!0,kill:!1},At={suppressEvents:!0,kill:!1},It={suppressEvents:!0},Lt={},Rt=[],Bt={},zt={},Vt={},Nt=30,Yt=[],Xt="",Ft=function(t){var e,n,r=t[0];if(ht(r)||ut(r)||(t=[t]),!(e=(r._gsap||{}).harness)){for(n=Yt.length;n--&&!Yt[n].targetTest(r););e=Yt[n]}for(n=t.length;n--;)t[n]&&(t[n]._gsap||(t[n]._gsap=new mn(t[n],e)))||t.splice(n,1);return t},Wt=function(t){return t._gsap||Ft(Ie(t))[0]._gsap},qt=function(t,e,n){return(n=t[e])&&ut(n)?t[e]():ct(n)&&t.getAttribute&&t.getAttribute(e)||n},jt=function(t,e){return(t=t.split(",")).forEach(e)||t},Ht=function(t){return Math.round(1e5*t)/1e5||0},Ut=function(t){return Math.round(1e7*t)/1e7||0},Kt=function(t,e){var n=e.charAt(0),r=parseFloat(e.substr(2));return t=parseFloat(t),"+"===n?t+r:"-"===n?t-r:"*"===n?t*r:t/r},Gt=function(t,e){for(var n=e.length,r=0;t.indexOf(e[r])<0&&++ro;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[r]=e,e._prev=s,e.parent=e._dp=t,e},se=function(t,e,n,r){void 0===n&&(n="_first"),void 0===r&&(r="_last");var i=e._prev,o=e._next;i?i._next=o:t[n]===e&&(t[n]=o),o?o._prev=i:t[r]===e&&(t[r]=i),e._next=e._prev=e.parent=null},ae=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove(t),t._act=0},ue=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},le=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},ce=function(t,e,n,r){return t._startAt&&(x?t._startAt.revert(At):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,r))},he=function t(e){return!e||e._ts&&t(e.parent)},fe=function(t){return t._repeat?pe(t._tTime,t=t.duration()+t._rDelay)*t:0},pe=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},de=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},ge=function(t){return t._end=Ut(t._start+(t._tDur/Math.abs(t._ts||t._rts||tt)||0))},me=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=Ut(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),ge(t),n._dirty||ue(n,t)),t},ve=function(t,e){var n;if((e._time||e._initted&&!e._dur)&&(n=de(t.rawTime(),e),(!e._dur||Ce(0,e.totalDuration(),n)-e._tTime>tt)&&e.render(n,!0)),ue(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-1e-8}},_e=function(t,e,n,r){return e.parent&&ae(e),e._start=Ut((lt(n)?n:n||t!==O?ke(t,n,e):t._time)+e._delay),e._end=Ut(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),oe(t,e,"_first","_last",t._sort?"_start":0),xe(e)||(t._recent=e),r||ve(t,e),t._ts<0&&me(t,t._tTime),t},ye=function(t,e){return(Ot.ScrollTrigger||St("scrollTrigger",e))&&Ot.ScrollTrigger.create(e,t)},we=function(t,e,n,r,i){return On(t,e,i),t._initted?!n&&t._pt&&!x&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&C!==nn.frame?(Rt.push(t),t._lazy=[i,r],1):void 0:1},be=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},xe=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},Te=function(t,e,n,r){var i=t._repeat,o=Ut(e)||0,s=t._tTime/t._tDur;return s&&!r&&(t._time*=o/t._dur),t._dur=o,t._tDur=i?i<0?1e10:Ut(o*(i+1)+t._rDelay*i):o,s>0&&!r&&me(t,t._tTime=t._tDur*s),t.parent&&ge(t),n||ue(t.parent,t),t},Oe=function(t){return t instanceof _n?ue(t):Te(t,t._dur)},Me={_start:0,endTime:Dt,totalDuration:Dt},ke=function t(e,n,r){var i,o,s,a=e.labels,u=e._recent||Me,l=e.duration()>=J?u.endTime(!1):e._dur;return at(n)&&(isNaN(n)||n in a)?(o=n.charAt(0),s="%"===n.substr(-1),i=n.indexOf("="),"<"===o||">"===o?(i>=0&&(n=n.replace(/=/,"")),("<"===o?u._start:u.endTime(u._repeat>=0))+(parseFloat(n.substr(1))||0)*(s?(i<0?u:r).totalDuration()/100:1)):i<0?(n in a||(a[n]=l),a[n]):(o=parseFloat(n.charAt(i-1)+n.substr(i+1)),s&&r&&(o=o/100*(mt(r)?r[0]:r).totalDuration()),i>1?t(e,n.substr(0,i-1),r)+o:l+o)):null==n?l:+n},Se=function(t,e,n){var r,i,o=lt(e[1]),s=(o?2:1)+(t<2?0:1),a=e[s];if(o&&(a.duration=e[1]),a.parent=n,t){for(r=a,i=n;i&&!("immediateRender"in r);)r=i.vars.defaults||{},i=ft(i.vars.inherit)&&i.parent;a.immediateRender=ft(r.immediateRender),t<2?a.runBackwards=1:a.startAt=e[s-1]}return new Cn(e[0],a,e[s+1])},Ee=function(t,e){return t||0===t?e(t):e},Ce=function(t,e,n){return ne?e:n},De=function(t,e){return at(t)&&(e=Tt.exec(t))?e[1]:""},Pe=[].slice,Ae=function(t,e){return t&&ht(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&ht(t[0]))&&!t.nodeType&&t!==M},Ie=function(t,e,n){return T&&!e&&T.selector?T.selector(t):!at(t)||n||!k&&rn()?mt(t)?function(t,e,n){return void 0===n&&(n=[]),t.forEach((function(t){var r;return at(t)&&!e||Ae(t,1)?(r=n).push.apply(r,Ie(t)):n.push(t)}))||n}(t,n):Ae(t)?Pe.call(t,0):t?[t]:[]:Pe.call((e||S).querySelectorAll(t),0)},Le=function(t){return t=Ie(t)[0]||Et("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return Ie(e,n.querySelectorAll?n:n===t?Et("Invalid scope")||S.createElement("div"):t)}},Re=function(t){return t.sort((function(){return.5-Math.random()}))},Be=function(t){if(ut(t))return t;var e=ht(t)?t:{each:t},n=hn(e.ease),r=e.from||0,i=parseFloat(e.base)||0,o={},s=r>0&&r<1,a=isNaN(r)||s,u=e.axis,l=r,c=r;return at(r)?l=c={center:.5,edges:.5,end:1}[r]||0:!s&&a&&(l=r[0],c=r[1]),function(t,s,h){var f,p,d,g,m,v,_,y,w,b=(h||e).length,x=o[b];if(!x){if(!(w="auto"===e.grid?0:(e.grid||[1,J])[1])){for(_=-1e8;_<(_=h[w++].getBoundingClientRect().left)&&w_&&(_=m),mb?b-1:u?"y"===u?b/w:w:Math.max(w,b/w))||0)*("edges"===r?-1:1),x.b=b<0?i-b:i,x.u=De(e.amount||e.each)||0,n=n&&b<0?ln(n):n}return b=(x[t]-x.min)/x.max||0,Ut(x.b+(n?n(b):b)*x.v)+x.u}},ze=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var r=Ut(Math.round(parseFloat(n)/t)*t*e);return(r-r%1)/e+(lt(n)?0:De(n))}},Ve=function(t,e){var n,r,i=mt(t);return!i&&ht(t)&&(n=i=t.radius||J,t.values?(t=Ie(t.values),(r=!lt(t[0]))&&(n*=n)):t=ze(t.increment)),Ee(e,i?ut(t)?function(e){return r=t(e),Math.abs(r-e)<=n?r:e}:function(e){for(var i,o,s=parseFloat(r?e.x:e),a=parseFloat(r?e.y:0),u=J,l=0,c=t.length;c--;)(i=r?(i=t[c].x-s)*i+(o=t[c].y-a)*o:Math.abs(t[c]-s))(i=Math.abs(i))&&(o=r,a=i);return o},qe=function(t,e,n){var r,i,o,s=t.vars,a=s[e],u=T,l=t._ctx;if(a)return r=s[e+"Params"],i=s.callbackScope||t,n&&Rt.length&&Qt(),l&&(T=l),o=r?a.apply(i,r):a.call(i),T=u,o},je=function(t){return ae(t),t.scrollTrigger&&t.scrollTrigger.kill(!!x),t.progress()<1&&qe(t,"onInterrupt"),t},He=function(t){var e=(t=!t.name&&t.default||t).name,n=ut(t),r=e&&!n&&t.init?function(){this._props=[]}:t,i={init:Dt,render:Vn,add:xn,kill:Yn,modifier:Nn,rawVars:0},o={targetTest:0,get:0,getSetter:Ln,aliases:{},register:0};if(rn(),t!==r){if(zt[e])return;te(r,te(re(t,i),o)),ee(r.prototype,ee(i,re(t,o))),zt[r.prop=e]=r,t.targetTest&&(Yt.push(r),Lt[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Ct(e,r),t.register&&t.register(er,r,Wn)},Ue=255,Ke={aqua:[0,Ue,Ue],lime:[0,Ue,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ue],navy:[0,0,128],white:[Ue,Ue,Ue],olive:[128,128,0],yellow:[Ue,Ue,0],orange:[Ue,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ue,0,0],pink:[Ue,192,203],cyan:[0,Ue,Ue],transparent:[Ue,Ue,Ue,0]},Ge=function(t,e,n){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(n-e)*t*6:t<.5?n:3*t<2?e+(n-e)*(2/3-t)*6:e)*Ue+.5|0},Qe=function(t,e,n){var r,i,o,s,a,u,l,c,h,f,p=t?lt(t)?[t>>16,t>>8&Ue,t&Ue]:0:Ke.black;if(!p){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),Ke[t])p=Ke[t];else if("#"===t.charAt(0)){if(t.length<6&&(r=t.charAt(1),i=t.charAt(2),o=t.charAt(3),t="#"+r+r+i+i+o+o+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(p=parseInt(t.substr(1,6),16))>>16,p>>8&Ue,p&Ue,parseInt(t.substr(7),16)/255];p=[(t=parseInt(t.substr(1),16))>>16,t>>8&Ue,t&Ue]}else if("hsl"===t.substr(0,3))if(p=f=t.match(vt),e){if(~t.indexOf("="))return p=t.match(_t),n&&p.length<4&&(p[3]=1),p}else s=+p[0]%360/360,a=+p[1]/100,r=2*(u=+p[2]/100)-(i=u<=.5?u*(a+1):u+a-u*a),p.length>3&&(p[3]*=1),p[0]=Ge(s+1/3,r,i),p[1]=Ge(s,r,i),p[2]=Ge(s-1/3,r,i);else p=t.match(vt)||Ke.transparent;p=p.map(Number)}return e&&!f&&(r=p[0]/Ue,i=p[1]/Ue,o=p[2]/Ue,u=((l=Math.max(r,i,o))+(c=Math.min(r,i,o)))/2,l===c?s=a=0:(h=l-c,a=u>.5?h/(2-l-c):h/(l+c),s=l===r?(i-o)/h+(iN&&(X+=s-Y),((n=(i=(F+=s)-X)-q)>0||a)&&(o=++R.frame,B=i-1e3*R.time,R.time=i/=1e3,q+=n+(n>=W?4:W-n),r=1),a||(A=I(t)),r)for(z=0;z=e&&z--},_listeners:j=[]}),rn=function(){return!P&&nn.wake()},on={},sn=/^[\d.\-M][\d.\-,\s]/,an=/["']/g,un=function(t){for(var e,n,r,i={},o=t.substr(1,t.length-3).split(":"),s=o[0],a=1,u=o.length;a1&&s.config?s.config.apply(null,~t.indexOf("{")?[un(o[1])]:(e=t,n=e.indexOf("(")+1,r=e.indexOf(")"),i=e.indexOf("(",n),e.substring(n,~i&&i=1?n:1,o=(r||(e?.3:.45))/(n<1?n:1),s=o/et*(Math.asin(1/i)||0),a=function(t){return 1===t?1:i*Math.pow(2,-10*t)*st((t-s)*o)+1},u="out"===e?a:"in"===e?function(t){return 1-a(1-t)}:pn(a);return o=et/o,u.config=function(n,r){return t(e,n,r)},u},gn=function t(e,n){void 0===n&&(n=1.70158);var r=function(t){return t?--t*t*((n+1)*t+n)+1:0},i="out"===e?r:"in"===e?function(t){return 1-r(1-t)}:pn(r);return i.config=function(n){return t(e,n)},i};jt("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var n=e<5?e+1:e;fn(t+",Power"+(n-1),e?function(t){return Math.pow(t,n)}:function(t){return t},(function(t){return 1-Math.pow(1-t,n)}),(function(t){return t<.5?Math.pow(2*t,n)/2:1-Math.pow(2*(1-t),n)/2}))})),on.Linear.easeNone=on.none=on.Linear.easeIn,fn("Elastic",dn("in"),dn("out"),dn()),U=7.5625,G=1/(K=2.75),fn("Bounce",(function(t){return 1-Q(1-t)}),Q=function(t){return t0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Te(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(rn(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(me(this,t),!n._dp||n.parent||ve(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t0||!this._tDur&&!t)&&_e(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===tt||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),$t(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+fe(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+fe(this),e):this.duration()?Math.min(1,this._time/this._dur):this.ratio},e.iteration=function(t,e){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*n,e):this._repeat?pe(this._tTime,n)+1:1},e.timeScale=function(t){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var e=this.parent&&this._ts?de(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(Ce(-this._delay,this._tDur,e),!0),ge(this),le(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(rn(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==tt&&(this._tTime-=tt)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&_e(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(ft(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?de(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=It);var e=x;return x=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),x=e,this},e.globalTime=function(t){for(var e=this,n=arguments.length?t:e.rawTime();e;)n=e._start+n/(e._ts||1),e=e._dp;return!this.parent&&this.vars.immediateRender?-1:n},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Oe(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,Oe(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime(ke(this,t),ft(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,ft(e))},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,n=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=n&&t1?(e?(r[t]=e,n&&(r[t+"Params"]=n),"onUpdate"===t&&(this._onUpdate=e)):delete r[t],this):r[t]},e.then=function(t){var e=this;return new Promise((function(n){var r=ut(t)?t:Jt,i=function(){var t=e.then;e.then=null,ut(r)&&(r=r(e))&&(r.then||r===e)&&(e.then=t),n(r),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?i():e._prom=i}))},e.kill=function(){je(this)},t}();te(vn.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var _n=function(t){function e(e,n){var r;return void 0===e&&(e={}),(r=t.call(this,e)||this).labels={},r.smoothChildTiming=!!e.smoothChildTiming,r.autoRemoveChildren=!!e.autoRemoveChildren,r._sort=ft(e.sortChildren),O&&_e(e.parent||O,y(r),n),e.reversed&&r.reverse(),e.paused&&r.paused(!0),e.scrollTrigger&&ye(y(r),e.scrollTrigger),r}w(e,t);var n=e.prototype;return n.to=function(t,e,n){return Se(0,arguments,this),this},n.from=function(t,e,n){return Se(1,arguments,this),this},n.fromTo=function(t,e,n,r){return Se(2,arguments,this),this},n.set=function(t,e,n){return e.duration=0,e.parent=this,ie(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new Cn(t,e,ke(this,n),1),this},n.call=function(t,e,n){return _e(this,Cn.delayedCall(0,t,e),n)},n.staggerTo=function(t,e,n,r,i,o,s){return n.duration=e,n.stagger=n.stagger||r,n.onComplete=o,n.onCompleteParams=s,n.parent=this,new Cn(t,n,ke(this,i)),this},n.staggerFrom=function(t,e,n,r,i,o,s){return n.runBackwards=1,ie(n).immediateRender=ft(n.immediateRender),this.staggerTo(t,e,n,r,i,o,s)},n.staggerFromTo=function(t,e,n,r,i,o,s,a){return r.startAt=n,ie(r).immediateRender=ft(r.immediateRender),this.staggerTo(t,e,r,i,o,s,a)},n.render=function(t,e,n){var r,i,o,s,a,u,l,c,h,f,p,d,g=this._time,m=this._dirty?this.totalDuration():this._tDur,v=this._dur,_=t<=0?0:Ut(t),y=this._zTime<0!=t<0&&(this._initted||!v);if(this!==O&&_>m&&t>=0&&(_=m),_!==this._tTime||n||y){if(g!==this._time&&v&&(_+=this._time-g,t+=this._time-g),r=_,h=this._start,u=!(c=this._ts),y&&(v||(g=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(p=this._yoyo,a=v+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*a+t,e,n);if(r=Ut(_%a),_===m?(s=this._repeat,r=v):((s=~~(_/a))&&s===_/a&&(r=v,s--),r>v&&(r=v)),f=pe(this._tTime,a),!g&&this._tTime&&f!==s&&(f=s),p&&1&s&&(r=v-r,d=1),s!==f&&!this._lock){var w=p&&1&f,b=w===(p&&1&s);if(se)for(r=t._first;r&&r._start<=n;){if("isPause"===r.data&&r._start>e)return r;r=r._next}else for(r=t._last;r&&r._start>=n;){if("isPause"===r.data&&r._start=g&&t>=0)for(i=this._first;i;){if(o=i._next,(i._act||r>=i._start)&&i._ts&&l!==i){if(i.parent!==this)return this.render(t,e,n);if(i.render(i._ts>0?(r-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(r-i._start)*i._ts,e,n),r!==this._time||!this._ts&&!u){l=0,o&&(_+=this._zTime=-1e-8);break}}i=o}else{i=this._last;for(var T=t<0?t:r;i;){if(o=i._prev,(i._act||T<=i._end)&&i._ts&&l!==i){if(i.parent!==this)return this.render(t,e,n);if(i.render(i._ts>0?(T-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(T-i._start)*i._ts,e,n||x&&(i._initted||i._startAt)),r!==this._time||!this._ts&&!u){l=0,o&&(_+=this._zTime=T?-1e-8:tt);break}}i=o}}if(l&&!e&&(this.pause(),l.render(r>=g?0:-1e-8)._zTime=r>=g?1:-1,this._ts))return this._start=h,ge(this),this.render(t,e,n);this._onUpdate&&!e&&qe(this,"onUpdate",!0),(_===m&&this._tTime>=this.totalDuration()||!_&&g)&&(h!==this._start&&Math.abs(c)===Math.abs(this._ts)||this._lock||((t||!v)&&(_===m&&this._ts>0||!_&&this._ts<0)&&ae(this,1),e||t<0&&!g||!_&&!g&&m||(qe(this,_===m&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(_0)&&this._prom())))}return this},n.add=function(t,e){var n=this;if(lt(e)||(e=ke(this,e,t)),!(t instanceof vn)){if(mt(t))return t.forEach((function(t){return n.add(t,e)})),this;if(at(t))return this.addLabel(t,e);if(!ut(t))return this;t=Cn.delayedCall(0,t)}return this!==t?_e(this,t,e):this},n.getChildren=function(t,e,n,r){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===n&&(n=!0),void 0===r&&(r=-1e8);for(var i=[],o=this._first;o;)o._start>=r&&(o instanceof Cn?e&&i.push(o):(n&&i.push(o),t&&i.push.apply(i,o.getChildren(!0,e,n)))),o=o._next;return i},n.getById=function(t){for(var e=this.getChildren(1,1,1),n=e.length;n--;)if(e[n].vars.id===t)return e[n]},n.remove=function(t){return at(t)?this.removeLabel(t):ut(t)?this.killTweensOf(t):(se(this,t),t===this._recent&&(this._recent=this._last),ue(this))},n.totalTime=function(e,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ut(nn.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,n),this._forcing=0,this):this._tTime},n.addLabel=function(t,e){return this.labels[t]=ke(this,e),this},n.removeLabel=function(t){return delete this.labels[t],this},n.addPause=function(t,e,n){var r=Cn.delayedCall(0,e||Dt,n);return r.data="isPause",this._hasPause=1,_e(this,r,ke(this,t))},n.removePause=function(t){var e=this._first;for(t=ke(this,t);e;)e._start===t&&"isPause"===e.data&&ae(e),e=e._next},n.killTweensOf=function(t,e,n){for(var r=this.getTweensOf(t,n),i=r.length;i--;)yn!==r[i]&&r[i].kill(t,e);return this},n.getTweensOf=function(t,e){for(var n,r=[],i=Ie(t),o=this._first,s=lt(e);o;)o instanceof Cn?Gt(o._targets,i)&&(s?(!yn||o._initted&&o._ts)&&o.globalTime(0)<=e&&o.globalTime(o.totalDuration())>e:!e||o.isActive())&&r.push(o):(n=o.getTweensOf(i,e)).length&&r.push.apply(r,n),o=o._next;return r},n.tweenTo=function(t,e){e=e||{};var n,r=this,i=ke(r,t),o=e,s=o.startAt,a=o.onStart,u=o.onStartParams,l=o.immediateRender,c=Cn.to(r,te({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:e.duration||Math.abs((i-(s&&"time"in s?s.time:r._time))/r.timeScale())||tt,onStart:function(){if(r.pause(),!n){var t=e.duration||Math.abs((i-(s&&"time"in s?s.time:r._time))/r.timeScale());c._dur!==t&&Te(c,t,0,1).render(c._time,!0,!0),n=1}a&&a.apply(c,u||[])}},e));return l?c.render(0):c},n.tweenFromTo=function(t,e,n){return this.tweenTo(e,te({startAt:{time:ke(this,t)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(t){return void 0===t&&(t=this._time),We(this,ke(this,t))},n.previousLabel=function(t){return void 0===t&&(t=this._time),We(this,ke(this,t),1)},n.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+tt)},n.shiftChildren=function(t,e,n){void 0===n&&(n=0);for(var r,i=this._first,o=this.labels;i;)i._start>=n&&(i._start+=t,i._end+=t),i=i._next;if(e)for(r in o)o[r]>=n&&(o[r]+=t);return ue(this)},n.invalidate=function(e){var n=this._first;for(this._lock=0;n;)n.invalidate(e),n=n._next;return t.prototype.invalidate.call(this,e)},n.clear=function(t){void 0===t&&(t=!0);for(var e,n=this._first;n;)e=n._next,this.remove(n),n=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),ue(this)},n.totalDuration=function(t){var e,n,r,i=0,o=this,s=o._last,a=J;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-t:t));if(o._dirty){for(r=o.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),(n=s._start)>a&&o._sort&&s._ts&&!o._lock?(o._lock=1,_e(o,s,n-s._delay,1)._lock=0):a=n,n<0&&s._ts&&(i-=n,(!r&&!o._dp||r&&r.smoothChildTiming)&&(o._start+=n/o._ts,o._time-=n,o._tTime-=n),o.shiftChildren(-n,!1,-1/0),a=0),s._end>i&&s._ts&&(i=s._end),s=e;Te(o,o===O&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(t){if(O._ts&&($t(O,de(t,O)),C=nn.frame),nn.frame>=Nt){Nt+=$.autoSleep||120;var e=O._first;if((!e||!e._ts)&&$.autoSleep&&nn._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||nn.sleep()}}},e}(vn);te(_n.prototype,{_lock:0,_hasPause:0,_forcing:0});var yn,wn,bn=function(t,e,n,r,i,o,s){var a,u,l,c,h,f,p,d,g=new Wn(this._pt,t,e,0,1,zn,null,i),m=0,v=0;for(g.b=n,g.e=r,n+="",(p=~(r+="").indexOf("random("))&&(r=Xe(r)),o&&(o(d=[n,r],t,e),n=d[0],r=d[1]),u=n.match(wt)||[];a=wt.exec(r);)c=a[0],h=r.substring(m,a.index),l?l=(l+1)%5:"rgba("===h.substr(-5)&&(l=1),c!==u[v++]&&(f=parseFloat(u[v-1])||0,g._pt={_next:g._pt,p:h||1===v?h:",",s:f,c:"="===c.charAt(1)?Kt(f,c)-f:parseFloat(c)-f,m:l&&l<4?Math.round:0},m=wt.lastIndex);return g.c=m")})),s.duration();else{for(c in u={},x)"ease"===c||"easeEach"===c||Mn(c,x[c],u,x.easeEach);for(c in u)for(C=u[c].sort((function(t,e){return t.t-e.t})),A=0,a=0;ap-tt&&!g?p:td&&(r=d)),(u=this._yoyo&&1&o)&&(h=this._yEase,r=d-r),a=pe(this._tTime,s),r===f&&!n&&this._initted)return this._tTime=m,this;o!==a&&(c&&this._yEase&&cn(c,u),!this.vars.repeatRefresh||u||this._lock||(this._lock=n=1,this.render(Ut(s*o),!0).invalidate()._lock=0))}if(!this._initted){if(we(this,g?t:r,n,e,m))return this._tTime=0,this;if(f!==this._time)return this;if(d!==this._dur)return this.render(t,e,n)}if(this._tTime=m,this._time=r,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=l=(h||this._ease)(r/d),this._from&&(this.ratio=l=1-l),r&&!f&&!e&&(qe(this,"onStart"),this._tTime!==m))return this;for(i=this._pt;i;)i.r(l,i.d),i=i._next;c&&c.render(t<0?t:!r&&u?-1e-8:c._dur*c._ease(r/this._dur),e,n)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(g&&ce(this,t,0,n),qe(this,"onUpdate")),this._repeat&&o!==a&&this.vars.onRepeat&&!e&&this.parent&&qe(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(g&&!this._onUpdate&&ce(this,t,0,!0),(t||!d)&&(m===this._tDur&&this._ts>0||!m&&this._ts<0)&&ae(this,1),e||g&&!f||!(m||f||u)||(qe(this,m===p?"onComplete":"onReverseComplete",!0),this._prom&&!(m0)&&this._prom()))}}else!function(t,e,n,r){var i,o,s,a=t.ratio,u=e<0||!e&&(!t._start&&be(t)&&(t._initted||!xe(t))||(t._ts<0||t._dp._ts<0)&&!xe(t))?0:1,l=t._rDelay,c=0;if(l&&t._repeat&&(c=Ce(0,t._tDur,e),o=pe(c,l),t._yoyo&&1&o&&(u=1-u),o!==pe(t._tTime,l)&&(a=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==a||x||r||t._zTime===tt||!e&&t._zTime){if(!t._initted&&we(t,e,r,n,c))return;for(s=t._zTime,t._zTime=e||(n?tt:0),n||(n=e&&!s),t.ratio=u,t._from&&(u=1-u),t._time=0,t._tTime=c,i=t._pt;i;)i.r(u,i.d),i=i._next;e<0&&ce(t,e,0,!0),t._onUpdate&&!n&&qe(t,"onUpdate"),c&&t._repeat&&!n&&t.parent&&qe(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&ae(t,1),n||x||(qe(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,n);return this},n.targets=function(){return this._targets},n.invalidate=function(e){return(!e||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},n.resetTo=function(t,e,n,r){P||nn.wake(),this._ts||this.play();var i=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||On(this,i),function(t,e,n,r,i,o,s){var a,u,l,c,h=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!h)for(h=t._ptCache[e]=[],l=t._ptLookup,c=t._targets.length;c--;){if((a=l[c][e])&&a.d&&a.d._pt)for(a=a.d._pt;a&&a.p!==e&&a.fp!==e;)a=a._next;if(!a)return wn=1,t.vars[e]="+=0",On(t,s),wn=0,1;h.push(a)}for(c=h.length;c--;)(a=(u=h[c])._pt||u).s=!r&&0!==r||i?a.s+(r||0)+o*a.c:r,a.c=n-a.s,u.e&&(u.e=Ht(n)+De(u.e)),u.b&&(u.b=a.s+De(u.b))}(this,t,e,n,r,this._ease(i/this._dur),i)?this.resetTo(t,e,n,r):(me(this,0),this.parent||oe(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?je(this):this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,yn&&!0!==yn.vars.overwrite)._first||je(this),this.parent&&n!==this.timeline.totalDuration()&&Te(this,this._dur*this.timeline._tDur/n,0,1),this}var r,i,o,s,a,u,l,c=this._targets,h=t?Ie(t):c,f=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function(t,e){for(var n=t.length,r=n===e.length;r&&n--&&t[n]===e[n];);return n<0}(c,h))return"all"===e&&(this._pt=0),je(this);for(r=this._op=this._op||[],"all"!==e&&(at(e)&&(a={},jt(e,(function(t){return a[t]=1})),e=a),e=function(t,e){var n,r,i,o,s=t[0]?Wt(t[0]).harness:0,a=s&&s.aliases;if(!a)return e;for(r in n=ee({},e),a)if(r in n)for(i=(o=a[r].split(",")).length;i--;)n[o[i]]=n[r];return n}(c,e)),l=c.length;l--;)if(~h.indexOf(c[l]))for(a in i=f[l],"all"===e?(r[l]=e,s=i,o={}):(o=r[l]=r[l]||{},s=e),s)(u=i&&i[a])&&("kill"in u.d&&!0!==u.d.kill(a)||se(this,u,"_pt"),delete i[a]),"all"!==o&&(o[a]=1);return this._initted&&!this._pt&&p&&je(this),this},e.to=function(t,n){return new e(t,n,arguments[2])},e.from=function(t,e){return Se(1,arguments)},e.delayedCall=function(t,n,r,i){return new e(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},e.fromTo=function(t,e,n){return Se(2,arguments)},e.set=function(t,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new e(t,n)},e.killTweensOf=function(t,e,n){return O.killTweensOf(t,e,n)},e}(vn);te(Cn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),jt("staggerTo,staggerFrom,staggerFromTo",(function(t){Cn[t]=function(){var e=new _n,n=Pe.call(arguments,0);return n.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,n)}}));var Dn=function(t,e,n){return t[e]=n},Pn=function(t,e,n){return t[e](n)},An=function(t,e,n,r){return t[e](r.fp,n)},In=function(t,e,n){return t.setAttribute(e,n)},Ln=function(t,e){return ut(t[e])?Pn:ct(t[e])&&t.setAttribute?In:Dn},Rn=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},Bn=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},zn=function(t,e){var n=e._pt,r="";if(!t&&e.b)r=e.b;else if(1===t&&e.e)r=e.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*t):Math.round(1e4*(n.s+n.c*t))/1e4)+r,n=n._next;r+=e.c}e.set(e.t,e.p,r,e)},Vn=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},Nn=function(t,e,n,r){for(var i,o=this._pt;o;)i=o._next,o.p===r&&o.modifier(t,e,n),o=i},Yn=function(t){for(var e,n,r=this._pt;r;)n=r._next,r.p===t&&!r.op||r.op===t?se(this,r,"_pt"):r.dep||(e=1),r=n;return!e},Xn=function(t,e,n,r){r.mSet(t,e,r.m.call(r.tween,n,r.mt),r)},Fn=function(t){for(var e,n,r,i,o=t._pt;o;){for(e=o._next,n=r;n&&n.pr>o.pr;)n=n._next;(o._prev=n?n._prev:i)?o._prev._next=o:r=o,(o._next=n)?n._prev=o:i=o,o=e}t._pt=r},Wn=function(){function t(t,e,n,r,i,o,s,a,u){this.t=e,this.s=r,this.c=i,this.p=n,this.r=o||Rn,this.d=s||this,this.set=a||Dn,this.pr=u||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,n){this.mSet=this.mSet||this.set,this.set=Xn,this.m=t,this.mt=n,this.tween=e},t}();jt(Xt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return Lt[t]=1})),Ot.TweenMax=Ot.TweenLite=Cn,Ot.TimelineLite=Ot.TimelineMax=_n,O=new _n({sortChildren:!1,defaults:Z,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),$.stringFilter=en;var qn=[],jn={},Hn=[],Un=0,Kn=function(t){return(jn[t]||Hn).map((function(t){return t()}))},Gn=function(){var t=Date.now(),e=[];t-Un>2&&(Kn("matchMediaInit"),qn.forEach((function(t){var n,r,i,o,s=t.queries,a=t.conditions;for(r in s)(n=M.matchMedia(s[r]).matches)&&(i=1),n!==a[r]&&(a[r]=n,o=1);o&&(t.revert(),i&&e.push(t))})),Kn("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t)})),Un=t,Kn("matchMedia"))},Qn=function(){function t(t,e){this.selector=e&&Le(e),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,n){ut(t)&&(n=e,e=t,t=ut);var r=this,i=function(){var t,i=T,o=r.selector;return i&&i!==r&&i.data.push(r),n&&(r.selector=Le(n)),T=r,t=e.apply(r,arguments),ut(t)&&r._r.push(t),T=i,r.selector=o,r.isReverted=!1,t};return r.last=i,t===ut?i(r):t?r[t]=i:i},e.ignore=function(t){var e=T;T=null,t(this),T=e},e.getTweens=function(){var e=[];return this.data.forEach((function(n){return n instanceof t?e.push.apply(e,n.getTweens()):n instanceof Cn&&!(n.parent&&"nested"===n.parent.data)&&e.push(n)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var n=this;if(t){var r=this.getTweens();this.data.forEach((function(t){"isFlip"===t.data&&(t.revert(),t.getChildren(!0,!0,!1).forEach((function(t){return r.splice(r.indexOf(t),1)})))})),r.map((function(t){return{g:t.globalTime(0),t:t}})).sort((function(t,e){return e.g-t.g||-1})).forEach((function(e){return e.t.revert(t)})),this.data.forEach((function(e){return!(e instanceof vn)&&e.revert&&e.revert(t)})),this._r.forEach((function(e){return e(t,n)})),this.isReverted=!0}else this.data.forEach((function(t){return t.kill&&t.kill()}));if(this.clear(),e){var i=qn.indexOf(this);~i&&qn.splice(i,1)}},e.revert=function(t){this.kill(t||{})},t}(),$n=function(){function t(t){this.contexts=[],this.scope=t}var e=t.prototype;return e.add=function(t,e,n){ht(t)||(t={matches:t});var r,i,o,s=new Qn(0,n||this.scope),a=s.conditions={};for(i in this.contexts.push(s),e=s.add("onMatch",e),s.queries=t,t)"all"===i?o=1:(r=M.matchMedia(t[i]))&&(qn.indexOf(s)<0&&qn.push(s),(a[i]=r.matches)&&(o=1),r.addListener?r.addListener(Gn):r.addEventListener("change",Gn));return o&&e(s),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),Zn={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n1){var r=t.map((function(t){return er.quickSetter(t,e,n)})),i=r.length;return function(t){for(var e=i;e--;)r[e](t)}}t=t[0]||{};var o=zt[e],s=Wt(t),a=s.harness&&(s.harness.aliases||{})[e]||e,u=o?function(e){var r=new o;D._pt=0,r.init(t,n?e+n:e,D,0,[t]),r.render(1,r),D._pt&&Vn(1,D)}:s.set(t,a);return o?u:function(e){return u(t,a,n?e+n:e,s,1)}},quickTo:function(t,e,n){var r,i=er.to(t,ee(((r={})[e]="+=0.1",r.paused=!0,r),n||{})),o=function(t,n,r){return i.resetTo(e,t,n,r)};return o.tween=i,o},isTweening:function(t){return O.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=hn(t.ease,Z.ease)),ne(Z,t||{})},config:function(t){return ne($,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,r=t.plugins,i=t.defaults,o=t.extendTimeline;(r||"").split(",").forEach((function(t){return t&&!zt[t]&&!Ot[t]&&Et(e+" effect requires "+t+" plugin.")})),Vt[e]=function(t,e,r){return n(Ie(t),te(e||{},i),r)},o&&(_n.prototype[e]=function(t,n,r){return this.add(Vt[e](t,ht(n)?n:(r=n)&&{},this),r)})},registerEase:function(t,e){on[t]=hn(e)},parseEase:function(t,e){return arguments.length?hn(t,e):on},getById:function(t){return O.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var n,r,i=new _n(t);for(i.smoothChildTiming=ft(t.smoothChildTiming),O.remove(i),i._dp=0,i._time=i._tTime=O._time,n=O._first;n;)r=n._next,!e&&!n._dur&&n instanceof Cn&&n.vars.onComplete===n._targets[0]||_e(i,n,n._start-n._delay),n=r;return _e(O,i,0),i},context:function(t,e){return t?new Qn(t,e):T},matchMedia:function(t){return new $n(t)},matchMediaRefresh:function(){return qn.forEach((function(t){var e,n,r=t.conditions;for(n in r)r[n]&&(r[n]=!1,e=1);e&&t.revert()}))||Gn()},addEventListener:function(t,e){var n=jn[t]||(jn[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=jn[t],r=n&&n.indexOf(e);r>=0&&n.splice(r,1)},utils:{wrap:function t(e,n,r){var i=n-e;return mt(e)?Ye(e,t(0,e.length),n):Ee(r,(function(t){return(i+(t-e)%i)%i+e}))},wrapYoyo:function t(e,n,r){var i=n-e,o=2*i;return mt(e)?Ye(e,t(0,e.length-1),n):Ee(r,(function(t){return e+((t=(o+(t-e)%o)%o||0)>i?o-t:t)}))},distribute:Be,random:Ne,snap:Ve,normalize:function(t,e,n){return Fe(t,e,0,1,n)},getUnit:De,clamp:function(t,e,n){return Ee(n,(function(n){return Ce(t,e,n)}))},splitColor:Qe,toArray:Ie,selector:Le,mapRange:Fe,pipe:function(){for(var t=arguments.length,e=new Array(t),n=0;n=0)return;r._gsap.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(Pr,e,"")),t=Dr}(i||e)&&this.props.push(t,e,i[t])},Ir=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},Lr=function(){var t,e,n=this.props,r=this.target,i=r.style,o=r._gsap;for(t=0;t=0?Vr[i]:"")+t},Yr=function(){"undefined"!=typeof window&&window.document&&(nr=window,rr=nr.document,ir=rr.documentElement,sr=Br("div")||{style:{}},Br("div"),Dr=Nr(Dr),Pr=Dr+"Origin",sr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",lr=!!Nr("perspective"),ur=er.core.reverting,or=1)},Xr=function t(e){var n,r=Br("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,o=this.nextSibling,s=this.style.cssText;if(ir.appendChild(r),r.appendChild(this),this.style.display="block",e)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(n=this._gsapBBox());return i&&(o?i.insertBefore(this,o):i.appendChild(this)),ir.removeChild(r),this.style.cssText=s,n},Fr=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},Wr=function(t){var e;try{e=t.getBBox()}catch(n){e=Xr.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Xr||(e=Xr.call(t,!0)),!e||e.width||e.x||e.y?e:{x:+Fr(t,["x","cx","x1"])||0,y:+Fr(t,["y","cy","y1"])||0,width:0,height:0}},qr=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Wr(t))},jr=function(t,e){if(e){var n=t.style;e in cr&&e!==Pr&&(e=Dr),n.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),n.removeProperty(e.replace(dr,"-$1").toLowerCase())):n.removeAttribute(e)}},Hr=function(t,e,n,r,i,o){var s=new Wn(t._pt,e,n,0,1,o?Tr:xr);return t._pt=s,s.b=r,s.e=i,t._props.push(n),s},Ur={deg:1,rad:1,turn:1},Kr={grid:1,flex:1},Gr=function t(e,n,r,i){var o,s,a,u,l=parseFloat(r)||0,c=(r+"").trim().substr((l+"").length)||"px",h=sr.style,f=gr.test(n),p="svg"===e.tagName.toLowerCase(),d=(p?"client":"offset")+(f?"Width":"Height"),g=100,m="px"===i,v="%"===i;return i===c||!l||Ur[i]||Ur[c]?l:("px"!==c&&!m&&(l=t(e,n,r,"px")),u=e.getCTM&&qr(e),!v&&"%"!==c||!cr[n]&&!~n.indexOf("adius")?(h[f?"width":"height"]=g+(m?c:i),s=~n.indexOf("adius")||"em"===i&&e.appendChild&&!p?e:e.parentNode,u&&(s=(e.ownerSVGElement||{}).parentNode),s&&s!==rr&&s.appendChild||(s=rr.body),(a=s._gsap)&&v&&a.width&&f&&a.time===nn.time&&!a.uncache?Ht(l/a.width*g):((v||"%"===c)&&!Kr[zr(s,"display")]&&(h.position=zr(e,"position")),s===e&&(h.position="static"),s.appendChild(sr),o=sr[d],s.removeChild(sr),h.position="absolute",f&&v&&((a=Wt(s)).time=nn.time,a.width=s[d]),Ht(m?o*l/g:o&&l?g/o*l:0))):(o=u?e.getBBox()[f?"width":"height"]:e[d],Ht(v?l/o*g:l/100*o)))},Qr=function(t,e,n,r){var i;return or||Yr(),e in vr&&"transform"!==e&&~(e=vr[e]).indexOf(",")&&(e=e.split(",")[0]),cr[e]&&"transform"!==e?(i=ai(t,r),i="transformOrigin"!==e?i[e]:i.svg?i.origin:ui(zr(t,Pr))+" "+i.zOrigin+"px"):(!(i=t.style[e])||"auto"===i||r||~(i+"").indexOf("calc("))&&(i=ti[e]&&ti[e](t,e,n)||zr(t,e)||qt(t,e)||("opacity"===e?1:0)),n&&!~(i+"").trim().indexOf(" ")?Gr(t,e,i,n)+n:i},$r=function(t,e,n,r){if(!n||"none"===n){var i=Nr(e,t,1),o=i&&zr(t,i,1);o&&o!==n?(e=i,n=o):"borderColor"===e&&(n=zr(t,"borderTopColor"))}var s,a,u,l,c,h,f,p,d,g,m,v=new Wn(this._pt,t.style,e,0,1,zn),_=0,y=0;if(v.b=n,v.e=r,n+="","auto"===(r+="")&&(t.style[e]=r,r=zr(t,e)||r,t.style[e]=n),en(s=[n,r]),r=s[1],u=(n=s[0]).match(yt)||[],(r.match(yt)||[]).length){for(;a=yt.exec(r);)f=a[0],d=r.substring(_,a.index),c?c=(c+1)%5:"rgba("!==d.substr(-5)&&"hsla("!==d.substr(-5)||(c=1),f!==(h=u[y++]||"")&&(l=parseFloat(h)||0,m=h.substr((l+"").length),"="===f.charAt(1)&&(f=Kt(l,f)+m),p=parseFloat(f),g=f.substr((p+"").length),_=yt.lastIndex-g.length,g||(g=g||$.units[e]||m,_===r.length&&(r+=g,v.e+=g)),m!==g&&(l=Gr(t,e,h,g)||0),v._pt={_next:v._pt,p:d||1===y?d:",",s:l,c:p-l,m:c&&c<4||"zIndex"===e?Math.round:0});v.c=_-1;)n=a[i],cr[n]&&(r=1,n="transformOrigin"===n?Pr:Dr),jr(o,n);r&&(jr(o,Dr),u&&(u.svg&&o.removeAttribute("transform"),ai(o,1),u.uncache=1,Ir(s)))}},ti={clearProps:function(t,e,n,r,i){if("isFromStart"!==i.data){var o=t._pt=new Wn(t._pt,e,n,0,0,Jr);return o.u=r,o.pr=-10,o.tween=i,t._props.push(n),1}}},ei=[1,0,0,1,0,0],ni={},ri=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},ii=function(t){var e=zr(t,Dr);return ri(e)?ei:e.substr(7).match(_t).map(Ht)},oi=function(t,e){var n,r,i,o,s=t._gsap||Wt(t),a=t.style,u=ii(t);return s.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(i=t.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?ei:u:(u!==ei||t.offsetParent||t===ir||s.svg||(i=a.display,a.display="block",(n=t.parentNode)&&t.offsetParent||(o=1,r=t.nextElementSibling,ir.appendChild(t)),u=ii(t),i?a.display=i:jr(t,"display"),o&&(r?n.insertBefore(t,r):n?n.appendChild(t):ir.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},si=function(t,e,n,r,i,o){var s,a,u,l=t._gsap,c=i||oi(t,!0),h=l.xOrigin||0,f=l.yOrigin||0,p=l.xOffset||0,d=l.yOffset||0,g=c[0],m=c[1],v=c[2],_=c[3],y=c[4],w=c[5],b=e.split(" "),x=parseFloat(b[0])||0,T=parseFloat(b[1])||0;n?c!==ei&&(a=g*_-m*v)&&(u=x*(-m/a)+T*(g/a)-(g*w-m*y)/a,x=x*(_/a)+T*(-v/a)+(v*w-_*y)/a,T=u):(x=(s=Wr(t)).x+(~b[0].indexOf("%")?x/100*s.width:x),T=s.y+(~(b[1]||b[0]).indexOf("%")?T/100*s.height:T)),r||!1!==r&&l.smooth?(y=x-h,w=T-f,l.xOffset=p+(y*g+w*v)-y,l.yOffset=d+(y*m+w*_)-w):l.xOffset=l.yOffset=0,l.xOrigin=x,l.yOrigin=T,l.smooth=!!r,l.origin=e,l.originIsAbsolute=!!n,t.style[Pr]="0px 0px",o&&(Hr(o,l,"xOrigin",h,x),Hr(o,l,"yOrigin",f,T),Hr(o,l,"xOffset",p,l.xOffset),Hr(o,l,"yOffset",d,l.yOffset)),t.setAttribute("data-svg-origin",x+" "+T)},ai=function(t,e){var n=t._gsap||new mn(t);if("x"in n&&!e&&!n.uncache)return n;var r,i,o,s,a,u,l,c,h,f,p,d,g,m,v,_,y,w,b,x,T,O,M,k,S,E,C,D,P,A,I,L,R=t.style,B=n.scaleX<0,z="px",V="deg",N=getComputedStyle(t),Y=zr(t,Pr)||"0";return r=i=o=u=l=c=h=f=p=0,s=a=1,n.svg=!(!t.getCTM||!qr(t)),N.translate&&("none"===N.translate&&"none"===N.scale&&"none"===N.rotate||(R[Dr]=("none"!==N.translate?"translate3d("+(N.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==N.rotate?"rotate("+N.rotate+") ":"")+("none"!==N.scale?"scale("+N.scale.split(" ").join(",")+") ":"")+("none"!==N[Dr]?N[Dr]:"")),R.scale=R.rotate=R.translate="none"),m=oi(t,n.svg),n.svg&&(n.uncache?(S=t.getBBox(),Y=n.xOrigin-S.x+"px "+(n.yOrigin-S.y)+"px",k=""):k=!e&&t.getAttribute("data-svg-origin"),si(t,k||Y,!!k||n.originIsAbsolute,!1!==n.smooth,m)),d=n.xOrigin||0,g=n.yOrigin||0,m!==ei&&(w=m[0],b=m[1],x=m[2],T=m[3],r=O=m[4],i=M=m[5],6===m.length?(s=Math.sqrt(w*w+b*b),a=Math.sqrt(T*T+x*x),u=w||b?pr(b,w)*hr:0,(h=x||T?pr(x,T)*hr+u:0)&&(a*=Math.abs(Math.cos(h*fr))),n.svg&&(r-=d-(d*w+g*x),i-=g-(d*b+g*T))):(L=m[6],A=m[7],C=m[8],D=m[9],P=m[10],I=m[11],r=m[12],i=m[13],o=m[14],l=(v=pr(L,P))*hr,v&&(k=O*(_=Math.cos(-v))+C*(y=Math.sin(-v)),S=M*_+D*y,E=L*_+P*y,C=O*-y+C*_,D=M*-y+D*_,P=L*-y+P*_,I=A*-y+I*_,O=k,M=S,L=E),c=(v=pr(-x,P))*hr,v&&(_=Math.cos(-v),I=T*(y=Math.sin(-v))+I*_,w=k=w*_-C*y,b=S=b*_-D*y,x=E=x*_-P*y),u=(v=pr(b,w))*hr,v&&(k=w*(_=Math.cos(v))+b*(y=Math.sin(v)),S=O*_+M*y,b=b*_-w*y,M=M*_-O*y,w=k,O=S),l&&Math.abs(l)+Math.abs(u)>359.9&&(l=u=0,c=180-c),s=Ht(Math.sqrt(w*w+b*b+x*x)),a=Ht(Math.sqrt(M*M+L*L)),v=pr(O,M),h=Math.abs(v)>2e-4?v*hr:0,p=I?1/(I<0?-I:I):0),n.svg&&(k=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!ri(zr(t,Dr)),k&&t.setAttribute("transform",k))),Math.abs(h)>90&&Math.abs(h)<270&&(B?(s*=-1,h+=u<=0?180:-180,u+=u<=0?180:-180):(a*=-1,h+=h<=0?180:-180)),e=e||n.uncache,n.x=r-((n.xPercent=r&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-r)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+z,n.y=i-((n.yPercent=i&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-i)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+z,n.z=o+z,n.scaleX=Ht(s),n.scaleY=Ht(a),n.rotation=Ht(u)+V,n.rotationX=Ht(l)+V,n.rotationY=Ht(c)+V,n.skewX=h+V,n.skewY=f+V,n.transformPerspective=p+z,(n.zOrigin=parseFloat(Y.split(" ")[2])||0)&&(R[Pr]=ui(Y)),n.xOffset=n.yOffset=0,n.force3D=$.force3D,n.renderTransform=n.svg?gi:lr?di:ci,n.uncache=0,n},ui=function(t){return(t=t.split(" "))[0]+" "+t[1]},li=function(t,e,n){var r=De(e);return Ht(parseFloat(e)+parseFloat(Gr(t,"x",n+"px",r)))+r},ci=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,di(t,e)},hi="0deg",fi="0px",pi=") ",di=function(t,e){var n=e||this,r=n.xPercent,i=n.yPercent,o=n.x,s=n.y,a=n.z,u=n.rotation,l=n.rotationY,c=n.rotationX,h=n.skewX,f=n.skewY,p=n.scaleX,d=n.scaleY,g=n.transformPerspective,m=n.force3D,v=n.target,_=n.zOrigin,y="",w="auto"===m&&t&&1!==t||!0===m;if(_&&(c!==hi||l!==hi)){var b,x=parseFloat(l)*fr,T=Math.sin(x),O=Math.cos(x);x=parseFloat(c)*fr,b=Math.cos(x),o=li(v,o,T*b*-_),s=li(v,s,-Math.sin(x)*-_),a=li(v,a,O*b*-_+_)}g!==fi&&(y+="perspective("+g+pi),(r||i)&&(y+="translate("+r+"%, "+i+"%) "),(w||o!==fi||s!==fi||a!==fi)&&(y+=a!==fi||w?"translate3d("+o+", "+s+", "+a+") ":"translate("+o+", "+s+pi),u!==hi&&(y+="rotate("+u+pi),l!==hi&&(y+="rotateY("+l+pi),c!==hi&&(y+="rotateX("+c+pi),h===hi&&f===hi||(y+="skew("+h+", "+f+pi),1===p&&1===d||(y+="scale("+p+", "+d+pi),v.style[Dr]=y||"translate(0, 0)"},gi=function(t,e){var n,r,i,o,s,a=e||this,u=a.xPercent,l=a.yPercent,c=a.x,h=a.y,f=a.rotation,p=a.skewX,d=a.skewY,g=a.scaleX,m=a.scaleY,v=a.target,_=a.xOrigin,y=a.yOrigin,w=a.xOffset,b=a.yOffset,x=a.forceCSS,T=parseFloat(c),O=parseFloat(h);f=parseFloat(f),p=parseFloat(p),(d=parseFloat(d))&&(p+=d=parseFloat(d),f+=d),f||p?(f*=fr,p*=fr,n=Math.cos(f)*g,r=Math.sin(f)*g,i=Math.sin(f-p)*-m,o=Math.cos(f-p)*m,p&&(d*=fr,s=Math.tan(p-d),i*=s=Math.sqrt(1+s*s),o*=s,d&&(s=Math.tan(d),n*=s=Math.sqrt(1+s*s),r*=s)),n=Ht(n),r=Ht(r),i=Ht(i),o=Ht(o)):(n=g,o=m,r=i=0),(T&&!~(c+"").indexOf("px")||O&&!~(h+"").indexOf("px"))&&(T=Gr(v,"x",c,"px"),O=Gr(v,"y",h,"px")),(_||y||w||b)&&(T=Ht(T+_-(_*n+y*i)+w),O=Ht(O+y-(_*r+y*o)+b)),(u||l)&&(s=v.getBBox(),T=Ht(T+u/100*s.width),O=Ht(O+l/100*s.height)),s="matrix("+n+","+r+","+i+","+o+","+T+","+O+")",v.setAttribute("transform",s),x&&(v.style[Dr]=s)},mi=function(t,e,n,r,i){var o,s,a=360,u=at(i),l=parseFloat(i)*(u&&~i.indexOf("rad")?hr:1)-r,c=r+l+"deg";return u&&("short"===(o=i.split("_")[1])&&(l%=a)!==l%180&&(l+=l<0?a:-360),"cw"===o&&l<0?l=(l+36e9)%a-~~(l/a)*a:"ccw"===o&&l>0&&(l=(l-36e9)%a-~~(l/a)*a)),t._pt=s=new Wn(t._pt,e,n,r,l,yr),s.e=c,s.u="deg",t._props.push(n),s},vi=function(t,e){for(var n in e)t[n]=e[n];return t},_i=function(t,e,n){var r,i,o,s,a,u,l,c=vi({},n._gsap),h=n.style;for(i in c.svg?(o=n.getAttribute("transform"),n.setAttribute("transform",""),h[Dr]=e,r=ai(n,1),jr(n,Dr),n.setAttribute("transform",o)):(o=getComputedStyle(n)[Dr],h[Dr]=e,r=ai(n,1),h[Dr]=o),cr)(o=c[i])!==(s=r[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(a=De(o)!==(l=De(s))?Gr(n,i,o,l):parseFloat(o),u=parseFloat(s),t._pt=new Wn(t._pt,r,i,a,u-a,_r),t._pt.u=l||0,t._props.push(i));vi(r,c)};jt("padding,margin,Width,Radius",(function(t,e){var n="Top",r="Right",i="Bottom",o="Left",s=(e<3?[n,r,i,o]:[n+o,n+r,i+r,i+o]).map((function(n){return e<2?t+n:"border"+n+t}));ti[e>1?"border"+t:t]=function(t,e,n,r,i){var o,a;if(arguments.length<4)return o=s.map((function(e){return Qr(t,e,n)})),5===(a=o.join(" ")).split(o[0]).length?o[0]:a;o=(r+"").split(" "),a={},s.forEach((function(t,e){return a[t]=o[e]=o[e]||o[(e-1)/2|0]})),t.init(e,a,i)}}));var yi,wi,bi,xi={name:"css",register:Yr,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,r,i){var o,s,a,u,l,c,h,f,p,d,g,m,v,_,y,w,b,x,T,O,M=this._props,k=t.style,S=n.vars.startAt;for(h in or||Yr(),this.styles=this.styles||Rr(t),w=this.styles.props,this.tween=n,e)if("autoRound"!==h&&(s=e[h],!zt[h]||!Tn(h,e,n,r,t,i)))if(l=typeof s,c=ti[h],"function"===l&&(l=typeof(s=s.call(n,r,t,i))),"string"===l&&~s.indexOf("random(")&&(s=Xe(s)),c)c(this,t,h,s,n)&&(y=1);else if("--"===h.substr(0,2))o=(getComputedStyle(t).getPropertyValue(h)+"").trim(),s+="",Je.lastIndex=0,Je.test(o)||(f=De(o),p=De(s)),p?f!==p&&(o=Gr(t,h,o,p)+p):f&&(s+=f),this.add(k,"setProperty",o,s,r,i,0,0,h),M.push(h),w.push(h,0,k[h]);else if("undefined"!==l){if(S&&h in S?(o="function"==typeof S[h]?S[h].call(n,r,t,i):S[h],at(o)&&~o.indexOf("random(")&&(o=Xe(o)),De(o+"")||(o+=$.units[h]||De(Qr(t,h))||""),"="===(o+"").charAt(1)&&(o=Qr(t,h))):o=Qr(t,h),u=parseFloat(o),(d="string"===l&&"="===s.charAt(1)&&s.substr(0,2))&&(s=s.substr(2)),a=parseFloat(s),h in vr&&("autoAlpha"===h&&(1===u&&"hidden"===Qr(t,"visibility")&&a&&(u=0),w.push("visibility",0,k.visibility),Hr(this,k,"visibility",u?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==h&&"transform"!==h&&~(h=vr[h]).indexOf(",")&&(h=h.split(",")[0])),g=h in cr)if(this.styles.save(h),m||((v=t._gsap).renderTransform&&!e.parseTransform||ai(t,e.parseTransform),_=!1!==e.smoothOrigin&&v.smooth,(m=this._pt=new Wn(this._pt,k,Dr,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===h)this._pt=new Wn(this._pt,v,"scaleY",u,(d?Kt(u,d+a):a)-u||0,_r),this._pt.u=0,M.push("scaleY",h),h+="X";else{if("transformOrigin"===h){w.push(Pr,0,k[Pr]),x=void 0,T=void 0,O=void 0,x=(b=s).split(" "),T=x[0],O=x[1]||"50%","top"!==T&&"bottom"!==T&&"left"!==O&&"right"!==O||(b=T,T=O,O=b),x[0]=Zr[T]||T,x[1]=Zr[O]||O,s=x.join(" "),v.svg?si(t,s,0,_,0,this):((p=parseFloat(s.split(" ")[2])||0)!==v.zOrigin&&Hr(this,v,"zOrigin",v.zOrigin,p),Hr(this,k,h,ui(o),ui(s)));continue}if("svgOrigin"===h){si(t,s,1,_,0,this);continue}if(h in ni){mi(this,v,h,u,d?Kt(u,d+s):s);continue}if("smoothOrigin"===h){Hr(this,v,"smooth",v.smooth,s);continue}if("force3D"===h){v[h]=s;continue}if("transform"===h){_i(this,s,t);continue}}else h in k||(h=Nr(h)||h);if(g||(a||0===a)&&(u||0===u)&&!mr.test(s)&&h in k)a||(a=0),(f=(o+"").substr((u+"").length))!==(p=De(s)||(h in $.units?$.units[h]:f))&&(u=Gr(t,h,o,p)),this._pt=new Wn(this._pt,g?v:k,h,u,(d?Kt(u,d+a):a)-u,g||"px"!==p&&"zIndex"!==h||!1===e.autoRound?_r:br),this._pt.u=p||0,f!==p&&"%"!==p&&(this._pt.b=o,this._pt.r=wr);else if(h in k)$r.call(this,t,h,o,d?d+s:s);else{if(!(h in t)){St(h,s);continue}this.add(t,h,o||t[h],d?d+s:s,r,i)}g||(h in k?w.push(h,0,k[h]):w.push(h,1,o||t[h])),M.push(h)}y&&Fn(this)},render:function(t,e){if(e.tween._time||!ur())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:Qr,aliases:vr,getSetter:function(t,e,n){var r=vr[e];return r&&r.indexOf(",")<0&&(e=r),e in cr&&e!==Pr&&(t._gsap.x||Qr(t,"x"))?n&&ar===n?"scale"===e?Sr:kr:(ar=n||{},"scale"===e?Er:Cr):t.style&&!ct(t.style[e])?Or:~e.indexOf("-")?Mr:Ln(t,e)},core:{_removeProperty:jr,_getMatrix:oi}};er.utils.checkPrefix=Nr,er.core.getStyleSaver=Rr,bi=jt((yi="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(wi="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){cr[t]=1})),jt(wi,(function(t){$.units[t]="deg",ni[t]=1})),vr[bi[13]]=yi+","+wi,jt("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");vr[e[1]]=bi[e[0]]})),jt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){$.units[t]="px"})),er.registerPlugin(xi);var Ti=er.registerPlugin(xi)||er;Ti.core.Tween;function Oi(t,e){for(var n=0;na?(i=r,r=t,s=o,o=u):n?r+=t:r=i+(t-i)/(u-s)*(o-s)};return{update:l,reset:function(){i=r=n?0:r,s=o=0},getVelocity:function(t){var e=s,a=i,c=Fi();return(t||0===t)&&t!==r&&l(t),o===s||c-s>u?0:(r+(n?a:-a))/((n?c:o)-e)*1e3}}},ro=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},io=function(t){var e=Math.max.apply(Math,t),n=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(n)?e:n},oo=function(){var t,e,n,r;(Ii=Mi.core.globals().ScrollTrigger)&&Ii.core&&(t=Ii.core,e=t.bridge||{},n=t._scrollers,r=t._proxies,n.push.apply(n,Yi),r.push.apply(r,Xi),Yi=n,Xi=r,Wi=function(t,n){return e[t](n)})},so=function(t){return(Mi=t||zi())&&"undefined"!=typeof document&&document.body&&(Si=window,Ei=document,Ci=Ei.documentElement,Di=Ei.body,Li=[Si,Ei,Ci,Di],Mi.utils.clamp,Ai="onpointerenter"in Di?"pointer":"mouse",Pi=ao.isTouch=Si.matchMedia&&Si.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in Si||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,Bi=ao.eventTypes=("ontouchstart"in Ci?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in Ci?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout((function(){return Vi=0}),500),oo(),ki=1),ki};Zi.op=Ji,Yi.cache=0;var ao=function(){function t(t){this.init(t)}var e,n,r;return t.prototype.init=function(t){ki||so(Mi)||console.warn("Please gsap.registerPlugin(Observer)"),Ii||oo();var e=t.tolerance,n=t.dragMinimum,r=t.type,i=t.target,o=t.lineHeight,s=t.debounce,a=t.preventDefault,u=t.onStop,l=t.onStopDelay,c=t.ignore,h=t.wheelSpeed,f=t.event,p=t.onDragStart,d=t.onDragEnd,g=t.onDrag,m=t.onPress,v=t.onRelease,_=t.onRight,y=t.onLeft,w=t.onUp,b=t.onDown,x=t.onChangeX,T=t.onChangeY,O=t.onChange,M=t.onToggleX,k=t.onToggleY,S=t.onHover,E=t.onHoverEnd,C=t.onMove,D=t.ignoreCheck,P=t.isNormalizer,A=t.onGestureStart,I=t.onGestureEnd,L=t.onWheel,R=t.onEnable,B=t.onDisable,z=t.onClick,V=t.scrollSpeed,N=t.capture,Y=t.allowClicks,X=t.lockAxis,F=t.onLockAxis;this.target=i=to(i)||Ci,this.vars=t,c&&(c=Mi.utils.toArray(c)),e=e||1e-9,n=n||0,h=h||1,V=V||1,r=r||"wheel,touch,pointer",s=!1!==s,o||(o=parseFloat(Si.getComputedStyle(Di).lineHeight)||22);var W,q,j,H,U,K,G,Q=this,$=0,Z=0,J=eo(i,Zi),tt=eo(i,Ji),et=J(),nt=tt(),rt=~r.indexOf("touch")&&!~r.indexOf("pointer")&&"pointerdown"===Bi[0],it=ji(i),ot=i.ownerDocument||Ei,st=[0,0,0],at=[0,0,0],ut=0,lt=function(){return ut=Fi()},ct=function(t,e){return(Q.event=t)&&c&&~c.indexOf(t.target)||e&&rt&&"touch"!==t.pointerType||D&&D(t,e)},ht=function(){var t=Q.deltaX=io(st),n=Q.deltaY=io(at),r=Math.abs(t)>=e,i=Math.abs(n)>=e;O&&(r||i)&&O(Q,t,n,st,at),r&&(_&&Q.deltaX>0&&_(Q),y&&Q.deltaX<0&&y(Q),x&&x(Q),M&&Q.deltaX<0!=$<0&&M(Q),$=Q.deltaX,st[0]=st[1]=st[2]=0),i&&(b&&Q.deltaY>0&&b(Q),w&&Q.deltaY<0&&w(Q),T&&T(Q),k&&Q.deltaY<0!=Z<0&&k(Q),Z=Q.deltaY,at[0]=at[1]=at[2]=0),(H||j)&&(C&&C(Q),j&&(g(Q),j=!1),H=!1),K&&(K=!1,1)&&F&&F(Q),U&&(L(Q),U=!1),W=0},ft=function(t,e,n){st[n]+=t,at[n]+=e,Q._vx.update(t),Q._vy.update(e),s?W||(W=requestAnimationFrame(ht)):ht()},pt=function(t,e){X&&!G&&(Q.axis=G=Math.abs(t)>Math.abs(e)?"x":"y",K=!0),"y"!==G&&(st[2]+=t,Q._vx.update(t,!0)),"x"!==G&&(at[2]+=e,Q._vy.update(e,!0)),s?W||(W=requestAnimationFrame(ht)):ht()},dt=function(t){if(!ct(t,1)){var e=(t=ro(t,a)).clientX,r=t.clientY,i=e-Q.x,o=r-Q.y,s=Q.isDragging;Q.x=e,Q.y=r,(s||Math.abs(Q.startX-e)>=n||Math.abs(Q.startY-r)>=n)&&(g&&(j=!0),s||(Q.isDragging=!0),pt(i,o),s||p&&p(Q))}},gt=Q.onPress=function(t){ct(t,1)||(Q.axis=G=null,q.pause(),Q.isPressed=!0,t=ro(t),$=Z=0,Q.startX=Q.x=t.clientX,Q.startY=Q.y=t.clientY,Q._vx.reset(),Q._vy.reset(),Hi(P?i:ot,Bi[1],dt,a,!0),Q.deltaX=Q.deltaY=0,m&&m(Q))},mt=function(t){if(!ct(t,1)){Ui(P?i:ot,Bi[1],dt,!0);var e=Q.isDragging&&(Math.abs(Q.x-Q.startX)>3||Math.abs(Q.y-Q.startY)>3),n=ro(t);e||(Q._vx.reset(),Q._vy.reset(),a&&Y&&Mi.delayedCall(.08,(function(){if(Fi()-ut>300&&!t.defaultPrevented)if(t.target.click)t.target.click();else if(ot.createEvent){var e=ot.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,Si,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(e)}}))),Q.isDragging=Q.isGesturing=Q.isPressed=!1,u&&!P&&q.restart(!0),d&&e&&d(Q),v&&v(Q,e)}},vt=function(t){return t.touches&&t.touches.length>1&&(Q.isGesturing=!0)&&A(t,Q.isDragging)},_t=function(){return Q.isGesturing=!1,I(Q)},yt=function(t){if(!ct(t)){var e=J(),n=tt();ft((e-et)*V,(n-nt)*V,1),et=e,nt=n,u&&q.restart(!0)}},wt=function(t){if(!ct(t)){t=ro(t,a),L&&(U=!0);var e=(1===t.deltaMode?o:2===t.deltaMode?Si.innerHeight:1)*h;ft(t.deltaX*e,t.deltaY*e,0),u&&!P&&q.restart(!0)}},bt=function(t){if(!ct(t)){var e=t.clientX,n=t.clientY,r=e-Q.x,i=n-Q.y;Q.x=e,Q.y=n,H=!0,(r||i)&&pt(r,i)}},xt=function(t){Q.event=t,S(Q)},Tt=function(t){Q.event=t,E(Q)},Ot=function(t){return ct(t)||ro(t,a)&&z(Q)};q=Q._dc=Mi.delayedCall(l||.25,(function(){Q._vx.reset(),Q._vy.reset(),q.pause(),u&&u(Q)})).pause(),Q.deltaX=Q.deltaY=0,Q._vx=no(0,50,!0),Q._vy=no(0,50,!0),Q.scrollX=J,Q.scrollY=tt,Q.isDragging=Q.isGesturing=Q.isPressed=!1,Q.enable=function(t){return Q.isEnabled||(Hi(it?ot:i,"scroll",Qi),r.indexOf("scroll")>=0&&Hi(it?ot:i,"scroll",yt,a,N),r.indexOf("wheel")>=0&&Hi(i,"wheel",wt,a,N),(r.indexOf("touch")>=0&&Pi||r.indexOf("pointer")>=0)&&(Hi(i,Bi[0],gt,a,N),Hi(ot,Bi[2],mt),Hi(ot,Bi[3],mt),Y&&Hi(i,"click",lt,!1,!0),z&&Hi(i,"click",Ot),A&&Hi(ot,"gesturestart",vt),I&&Hi(ot,"gestureend",_t),S&&Hi(i,Ai+"enter",xt),E&&Hi(i,Ai+"leave",Tt),C&&Hi(i,Ai+"move",bt)),Q.isEnabled=!0,t&&t.type&>(t),R&&R(Q)),Q},Q.disable=function(){Q.isEnabled&&(Ni.filter((function(t){return t!==Q&&ji(t.target)})).length||Ui(it?ot:i,"scroll",Qi),Q.isPressed&&(Q._vx.reset(),Q._vy.reset(),Ui(P?i:ot,Bi[1],dt,!0)),Ui(it?ot:i,"scroll",yt,N),Ui(i,"wheel",wt,N),Ui(i,Bi[0],gt,N),Ui(ot,Bi[2],mt),Ui(ot,Bi[3],mt),Ui(i,"click",lt,!0),Ui(i,"click",Ot),Ui(ot,"gesturestart",vt),Ui(ot,"gestureend",_t),Ui(i,Ai+"enter",xt),Ui(i,Ai+"leave",Tt),Ui(i,Ai+"move",bt),Q.isEnabled=Q.isPressed=Q.isDragging=!1,B&&B(Q))},Q.kill=function(){Q.disable();var t=Ni.indexOf(Q);t>=0&&Ni.splice(t,1),Ri===Q&&(Ri=0)},Ni.push(Q),P&&ji(i)&&(Ri=Q),Q.enable(f)},e=t,(n=[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}])&&Oi(e.prototype,n),r&&Oi(e,r),t}();ao.version="3.11.2",ao.create=function(t){return new ao(t)},ao.register=so,ao.getAll=function(){return Ni.slice()},ao.getById=function(t){return Ni.filter((function(e){return e.vars.id===t}))[0]},zi()&&Mi.registerPlugin(ao);var uo,lo,co,ho,fo,po,go,mo,vo,_o,yo,wo,bo,xo,To,Oo,Mo,ko,So,Eo,Co,Do,Po,Ao,Io,Lo,Ro,Bo,zo,Vo,No,Yo,Xo,Fo=1,Wo=Date.now,qo=Wo(),jo=0,Ho=0,Uo=function(){return xo=1},Ko=function(){return xo=0},Go=function(t){return t},Qo=function(t){return Math.round(1e5*t)/1e5||0},$o=function(){return"undefined"!=typeof window},Zo=function(){return uo||$o()&&(uo=window.gsap)&&uo.registerPlugin&&uo},Jo=function(t){return!!~go.indexOf(t)},ts=function(t){return qi(t,"getBoundingClientRect")||(Jo(t)?function(){return sa.width=co.innerWidth,sa.height=co.innerHeight,sa}:function(){return bs(t)})},es=function(t,e){var n=e.s,r=e.d2,i=e.d,o=e.a;return(o=qi(t,n="scroll"+r))?o()-ts(t)()[i]:Jo(t)?(fo[n]||po[n])-(co["inner"+r]||fo["client"+r]||po["client"+r]):t[n]-t["offset"+r]},ns=function(t,e){for(var n=0;n0){for(t-=i,o=0;o=t)return n[o];return n[o-1]}for(o=n.length,t+=i;o--;)if(n[o]<=t)return n[o];return n[0]}:function(n,r,i){void 0===i&&(i=.001);var o=e(n);return!r||Math.abs(o-n)n&&(r*=e/100),t=t.substr(0,n-1)),t=r+(t in Ps?Ps[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},Is=function(t,e,n,r,i,o,s,a){var u=i.startColor,l=i.endColor,c=i.fontSize,h=i.indent,f=i.fontWeight,p=ho.createElement("div"),d=Jo(n)||"fixed"===qi(n,"pinType"),g=-1!==t.indexOf("scroller"),m=d?po:n,v=-1!==t.indexOf("start"),_=v?u:l,y="border-color:"+_+";font-size:"+c+";color:"+_+";font-weight:"+f+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return y+="position:"+((g||a)&&d?"fixed;":"absolute;"),(g||a||!d)&&(y+=(r===Ji?hs:fs)+":"+(o+parseFloat(h))+"px;"),s&&(y+="box-sizing:border-box;text-align:left;width:"+s.offsetWidth+"px;"),p._isStart=v,p.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),p.style.cssText=y,p.innerText=e||0===e?t+"-"+e:t,m.children[0]?m.insertBefore(p,m.children[0]):m.appendChild(p),p._offset=p["offset"+r.op.d2],Ls(p,0,r,v),p},Ls=function(t,e,n,r){var i={display:"block"},o=n[r?"os2":"p2"],s=n[r?"p2":"os2"];t._isFlipped=r,i[n.a+"Percent"]=r?-100:0,i[n.a]=r?"1px":0,i["border"+o+vs]=1,i["border"+s+vs]=0,i[n.p]=e+"px",uo.set(t,i)},Rs=[],Bs={},zs=function(){return Wo()-jo>34&&Js()},Vs=function(){(!Po||!Po.isPressed||Po.startX>po.clientWidth)&&(Yi.cache++,No||(No=requestAnimationFrame(Js)),jo||qs("scrollStart"),jo=Wo())},Ns=function(){Lo=co.innerWidth,Io=co.innerHeight},Ys=function(){Yi.cache++,!bo&&!Do&&!ho.fullscreenElement&&!ho.webkitFullscreenElement&&(!Ao||Lo!==co.innerWidth||Math.abs(co.innerHeight-Io)>.25*co.innerHeight)&&mo.restart(!0)},Xs={},Fs=[],Ws=function t(){return Ss(ha,"scrollEnd",t)||Qs(!0)},qs=function(t){return Xs[t]&&Xs[t].map((function(t){return t()}))||Fs},js=[],Hs=function(t){for(var e=0;e=50,i=e&&Rs[0].scroll();if(Zs=$s>i?-1:1,$s=i,r&&(jo&&!xo&&n-jo>200&&(jo=0,qs("scrollEnd")),yo=qo,qo=n),Zs<0){for(Oo=e;Oo-- >0;)Rs[Oo]&&Rs[Oo].update(0,r);Zs=1}else for(Oo=0;Oo20),n-=n-y}if(o){var x=t+n,T=o._isStart;p="scroll"+r.d2,Ls(o,x,r,T&&x>20||!T&&(c?Math.max(po[p],fo[p]):o.parentNode[p])<=x+1),c&&(u=bs(s),c&&(o.style[r.op.p]=u[r.op.p]-r.op.m-o._offset+_s))}return f&&g&&(p=bs(g),f.seek(h),d=bs(g),f._caScrollDist=p[r.p]-d[r.p],t=t/f._caScrollDist*h),f&&f.seek(m),f?t:Math.round(t)},ua=/(webkit|moz|length|cssText|inset)/i,la=function(t,e,n,r){if(t.parentNode!==e){var i,o,s=t.style;if(e===po){for(i in t._stOrig=s.cssText,o=ys(t))+i||ua.test(i)||!o[i]||"string"!=typeof s[i]||"0"===i||(s[i]=o[i]);s.top=n,s.left=r}else s.cssText=t._stOrig;uo.core.getCache(t).uncache=1,e.appendChild(t)}},ca=function(t,e){var n,r,i=eo(t,e),o="_scroll"+e.p2,s=function e(s,a,u,l,c){var h=e.tween,f=a.onComplete,p={};return u=u||i(),c=l&&c||0,l=l||s-u,h&&h.kill(),n=Math.round(u),a[o]=s,a.modifiers=p,p[o]=function(t){return(t=Math.round(i()))!==n&&t!==r&&Math.abs(t-n)>3&&Math.abs(t-r)>3?(h.kill(),e.tween=0):t=u+l*h.ratio+c*h.ratio*h.ratio,r=n,n=Math.round(t)},a.onComplete=function(){e.tween=0,f&&f.call(h)},h=e.tween=uo.to(t,a)};return t[o]=i,i.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},ks(t,"wheel",i.wheelHandler),s},ha=function(){function t(e,n){lo||t.register(uo)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),this.init(e,n)}return t.prototype.init=function(e,n){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),Ho){var r,i,o,s,a,u,l,c,h,f,p,d,g,m,v,_,y,w,b,x,T,O,M,k,S,E,C,D,P,A,I,L,R,B,z,V,N,Y,X,F,W,q=e=ws(rs(e)||os(e)||e.nodeType?{trigger:e}:e,Ds),j=q.onUpdate,H=q.toggleClass,U=q.id,K=q.onToggle,G=q.onRefresh,Q=q.scrub,$=q.trigger,Z=q.pin,J=q.pinSpacing,tt=q.invalidateOnRefresh,et=q.anticipatePin,nt=q.onScrubComplete,rt=q.onSnapComplete,it=q.once,ot=q.snap,st=q.pinReparent,at=q.pinSpacer,ut=q.containerAnimation,lt=q.fastScrollEnd,ct=q.preventOverlaps,ht=e.horizontal||e.containerAnimation&&!1!==e.horizontal?Zi:Ji,ft=!Q&&0!==Q,pt=to(e.scroller||co),dt=uo.core.getCache(pt),gt=Jo(pt),mt="fixed"===("pinType"in e?e.pinType:qi(pt,"pinType")||gt&&"fixed"),vt=[e.onEnter,e.onLeave,e.onEnterBack,e.onLeaveBack],_t=ft&&e.toggleActions.split(" "),yt="markers"in e?e.markers:Ds.markers,wt=gt?0:parseFloat(ys(pt)["border"+ht.p2+vs])||0,bt=this,xt=e.onRefreshInit&&function(){return e.onRefreshInit(bt)},Tt=function(t,e,n){var r=n.d,i=n.d2,o=n.a;return(o=qi(t,"getBoundingClientRect"))?function(){return o()[r]}:function(){return(e?co["inner"+i]:t["client"+i])||0}}(pt,gt,ht),Ot=function(t,e){return!e||~Xi.indexOf(t)?ts(t):function(){return sa}}(pt,gt),Mt=0,kt=0,St=eo(pt,ht);if(Bo(bt),bt._dir=ht,et*=45,bt.scroller=pt,bt.scroll=ut?ut.time.bind(ut):St,s=St(),bt.vars=e,n=n||e.animation,"refreshPriority"in e&&(Eo=1,-9999===e.refreshPriority&&(Xo=bt)),dt.tweenScroll=dt.tweenScroll||{top:ca(pt,Ji),left:ca(pt,Zi)},bt.tweenTo=r=dt.tweenScroll[ht.p],bt.scrubDuration=function(t){(I=os(t)&&t)?A?A.duration(t):A=uo.to(n,{ease:"expo",totalProgress:"+=0.001",duration:I,paused:!0,onComplete:function(){return nt&&nt(bt)}}):(A&&A.progress(1).kill(),A=0)},n&&(n.vars.lazy=!1,n._initted||!1!==n.vars.immediateRender&&!1!==e.immediateRender&&n.duration()&&n.render(0,!0,!0),bt.animation=n.pause(),n.scrollTrigger=bt,bt.scrubDuration(Q),D=0,U||(U=n.vars.id)),Rs.push(bt),ot&&(ss(ot)&&!ot.push||(ot={snapTo:ot}),"scrollBehavior"in po.style&&uo.set(gt?[po,fo]:pt,{scrollBehavior:"auto"}),o=is(ot.snapTo)?ot.snapTo:"labels"===ot.snapTo?function(t){return function(e){return uo.utils.snap(Ts(t),e)}}(n):"labelsDirectional"===ot.snapTo?(X=n,function(t,e){return Os(Ts(X))(t,e.direction)}):!1!==ot.directional?function(t,e){return Os(ot.snapTo)(t,Wo()-kt<500?0:e.direction)}:uo.utils.snap(ot.snapTo),L=ot.duration||{min:.1,max:2},L=ss(L)?_o(L.min,L.max):_o(L,L),R=uo.delayedCall(ot.delay||I/2||.1,(function(){var t=St(),e=Wo()-kt<500,i=r.tween;if(!(e||Math.abs(bt.getVelocity())<10)||i||xo||Mt===t)bt.isActive&&Mt!==t&&R.restart(!0);else{var s=(t-u)/g,a=n&&!ft?n.totalProgress():s,c=e?0:(a-P)/(Wo()-yo)*1e3||0,h=uo.utils.clamp(-s,1-s,ls(c/2)*c/.185),f=s+(!1===ot.inertia?0:h),p=_o(0,1,o(f,bt)),d=Math.round(u+p*g),m=ot,v=m.onStart,_=m.onInterrupt,y=m.onComplete;if(t<=l&&t>=u&&d!==t){if(i&&!i._initted&&i.data<=ls(d-t))return;!1===ot.inertia&&(h=p-s),r(d,{duration:L(ls(.185*Math.max(ls(f-a),ls(p-a))/c/.05||0)),ease:ot.ease||"power3",data:ls(d-t),onInterrupt:function(){return R.restart(!0)&&_&&_(bt)},onComplete:function(){bt.update(),Mt=St(),D=P=n&&!ft?n.totalProgress():bt.progress,rt&&rt(bt),y&&y(bt)}},t,h*g,d-t-h*g),v&&v(bt,r.tween)}}})).pause()),U&&(Bs[U]=bt),(Y=($=bt.trigger=to($||Z))&&$._gsap&&$._gsap.stRevert)&&(Y=Y(bt)),Z=!0===Z?$:to(Z),rs(H)&&(H={targets:$,className:H}),Z&&(!1===J||J===ms||(J=!(!J&&"flex"===ys(Z.parentNode).display)&&gs),bt.pin=Z,(i=uo.core.getCache(Z)).spacer?m=i.pinState:(at&&((at=to(at))&&!at.nodeType&&(at=at.current||at.nativeElement),i.spacerIsNative=!!at,at&&(i.spacerState=oa(at))),i.spacer=y=at||ho.createElement("div"),y.classList.add("pin-spacer"),U&&y.classList.add("pin-spacer-"+U),i.pinState=m=oa(Z)),!1!==e.force3D&&uo.set(Z,{force3D:!0}),bt.spacer=y=i.spacer,C=ys(Z),M=C[J+ht.os2],b=uo.getProperty(Z),x=uo.quickSetter(Z,ht.a,_s),na(Z,y,C),_=oa(Z)),yt){d=ss(yt)?ws(yt,Cs):Cs,f=Is("scroller-start",U,pt,ht,d,0),p=Is("scroller-end",U,pt,ht,d,0,f),w=f["offset"+ht.op.d2];var Et=to(qi(pt,"content")||pt);c=this.markerStart=Is("start",U,Et,ht,d,w,0,ut),h=this.markerEnd=Is("end",U,Et,ht,d,w,0,ut),ut&&(N=uo.quickSetter([c,h],ht.a,_s)),mt||Xi.length&&!0===qi(pt,"fixedMarkers")||(W=ys(F=gt?po:pt).position,F.style.position="absolute"===W||"fixed"===W?W:"relative",uo.set([f,p],{force3D:!0}),S=uo.quickSetter(f,ht.a,_s),E=uo.quickSetter(p,ht.a,_s))}if(ut){var Ct=ut.vars.onUpdate,Dt=ut.vars.onUpdateParams;ut.eventCallback("onUpdate",(function(){bt.update(0,0,1),Ct&&Ct.apply(Dt||[])}))}bt.previous=function(){return Rs[Rs.indexOf(bt)-1]},bt.next=function(){return Rs[Rs.indexOf(bt)+1]},bt.revert=function(t,e){if(!e)return bt.kill(!0);var r=!1!==t||!bt.enabled,i=bo;r!==bt.isReverted&&(r&&(z=Math.max(St(),bt.scroll.rec||0),B=bt.progress,V=n&&n.progress()),c&&[c,h,f,p].forEach((function(t){return t.style.display=r?"none":"block"})),r&&(bo=1),bt.update(r),bo=i,Z&&(r?function(t,e,n){ia(n);var r=t._gsap;if(r.spacerIsNative)ia(r.spacerState);else if(t._gsap.swappedIn){var i=e.parentNode;i&&(i.insertBefore(t,e),i.removeChild(e))}t._gsap.swappedIn=!1}(Z,y,m):(!st||!bt.isActive)&&na(Z,y,ys(Z),k)),bt.isReverted=r)},bt.refresh=function(i,o){if(!bo&&bt.enabled||o)if(Z&&i&&jo)ks(t,"scrollEnd",Ws);else{!Yo&&xt&&xt(bt),bo=1,kt=Wo(),r.tween&&(r.tween.kill(),r.tween=0),A&&A.pause(),tt&&n&&n.revert({kill:!1}).invalidate(),bt.isReverted||bt.revert(!0,!0);for(var d,w,x,M,S,E,C,D,P,I,L=Tt(),N=Ot(),Y=ut?ut.duration():es(pt,ht),X=0,F=0,W=e.end,q=e.endTrigger||$,j=e.start||(0!==e.start&&$?Z?"0 0":"0 100%":0),H=bt.pinnedContainer=e.pinnedContainer&&to(e.pinnedContainer),U=$&&Math.max(0,Rs.indexOf(bt))||0,K=U;K--;)(E=Rs[K]).end||E.refresh(0,1)||(bo=1),!(C=E.pin)||C!==$&&C!==Z||E.isReverted||(I||(I=[]),I.unshift(E),E.revert(!0,!0)),E!==Rs[K]&&(U--,K--);for(is(j)&&(j=j(bt)),u=aa(j,$,L,ht,St(),c,f,bt,N,wt,mt,Y,ut)||(Z?-.001:0),is(W)&&(W=W(bt)),rs(W)&&!W.indexOf("+=")&&(~W.indexOf(" ")?W=(rs(j)?j.split(" ")[0]:"")+W:(X=As(W.substr(2),L),W=rs(j)?j:u+X,q=$)),l=Math.max(u,aa(W||(q?"100% 0":Y),q,L,ht,St()+X,h,p,bt,N,wt,mt,Y,ut))||-.001,g=l-u||(u-=.01)&&.001,X=0,K=U;K--;)(C=(E=Rs[K]).pin)&&E.start-E._pinPush0&&(d=E.end-E.start,C!==$&&C!==H||os(j)||(X+=d*(1-E.progress)),C===Z&&(F+=d));if(u+=X,l+=X,bt._pinPush=F,c&&X&&((d={})[ht.a]="+="+X,H&&(d[ht.p]="-="+St()),uo.set([c,h],d)),Z)d=ys(Z),M=ht===Ji,x=St(),T=parseFloat(b(ht.a))+F,!Y&&l>1&&((gt?po:pt).style["overflow-"+ht.a]="scroll"),na(Z,y,d),_=oa(Z),w=bs(Z,!0),D=mt&&eo(pt,M?Zi:Ji)(),J&&((k=[J+ht.os2,g+F+_s]).t=y,(K=J===gs?xs(Z,ht)+g+F:0)&&k.push(ht.d,K+_s),ia(k),mt&&St(z)),mt&&((S={top:w.top+(M?x-u:D)+_s,left:w.left+(M?D:x-u)+_s,boxSizing:"border-box",position:"fixed"}).width=S.maxWidth=Math.ceil(w.width)+_s,S.height=S.maxHeight=Math.ceil(w.height)+_s,S.margin=S.marginTop=S.marginRight=S.marginBottom=S.marginLeft="0",S.padding=d.padding,S.paddingTop=d.paddingTop,S.paddingRight=d.paddingRight,S.paddingBottom=d.paddingBottom,S.paddingLeft=d.paddingLeft,v=function(t,e,n){for(var r,i=[],o=t.length,s=n?8:0;s0?Rs.slice(0,e).reverse():Rs.slice(e+1);return(rs(t)?n.filter((function(e){return e.vars.preventOverlaps===t})):n).filter((function(t){return bt.direction>0?t.end<=u:t.start>=l}))},bt.update=function(t,e,i){if(!ut||i||t){var o,c,h,p,d,m,w,b=Yo?z:bt.scroll(),k=t?0:(b-u)/g,C=k<0?0:k>1?1:k||0,I=bt.progress;if(e&&(a=s,s=ut?St():b,ot&&(P=D,D=n&&!ft?n.totalProgress():C)),et&&!C&&Z&&!bo&&!Fo&&jo&&uI?1:-1,bt.progress=C,p&&!bo&&(c=C&&!I?0:1===C?1:1===I?2:3,ft&&(h=!d&&"none"!==_t[c+1]&&_t[c+1]||_t[c],w=n&&("complete"===h||"reset"===h||h in n))),ct&&(d||w)&&(w||Q||!n)&&(is(ct)?ct(bt):bt.getTrailing(ct).forEach((function(t){return t.endAnimation()}))),ft||(!A||bo||Fo?n&&n.totalProgress(C,!!bo):((ut||Xo&&Xo!==bt)&&A.render(A._dp._time-A._start),A.resetTo?A.resetTo("totalProgress",C,n._tTime/n._tDur):(A.vars.totalProgress=C,A.invalidate().restart()))),Z)if(t&&J&&(y.style[J+ht.os2]=M),mt){if(p){if(m=!t&&C>I&&l+1>b&&b+1>=es(pt,ht),st)if(t||!o&&!m)la(Z,y);else{var L=bs(Z,!0),B=b-u;la(Z,po,L.top+(ht===Ji?B:0)+_s,L.left+(ht===Ji?0:B)+_s)}ia(o||m?v:_),O!==g&&C<1&&o||x(T+(1!==C||m?0:O))}}else x(Qo(T+O*C));ot&&!r.tween&&!bo&&!Fo&&R.restart(!0),H&&(d||it&&C&&(C<1||!Vo))&&vo(H.targets).forEach((function(t){return t.classList[o||it?"add":"remove"](H.className)})),j&&!ft&&!t&&j(bt),p&&!bo?(ft&&(w&&("complete"===h?n.pause().totalProgress(1):"reset"===h?n.restart(!0).pause():"restart"===h?n.restart(!0):n[h]()),j&&j(bt)),!d&&Vo||(K&&d&&us(bt,K),vt[c]&&us(bt,vt[c]),it&&(1===C?bt.kill(!1,1):vt[c]=0),d||vt[c=1===C?1:3]&&us(bt,vt[c])),lt&&!o&&Math.abs(bt.getVelocity())>(os(lt)?lt:2500)&&(as(bt.callbackAnimation),A?A.progress(1):as(n,"reverse"===h?1:!C,1))):ft&&j&&!bo&&j(bt)}if(E){var V=ut?b/ut.duration()*(ut._caScrollDist||0):b;S(V+(f._isFlipped?1:0)),E(V)}N&&N(-b/ut.duration()*(ut._caScrollDist||0))}},bt.enable=function(e,n){bt.enabled||(bt.enabled=!0,ks(pt,"resize",Ys),ks(gt?ho:pt,"scroll",Vs),xt&&ks(t,"refreshInit",xt),!1!==e&&(bt.progress=B=0,s=a=Mt=St()),!1!==n&&bt.refresh())},bt.getTween=function(t){return t&&r?r.tween:A},bt.setPositions=function(t,e){Z&&(T+=t-u,O+=e-t-g),bt.start=u=t,bt.end=l=e,g=e-t,bt.update()},bt.disable=function(e,n){if(bt.enabled&&(!1!==e&&bt.revert(!0,!0),bt.enabled=bt.isActive=!1,n||A&&A.pause(),z=0,i&&(i.uncache=1),xt&&Ss(t,"refreshInit",xt),R&&(R.pause(),r.tween&&r.tween.kill()&&(r.tween=0)),!gt)){for(var o=Rs.length;o--;)if(Rs[o].scroller===pt&&Rs[o]!==bt)return;Ss(pt,"resize",Ys),Ss(pt,"scroll",Vs)}},bt.kill=function(t,r){bt.disable(t,r),A&&!r&&A.kill(),U&&delete Bs[U];var o=Rs.indexOf(bt);o>=0&&Rs.splice(o,1),o===Oo&&Zs>0&&Oo--,o=0,Rs.forEach((function(t){return t.scroller===bt.scroller&&(o=1)})),o||Yo||(bt.scroll.rec=0),n&&(n.scrollTrigger=null,t&&n.revert({kill:!1}),r||n.kill()),c&&[c,h,f,p].forEach((function(t){return t.parentNode&&t.parentNode.removeChild(t)})),Xo===bt&&(Xo=0),Z&&(i&&(i.uncache=1),o=0,Rs.forEach((function(t){return t.pin===Z&&o++})),o||(i.spacer=0)),e.onKill&&e.onKill(bt)},bt.enable(!1,!1),Y&&Y(bt),n&&n.add&&!g?uo.delayedCall(.01,(function(){return u||l||bt.refresh()}))&&(g=.01)&&(u=l=0):bt.refresh()}else this.update=this.refresh=this.kill=Go},t.register=function(e){return lo||(uo=e||Zo(),$o()&&window.document&&t.enable(),lo=Ho),lo},t.defaults=function(t){if(t)for(var e in t)Ds[e]=t[e];return Ds},t.disable=function(t,e){Ho=0,Rs.forEach((function(n){return n[e?"kill":"disable"](t)})),Ss(co,"wheel",Vs),Ss(ho,"scroll",Vs),clearInterval(wo),Ss(ho,"touchcancel",Go),Ss(po,"touchstart",Go),Ms(Ss,ho,"pointerdown,touchstart,mousedown",Uo),Ms(Ss,ho,"pointerup,touchend,mouseup",Ko),mo.kill(),ns(Ss);for(var n=0;n0&&r.left+i0&&r.top+i=0&&js.splice(e,5),js.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),uo.core.getCache(t),Bo())}})):js},ha.revert=function(t,e){return Us(!t,e)},ha.create=function(t,e){return new ha(t,e)},ha.refresh=function(t){return t?Ys():(lo||ha.register())&&Qs(!0)},ha.update=Js,ha.clearScrollMemory=Ks,ha.maxScroll=function(t,e){return es(t,e?Zi:Ji)},ha.getScrollFunc=function(t,e){return eo(to(t),e?Zi:Ji)},ha.getById=function(t){return Bs[t]},ha.getAll=function(){return Rs.filter((function(t){return"ScrollSmoother"!==t.vars.id}))},ha.isScrolling=function(){return!!jo},ha.snapDirectional=Os,ha.addEventListener=function(t,e){var n=Xs[t]||(Xs[t]=[]);~n.indexOf(e)||n.push(e)},ha.removeEventListener=function(t,e){var n=Xs[t],r=n&&n.indexOf(e);r>=0&&n.splice(r,1)},ha.batch=function(t,e){var n,r=[],i={},o=e.interval||.016,s=e.batchMax||1e9,a=function(t,e){var n=[],r=[],i=uo.delayedCall(o,(function(){e(n,r),n=[],r=[]})).pause();return function(t){n.length||i.restart(!0),n.push(t.trigger),r.push(t),s<=n.length&&i.progress(1)}};for(n in e)i[n]="on"===n.substr(0,2)&&is(e[n])&&"onRefreshInit"!==n?a(0,e[n]):e[n];return is(s)&&(s=s(),ks(ha,"refresh",(function(){return s=e.batchMax()}))),vo(t).forEach((function(t){var e={};for(n in i)e[n]=i[n];e.trigger=t,r.push(ha.create(e))})),r};var fa,pa=function(t,e,n,r){return e>r?t(r):e<0&&t(0),n>r?(r-e)/(n-e):n<0?e/(e-n):1},da=function t(e,n){!0===n?e.style.removeProperty("touch-action"):e.style.touchAction=!0===n?"auto":n?"pan-"+n+(ao.isTouch?" pinch-zoom":""):"none",e===fo&&t(po,n)},ga={auto:1,scroll:1},ma=function(t){var e,n=t.event,r=t.target,i=t.axis,o=(n.changedTouches?n.changedTouches[0]:n).target,s=o._gsap||uo.core.getCache(o),a=Wo();if(!s._isScrollT||a-s._isScrollT>2e3){for(;o&&o.scrollHeight<=o.clientHeight;)o=o.parentNode;s._isScroll=o&&!Jo(o)&&o!==r&&(ga[(e=ys(o)).overflowY]||ga[e.overflowX]),s._isScrollT=a}(s._isScroll||"x"===i)&&(n.stopPropagation(),n._gsapAllow=!0)},va=function(t,e,n,r){return ao.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:r=r&&ma,onPress:r,onDrag:r,onScroll:r,onEnable:function(){return n&&ks(ho,ao.eventTypes[0],ya,!1,!0)},onDisable:function(){return Ss(ho,ao.eventTypes[0],ya,!0)}})},_a=/(input|label|select|textarea)/i,ya=function(t){var e=_a.test(t.target.tagName);(e||fa)&&(t._gsapAllow=!0,fa=e)},wa=function(t){ss(t)||(t={}),t.preventDefault=t.isNormalizer=t.allowClicks=!0,t.type||(t.type="wheel,touch"),t.debounce=!!t.debounce,t.id=t.id||"normalizer";var e,n,r,i,o,s,a,u,l=t,c=l.normalizeScrollX,h=l.momentum,f=l.allowNestedScroll,p=to(t.target)||fo,d=uo.core.globals().ScrollSmoother,g=d&&d.get(),m=Ro&&(t.content&&to(t.content)||g&&!1!==t.content&&!g.smooth()&&g.content()),v=eo(p,Ji),_=eo(p,Zi),y=1,w=(ao.isTouch&&co.visualViewport?co.visualViewport.scale*co.visualViewport.width:co.outerWidth)/co.innerWidth,b=0,x=is(h)?function(){return h(e)}:function(){return h||2.8},T=va(p,t.type,!0,f),O=function(){return i=!1},M=Go,k=Go,S=function(){n=es(p,Ji),k=_o(Ro?1:0,n),c&&(M=_o(0,es(p,Zi))),r=Gs},E=function(){m._gsap.y=Qo(parseFloat(m._gsap.y)+v.offset)+"px",m.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(m._gsap.y)+", 0, 1)",v.offset=v.cacheID=0},C=function(){S(),o.isActive()&&o.vars.scrollY>n&&(v()>n?o.progress(1)&&v(n):o.resetTo("scrollY",n))};return m&&uo.set(m,{y:"+=0"}),t.ignoreCheck=function(t){return Ro&&"touchmove"===t.type&&function(){if(i){requestAnimationFrame(O);var t=Qo(e.deltaY/2),n=k(v.v-t);if(m&&n!==v.v+v.offset){v.offset=n-v.v;var r=Qo((parseFloat(m&&m._gsap.y)||0)-v.offset);m.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+r+", 0, 1)",m._gsap.y=r+"px",v.cacheID=Yi.cache,Js()}return!0}v.offset&&E(),i=!0}()||y>1.05&&"touchstart"!==t.type||e.isGesturing||t.touches&&t.touches.length>1},t.onPress=function(){var t=y;y=Qo((co.visualViewport&&co.visualViewport.scale||1)/w),o.pause(),t!==y&&da(p,y>1.01||!c&&"x"),s=_(),a=v(),S(),r=Gs},t.onRelease=t.onGestureStart=function(t,e){if(v.offset&&E(),e){Yi.cache++;var r,i,s=x();c&&(i=(r=_())+.05*s*-t.velocityX/.227,s*=pa(_,r,i,es(p,Zi)),o.vars.scrollX=M(i)),i=(r=v())+.05*s*-t.velocityY/.227,s*=pa(v,r,i,es(p,Ji)),o.vars.scrollY=k(i),o.invalidate().duration(s).play(.01),(Ro&&o.vars.scrollY>=n||r>=n-1)&&uo.to({},{onUpdate:C,duration:s})}else u.restart(!0)},t.onWheel=function(){o._ts&&o.pause(),Wo()-b>1e3&&(r=0,b=Wo())},t.onChange=function(t,e,n,i,o){if(Gs!==r&&S(),e&&c&&_(M(i[2]===e?s+(t.startX-t.x):_()+e-i[1])),n){v.offset&&E();var u=o[2]===n,l=u?a+t.startY-t.y:v()+n-o[1],h=k(l);u&&l!==h&&(a+=h-l),v(h)}(n||e)&&Js()},t.onEnable=function(){da(p,!c&&"x"),ha.addEventListener("refresh",C),ks(co,"resize",C),v.smooth&&(v.target.style.scrollBehavior="auto",v.smooth=_.smooth=!1),T.enable()},t.onDisable=function(){da(p,!0),Ss(co,"resize",C),ha.removeEventListener("refresh",C),T.kill()},t.lockAxis=!1!==t.lockAxis,(e=new ao(t)).iOS=Ro,Ro&&!v()&&v(1),Ro&&uo.ticker.add(Go),u=e._dc,o=uo.to(e,{ease:"power4",paused:!0,scrollX:c?"+=0.1":"+=0",scrollY:"+=0.1",onComplete:u.vars.onComplete}),e};ha.sort=function(t){return Rs.sort(t||function(t,e){return-1e6*(t.vars.refreshPriority||0)+t.start-(e.start+-1e6*(e.vars.refreshPriority||0))})},ha.observe=function(t){return new ao(t)},ha.normalizeScroll=function(t){if(void 0===t)return Po;if(!0===t&&Po)return Po.enable();if(!1===t)return Po&&Po.kill();var e=t instanceof ao?t:wa(t);return Po&&Po.target===e.target&&Po.kill(),Jo(e.target)&&(Po=e),e},ha.core={_getVelocityProp:no,_inputObserver:va,_scrollers:Yi,_proxies:Xi,bridge:{ss:function(){jo||qs("scrollStart"),jo=Wo()},ref:function(){return bo}}},Zo()&&uo.registerPlugin(ha); 25 | /*! 26 | * matrix 3.11.2 27 | * https://greensock.com 28 | * 29 | * Copyright 2008-2022, GreenSock. All rights reserved. 30 | * Subject to the terms at https://greensock.com/standard-license or for 31 | * Club GreenSock members, the agreement issued with that membership. 32 | * @author: Jack Doyle, jack@greensock.com 33 | */var ba,xa,Ta,Oa,Ma,ka,Sa,Ea,Ca,Da="transform",Pa=Da+"Origin",Aa=function(t){var e=t.ownerDocument||t;!(Da in t.style)&&"msTransform"in t.style&&(Pa=(Da="msTransform")+"Origin");for(;e.parentNode&&(e=e.parentNode););if(xa=window,Sa=new Wa,e){ba=e,Ta=e.documentElement,Oa=e.body,(Ea=ba.createElementNS("http://www.w3.org/2000/svg","g")).style.transform="none";var n=e.createElement("div"),r=e.createElement("div");Oa.appendChild(n),n.appendChild(r),n.style.position="static",n.style[Da]="translate3d(0,0,1px)",Ca=r.offsetParent!==n,Oa.removeChild(n)}return e},Ia=[],La=[],Ra=function(){return xa.pageYOffset||ba.scrollTop||Ta.scrollTop||Oa.scrollTop||0},Ba=function(){return xa.pageXOffset||ba.scrollLeft||Ta.scrollLeft||Oa.scrollLeft||0},za=function(t){return t.ownerSVGElement||("svg"===(t.tagName+"").toLowerCase()?t:null)},Va=function t(e){return"fixed"===xa.getComputedStyle(e).position||((e=e.parentNode)&&1===e.nodeType?t(e):void 0)},Na=function t(e,n){if(e.parentNode&&(ba||Aa(e))){var r=za(e),i=r?r.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o=r?n?"rect":"g":"div",s=2!==n?0:100,a=3===n?100:0,u="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",l=ba.createElementNS?ba.createElementNS(i.replace(/^https/,"http"),o):ba.createElement(o);return n&&(r?(ka||(ka=t(e)),l.setAttribute("width",.01),l.setAttribute("height",.01),l.setAttribute("transform","translate("+s+","+a+")"),ka.appendChild(l)):(Ma||((Ma=t(e)).style.cssText=u),l.style.cssText=u+"width:0.1px;height:0.1px;top:"+a+"px;left:"+s+"px",Ma.appendChild(l))),l}throw"Need document and parent."},Ya=function(t){var e,n=t.getCTM();return n||(e=t.style[Da],t.style[Da]="none",t.appendChild(Ea),n=Ea.getCTM(),t.removeChild(Ea),e?t.style[Da]=e:t.style.removeProperty(Da.replace(/([A-Z])/g,"-$1").toLowerCase())),n||Sa.clone()},Xa=function(t,e){var n,r,i,o,s,a,u=za(t),l=t===u,c=u?Ia:La,h=t.parentNode;if(t===xa)return t;if(c.length||c.push(Na(t,1),Na(t,2),Na(t,3)),n=u?ka:Ma,u)l?(o=-(i=Ya(t)).e/i.a,s=-i.f/i.d,r=Sa):t.getBBox?(i=t.getBBox(),r=(r=t.transform?t.transform.baseVal:{}).numberOfItems?r.numberOfItems>1?function(t){for(var e=new Wa,n=0;n4&&(o=i.offsetLeft,s=i.offsetTop,i=0);if("absolute"!==(a=xa.getComputedStyle(t)).position&&"fixed"!==a.position)for(r=t.offsetParent;h&&h!==r;)o+=h.scrollLeft||0,s+=h.scrollTop||0,h=h.parentNode;(i=n.style).top=t.offsetTop-s+"px",i.left=t.offsetLeft-o+"px",i[Da]=a[Da],i[Pa]=a[Pa],i.position="fixed"===a.position?"fixed":"absolute",t.parentNode.appendChild(n)}return n},Fa=function(t,e,n,r,i,o,s){return t.a=e,t.b=n,t.c=r,t.d=i,t.e=o,t.f=s,t},Wa=function(){function t(t,e,n,r,i,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===i&&(i=0),void 0===o&&(o=0),Fa(this,t,e,n,r,i,o)}var e=t.prototype;return e.inverse=function(){var t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,o=this.f,s=t*r-e*n||1e-10;return Fa(this,r/s,-e/s,-n/s,t/s,(n*o-r*i)/s,-(t*o-e*i)/s)},e.multiply=function(t){var e=this.a,n=this.b,r=this.c,i=this.d,o=this.e,s=this.f,a=t.a,u=t.c,l=t.b,c=t.d,h=t.e,f=t.f;return Fa(this,a*e+l*r,a*n+l*i,u*e+c*r,u*n+c*i,o+h*e+f*r,s+h*n+f*i)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function(t){var e=this.a,n=this.b,r=this.c,i=this.d,o=this.e,s=this.f;return e===t.a&&n===t.b&&r===t.c&&i===t.d&&o===t.e&&s===t.f},e.apply=function(t,e){void 0===e&&(e={});var n=t.x,r=t.y,i=this.a,o=this.b,s=this.c,a=this.d,u=this.e,l=this.f;return e.x=n*i+r*s+u||0,e.y=n*o+r*a+l||0,e},t}();function qa(t,e,n,r){if(!t||!t.parentNode||(ba||Aa(t)).documentElement===t)return new Wa;var i=function(t){for(var e,n;t&&t!==Oa;)(n=t._gsap)&&n.uncache&&n.get(t,"x"),n&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),e?e.push(n):e=[n]),t=t.parentNode;return e}(t),o=za(t)?Ia:La,s=Xa(t,n),a=o[0].getBoundingClientRect(),u=o[1].getBoundingClientRect(),l=o[2].getBoundingClientRect(),c=s.parentNode,h=!r&&Va(t),f=new Wa((u.left-a.left)/100,(u.top-a.top)/100,(l.left-a.left)/100,(l.top-a.top)/100,a.left+(h?0:Ba()),a.top+(h?0:Ra()));if(c.removeChild(s),i)for(a=i.length;a--;)(u=i[a]).scaleX=u.scaleY=0,u.renderTransform(1,u);return e?f.inverse():f}var ja,Ha,Ua,Ka,Ga,Qa,$a,Za=1,Ja=function(t,e){return t.actions.forEach((function(t){return t.vars[e]&&t.vars[e](t)}))},tu={},eu=180/Math.PI,nu=Math.PI/180,ru={},iu={},ou={},su=function(t){return"string"==typeof t?t.split(" ").join("").split(","):t},au=su("onStart,onUpdate,onComplete,onReverseComplete,onInterrupt"),uu=su("transform,transformOrigin,width,height,position,top,left,opacity,zIndex,maxWidth,maxHeight,minWidth,minHeight"),lu=function(t){return ja(t)[0]||console.warn("Element not found:",t)},cu=function(t){return Math.round(1e4*t)/1e4||0},hu=function(t,e,n){return t.forEach((function(t){return t.classList[n](e)}))},fu={zIndex:1,kill:1,simple:1,spin:1,clearProps:1,targets:1,toggleClass:1,onComplete:1,onUpdate:1,onInterrupt:1,onStart:1,delay:1,repeat:1,repeatDelay:1,yoyo:1,scale:1,fade:1,absolute:1,props:1,onEnter:1,onLeave:1,custom:1,paused:1,nested:1,prune:1,absoluteOnLeave:1},pu={zIndex:1,simple:1,clearProps:1,scale:1,absolute:1,fitChild:1,getVars:1,props:1},du=function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()},gu=function(t,e){var n,r={};for(n in t)e[n]||(r[n]=t[n]);return r},mu={},vu=function(t){var e=mu[t]=su(t);return ou[t]=e.concat(uu),e},_u=function t(e,n,r){void 0===r&&(r=0);for(var i=e.parentNode,o=1e3*Math.pow(10,r)*(n?-1:1),s=n?900*-o:0;e;)s+=o,e=e.previousSibling;return i?s+t(i,n,r+1):s},yu=function(t,e,n){return t.forEach((function(t){return t.d=_u(n?t.element:t.t,e)})),t.sort((function(t,e){return t.d-e.d})),t},wu=function(t,e){for(var n,r,i=t.element.style,o=t.css=t.css||[],s=e.length;s--;)r=i[n=e[s]]||i.getPropertyValue(n),o.push(r?n:iu[n]||(iu[n]=du(n)),r);return i},bu=function(t){var e=t.css,n=t.element.style,r=0;for(t.cache.uncache=1;r0&&R&&(u.style.opacity=G?m.opacity-v.opacity:"0"),Pu(m,v,L,N)):v.isVisible!==m.isVisible&&(v.isVisible?m.isVisible||(v.css=m.css,q.push(v),j.splice(a--,1),T&&A&&Pu(m,v,L,N)):(m.isVisible&&W.push(m),j.splice(a--,1))),L||(u.style.maxWidth=Math.max(m.width,v.width)+"px",u.style.maxHeight=Math.max(m.height,v.height)+"px",u.style.minWidth=Math.min(m.width,v.width)+"px",u.style.minHeight=Math.min(m.height,v.height)+"px"),A&&P&&u.classList.add(P)):j.splice(a--,1),f.push(m);var e;if(P&&(e=f.map((function(t){return t.element})),A&&e.forEach((function(t){return t.classList.remove(P)}))),Bu(!1),L?(Y.scaleX=function(t){return j[t].a.scaleX},Y.scaleY=function(t){return j[t].a.scaleY}):(Y.width=function(t){return j[t].a.width+"px"},Y.height=function(t){return j[t].a.height+"px"},Y.autoRound=n.autoRound||!1),Y.x=function(t){return j[t].a.x+"px"},Y.y=function(t){return j[t].a.y+"px"},Y.rotation=function(t){return j[t].a.rotation+(z?360*K(t,h[t],h):0)},Y.skewX=function(t){return j[t].a.skewX},h=j.map((function(t){return t.t})),(I||0===I)&&(Y.modifiers={zIndex:function(){return I}},Y.zIndex=I,Y.immediateRender=!1!==n.immediateRender),R&&(Y.opacity=function(t){return j[t].sd<0?0:j[t].sd>0?j[t].a.opacity:"+=0"}),H.length){B=Ha.utils.distribute(B);var r=h.slice(H.length);Y.stagger=function(t,e){return B(~H.indexOf(e)?h.indexOf(j[t].swap.t):t,e,r)}}if(au.forEach((function(t){return n[t]&&X.eventCallback(t,n[t],n[t+"Params"])})),M&&h.length)for(o in F=gu(Y,fu),"scale"in M&&(M.scaleX=M.scaleY=M.scale,delete M.scale),M)(i=gu(M[o],pu))[o]=Y[o],!("duration"in i)&&"duration"in Y&&(i.duration=Y.duration),i.stagger=Y.stagger,Q.call(X,h,i,0),delete F[o];(h.length||q.length||W.length)&&(P&&X.add((function(){return hu(e,P,X._zTime<0?"remove":"add")}),0)&&!S&&hu(e,P,"add"),h.length&&Q.call(X,h,F,0)),Du(b,W,X),Du(x,q,X);var p=Ua&&Ua.timeline;p&&(p.add(X,0),Ua._final.push((function(){return xu(j,!w)}))),s=X.duration(),X.call((function(){var t=X.time()>=s;t&&!p&&xu(j,!w),P&&hu(e,P,t?"remove":"add")}))},O&&(T=j.filter((function(t){return!t.sd&&!t.a.isVisible&&t.b.isVisible})).map((function(t){return t.a.element}))),Ua)?(T&&(_=Ua._abs).push.apply(_,Mu(j,T)),Ua._run.push(g)):(T&&ku(Mu(j,T)),g());var $=Ua?Ua.timeline:X;return $.revert=function(){return Nu($,1)},$},Vu=function t(e){e.vars.onInterrupt&&e.vars.onInterrupt.apply(e,e.vars.onInterruptParams||[]),e.getChildren(!0,!1,!0).forEach(t)},Nu=function(t,e){if(t&&t.progress()<1&&!t.paused())return e&&(Vu(t),e<2&&t.progress(1),t.kill()),!0},Yu=function(t){for(var e,n=t.idLookup={},r=t.alt={},i=t.elementStates,o=i.length;o--;)n[(e=i[o]).id]?r[e.id]=e:n[e.id]=e},Xu=function(){function t(t,e,n){if(this.props=e&&e.props,this.simple=!(!e||!e.simple),n)this.targets=Cu(t),this.elementStates=t,Yu(this);else{this.targets=ja(t);var r=e&&(!1===e.kill||e.batch&&!e.kill);Ua&&!r&&Ua._kill.push(this),this.update(r||!!Ua)}}var e=t.prototype;return e.update=function(t){var e=this;return this.elementStates=this.targets.map((function(t){return new Fu(t,e.props,e.simple)})),Yu(this),this.interrupt(t),this.recordInlineStyles(),this},e.clear=function(){return this.targets.length=this.elementStates.length=0,Yu(this),this},e.fit=function(t,e,n){for(var r,i,o=yu(this.elementStates.slice(0),!1,!0),s=(t||this).idLookup,a=0;a=0&&this.actions.splice(e,1),this},e.getState=function(t){var e=this,n=Ua,r=Ka;return Ua=this,this.state.clear(),this._kill.length=0,this.actions.forEach((function(n){n.vars.getState&&(n.states.length=0,Ka=n,n.state=n.vars.getState(n)),t&&n.states.forEach((function(t){return e.state.add(t)}))})),Ka=r,Ua=n,this.killConflicts(),this},e.animate=function(){var t,e,n=this,r=Ua,i=this.timeline,o=this.actions.length;for(Ua=this,i.clear(),this._abs.length=this._final.length=this._run.length=0,this.actions.forEach((function(t){t.vars.animate&&t.vars.animate(t);var e,n,r=t.vars.onEnter,i=t.vars.onLeave,o=t.targets;o&&o.length&&(r||i)&&(e=new Xu,t.states.forEach((function(t){return e.add(t)})),(n=e.compare(ju.getState(o))).enter.length&&r&&r(n.enter),n.leave.length&&i&&i(n.leave))})),ku(this._abs),this._run.forEach((function(t){return t()})),e=i.duration(),t=this._final.slice(0),i.add((function(){e<=i.time()&&(t.forEach((function(t){return t()})),Ja(n,"onComplete"))})),Ua=r;o--;)this.actions[o].vars.once&&this.actions[o].kill();return Ja(this,"onStart"),i.restart(),this},e.loadState=function(t){t||(t=function(){return 0});var e=[];return this.actions.forEach((function(n){if(n.vars.loadState){var r,i=function i(o){o&&(n.targets=o),~(r=e.indexOf(i))&&(e.splice(r,1),e.length||t())};e.push(i),n.vars.loadState(i)}})),e.length||t(),this},e.setState=function(){return this.actions.forEach((function(t){return t.targets=t.vars.setState&&t.vars.setState(t)})),this},e.killConflicts=function(t){return this.state.interrupt(t),this._kill.forEach((function(e){return e.interrupt(t)})),this},e.run=function(t,e){var n=this;return this!==Ua&&(t||this.getState(e),this.loadState((function(){n._killed||(n.setState(),n.animate())}))),this},e.clear=function(t){this.state.clear(),t||(this.actions.length=0)},e.getStateById=function(t){for(var e,n=this.actions.length;n--;)if(e=this.actions[n].getStateById(t))return e;return this.state.idLookup[t]&&this.state},e.kill=function(){this._killed=1,this.clear(),delete tu[this.id]},t}(),ju=function(){function t(){}return t.getState=function(e,n){var r=Au(e,n);return Ka&&Ka.states.push(r),n&&n.batch&&t.batch(n.batch).state.add(r),r},t.from=function(t,e){return"clearProps"in(e=e||{})||(e.clearProps=!0),zu(t,Au(e.targets||t.targets,{props:e.props||t.props,simple:e.simple,kill:!!e.kill}),e,-1)},t.to=function(t,e){return zu(t,Au(e.targets||t.targets,{props:e.props||t.props,simple:e.simple,kill:!!e.kill}),e,1)},t.fromTo=function(t,e,n){return zu(t,e,n)},t.fit=function(t,e,n){var r=n?gu(n,pu):{},i=n||r,o=i.absolute,s=i.scale,a=i.getVars,u=i.props,l=i.runBackwards,c=i.onComplete,h=i.simple,f=n&&n.fitChild&&lu(n.fitChild),p=Su(e,u,h,t),d=Su(t,0,h,p),g=u?ou[u]:uu;return u&&Eu(r,p.props),l&&(wu(d,g),"immediateRender"in r||(r.immediateRender=!0),r.onComplete=function(){bu(d),c&&c.apply(this,arguments)}),o&&Ou(d,p),r=Pu(d,p,s||f,u,f,r.duration||a?r:0),a?r:r.duration?Ha.to(d.element,r):null},t.makeAbsolute=function(t,e){return(t instanceof Xu?t:new Xu(t,e)).makeAbsolute()},t.batch=function(t){return t||(t="default"),tu[t]||(tu[t]=new qu(t))},t.killFlipsOf=function(t,e){(t instanceof Xu?t.targets:ja(t)).forEach((function(t){return t&&Nu(t._flip,!1!==e?1:2)}))},t.isFlipping=function(e){var n=t.getByTarget(e);return!!n&&n.isActive()},t.getByTarget=function(t){return(lu(t)||ru)._flip},t.getElementState=function(t,e){return new Fu(lu(t),e)},t.convertCoordinates=function(t,e,n){var r=qa(e,!0,!0).multiply(qa(t));return n?r.apply(n):r},t.register=function(t){if(Ga="undefined"!=typeof document&&document.body){Ha=t,Aa(Ga),ja=Ha.utils.toArray;var e=Ha.utils.snap(.1);Qa=function(t,n){return e(parseFloat(t)+n)}}},t}();ju.version="3.11.2","undefined"!=typeof window&&window.gsap&&window.gsap.registerPlugin(ju),Ti.registerPlugin(ha),Ti.registerPlugin(ju);const Hu=[];[...document.querySelectorAll(".item")].forEach((t=>{Hu.push(new u(t))}));const Uu={grid:document.querySelector(".switch__button--grid"),list:document.querySelector(".switch__button--list")},Ku={el:document.querySelector(".heading"),main:document.querySelector(".heading .heading__main")},Gu=document.querySelector(".grid");let Qu;const $u=()=>{const t=Hu.filter((t=>{return e=t.DOM.el,((n=e.getBoundingClientRect()).bottom>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)||n.top>=0&&n.top<=(window.innerHeight||document.documentElement.clientHeight))&&(n.right>=0&&n.right<=(window.innerWidth||document.documentElement.clientWidth)||n.left>=0&&n.left<=(window.innerWidth||document.documentElement.clientWidth));var e,n})),e=Hu.filter((e=>!t.includes(e)));return{allImages:Hu.map((t=>t.DOM.image)),allImagesInner:Hu.map((t=>t.DOM.imageInner)),inViewportItems:t,outViewportItems:e,inViewportImagesInner:t.map((t=>t.DOM.imageInner)),outViewportImagesInner:e.map((t=>t.DOM.imageInner)),inViewportDescription:t.map((t=>t.DOM.description)),outViewportDescription:e.map((t=>t.DOM.description)),inViewportTitlesInner:t.map((t=>t.DOM.titleInner)),outViewportTitlesInner:e.map((t=>t.DOM.titleInner)),inViewportNumbersInner:t.map((t=>t.DOM.numberInner)),outViewportNumbersInner:e.map((t=>t.DOM.numberInner))}},Zu=()=>{Uu.grid.addEventListener("click",(()=>{Uu.grid.classList.add("switch__button--hidden","switch__button--current"),Uu.list.classList.remove("switch__button--hidden","switch__button--current"),(()=>{document.body.classList.add("grid-open"),Qu.stop();const t=$u();let e=ha.getAll();for(let t=0;t{Uu.list.classList.add("switch__button--hidden","switch__button--current"),Uu.grid.classList.remove("switch__button--hidden","switch__button--current"),(()=>{document.body.classList.remove("grid-open"),Qu.start();const t=$u(),e=ju.getState([t.allImages,t.allImagesInner],{props:"opacity"});t.allImages.forEach(((t,e)=>{Hu[e].DOM.imageWrap.appendChild(t)}));let n=ha.getAll();for(let t=0;tnew Promise((e=>{a(document.querySelectorAll(t),{background:!0},e)})))(".item__image-inner").then((()=>{document.body.classList.remove("loading"),(()=>{Qu=new _({lerp:.1,smooth:!0});const t=e=>{Qu.raf(e),requestAnimationFrame(t)};requestAnimationFrame(t)})(),(()=>{for(const t of Hu)Ti.set(t.DOM.imageInner,{transformOrigin:"50% 0%"}),Ti.timeline({scrollTrigger:{trigger:t.DOM.el,start:"top bottom",end:"bottom top",scrub:!0}}).addLabel("start",0).to(t.DOM.imageInner,{ease:"none",scaleY:2.4,scaleX:1.2,opacity:0},"start").to([t.DOM.title,t.DOM.number],{ease:"none",yPercent:-150},"start").to([t.DOM.titleInner,t.DOM.numberInner],{scrollTrigger:{trigger:t.DOM.el,start:"top bottom",end:"top 20%",scrub:!0},ease:"expo.in",yPercent:-100},"start");let t=window.innerWidth;Ti.to(Ku.main,{scrollTrigger:{start:0,end:"max",scrub:!0},ease:"none",x:()=>-Ku.main.offsetWidth-(13.25*t/100+25*t/100+t/100)+t})})(),Zu()}))}(); -------------------------------------------------------------------------------- /dist/index.d73f7ad5.css: -------------------------------------------------------------------------------- 1 | *,:after,:before{box-sizing:border-box}:root{--color-text:#5e5754;--color-title:#944d3e;--color-bg:#080808;--color-link:#5e5754;--color-link-hover:#5e5754;--color-switch-bg:#f1e4dd;--color-switch:#000;--color-switch-active:#c1b7b1;--color-heading:#f1e4dd;font-size:18px}html{scroll-behavior:initial}html,body{width:100%;min-height:100%}body{color:var(--color-text);background-color:var(--color-bg);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-family:articulat-cf,-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}body #cdawrap{justify-self:start}.oh{position:relative;overflow:hidden}.oh__inner{will-change:transform;display:inline-block}.line{transform-origin:0;white-space:nowrap;will-change:transform}.js .loading:before,.js .loading:after{content:"";z-index:1000;position:fixed}.js .loading:before{width:100%;height:100%;background:var(--color-bg);top:0;left:0}.js .loading:after{width:60px;height:60px;opacity:.4;background:var(--color-link);border-radius:50%;margin:-30px 0 0 -30px;animation:.7s linear infinite alternate forwards loaderAnim;top:50%;left:50%}@keyframes loaderAnim{to{opacity:1;transform:scale(.5)}}a{color:var(--color-link);cursor:pointer;outline:none;text-decoration:none}a:hover{color:var(--color-link-hover);outline:none}a:focus{background:#d3d3d3;outline:none}a:focus:not(:focus-visible){background:0 0}a:focus-visible{background:0 0;outline:2px solid red}.unbutton{font:inherit;cursor:pointer;color:currentColor;background:0 0;border:0;margin:0;padding:0}.unbutton:focus{outline:none}.frame{color:var(--color-title);grid-gap:.5rem;grid-template:"title""prev""sponsor"/100%;justify-content:start;justify-items:start;margin-bottom:3rem;padding:1rem;display:grid;position:relative}.frame a:not(.frame__title-back){white-space:nowrap;position:relative;overflow:hidden}.frame a:not(.frame__title-back):before{content:"";height:1px;width:100%;transform-origin:0%;background:currentColor;transition:transform .3s;position:absolute;top:90%}.frame a:not(.frame__title-back):hover:before{transform-origin:100%;transform:scaleX(0)}.frame__title{grid-area:title;display:flex}.frame__title-main{margin:0;font-size:1rem;font-weight:400}.frame__title-back{align-items:flex-end;margin-bottom:.15rem;display:flex;position:relative}.frame__title-back span{display:none}.frame__title-back svg{fill:currentColor}.frame__prev{grid-area:prev}.heading{width:100%;z-index:200;pointer-events:none;mix-blend-mode:color-dodge;position:fixed;top:6rem;left:0}.heading__main{color:var(--color-heading);white-space:nowrap;text-transform:uppercase;will-change:transform;margin:1rem 0 0 39.25vw;font-size:clamp(2rem,10vw,5.5rem);font-weight:300;line-height:.8;display:inline-block}.heading__sub{color:var(--color-heading);margin-left:calc(39.25vw + 1rem);font-size:.85rem;display:inline-block}.switch{background:var(--color-switch-bg);z-index:100;border-radius:3rem;padding:1rem 1.5rem;display:flex;position:fixed;bottom:1.5rem;left:50%;transform:translate(-50%)}.switch:after{content:"";width:1px;height:calc(100% - 2rem);background:var(--color-switch-active);position:absolute;left:50%}.switch__button{fill:var(--color-switch);margin:0 .5rem;padding:0 .25rem;display:flex}.switch__button--current{fill:var(--color-switch-active);pointer-events:none}.switch__button svg{pointer-events:none}.content{padding:20vh 13.25vw 2.5rem;position:relative}.grid-open{height:100vh;overflow:hidden}.grid-open .content{pointer-events:none}.item{grid-gap:5vh;grid-template-columns:100%;grid-template-areas:"caption""img";place-content:center;margin:0 auto 20vh;display:grid}.item__image-wrap{width:100%;aspect-ratio:800/500;grid-area:img;justify-self:center}.item__image{width:100%;aspect-ratio:800/500;will-change:transform;position:relative;overflow:hidden}.item__image-inner{width:100%;height:100%;will-change:transform;background-size:cover}.item__caption{z-index:10;grid-area:caption;position:relative}.item__caption-title{white-space:nowrap;width:min-content;color:var(--color-title);margin:0;font-size:clamp(2rem,6vw,3.5rem);font-weight:300;line-height:1.2}.item__caption-description{max-width:200px;line-height:1.2}.item__caption-number{display:inline-block}.grid{width:100%;pointer-events:none;grid-gap:1rem;height:100vh;grid-template-columns:repeat(5,1fr);align-content:center;padding:2rem;display:grid;position:fixed;top:0;left:0}.grid-open .grid{pointer-events:auto}.grid .item__image{cursor:not-allowed}.grid .item__image:nth-child(1){grid-area:1/1}.grid .item__image:nth-child(2){grid-area:1/2}.grid .item__image:nth-child(3){grid-area:1/3}.grid .item__image:nth-child(4){grid-area:2/1}.grid .item__image:nth-child(5){grid-area:2/3}.grid .item__image:nth-child(6){grid-area:2/5}.grid .item__image:nth-child(7){grid-area:3/1}.grid .item__image:nth-child(8){grid-area:3/2}.grid .item__image:nth-child(9){grid-area:3/4}.grid .item__image:nth-child(10){grid-area:4/1}.grid .item__image:nth-child(11){grid-area:4/3}.grid .item__image:nth-child(12){grid-area:4/5}@media screen and (min-width:53em){.frame{grid-column-gap:2rem;grid-template:"title prev""sponsor."/auto auto}.item{grid-gap:1vw;grid-template-columns:25vw 1fr;grid-template-areas:"caption img"}.content{padding-top:40vh}.content .item__image{grid-column:2/span 2}.heading{top:0}.grid{max-width:950px;left:calc(50vw - 475px)}} -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | On-Scroll Animations and View Switch | Codrops

On-Scroll Animations & View Switch

Back to the article
Previous demo

Projects * Insomnia * Projects * Insomnia * Projects * Insomnia * Projects

1984 - 2022
01

Cast a spell

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

02

Corruption

In all energy exchanges, if no energy Enters or leaves an isolated system The entropy of that system increases

03

All their lives

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

04

You'll burn in hell

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

05

What we become

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

06

Take a bow

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

07

You bring death

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

08

You must pay

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

09

Feed the hex

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

10

Beg for their lives

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

11

For all your sins

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

12

Beholden

All natural and technological processes Proceed in such a way that the availability Of the remaining energy decreases

-------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OnScrollViewSwitch", 3 | "version": "1.0.0", 4 | "browserslist": "> 0.5%, last 2 versions, not dead", 5 | "description": "", 6 | "scripts": { 7 | "start": "parcel src/index.html --open", 8 | "clean": "rm -rf dist/*", 9 | "build:parcel": "parcel build src/index.html --no-content-hash --no-source-maps --public-url ./", 10 | "build": "npm run clean && npm run build:parcel" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git://github.com/codrops/OnScrollViewSwitch.git" 15 | }, 16 | "keywords": [], 17 | "author": "Codrops", 18 | "license": "MIT", 19 | "homepage": "https://tympanus.net/codrops", 20 | "bugs": { 21 | "url": "https://github.com/codrops/OnScrollViewSwitch/issues" 22 | }, 23 | "devDependencies": { 24 | "parcel": "^2.7.0" 25 | }, 26 | "dependencies": { 27 | "@studio-freight/lenis": "^0.2.8", 28 | "gsap": "^3.11.2", 29 | "imagesloaded": "^5.0.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/css/base.css: -------------------------------------------------------------------------------- 1 | *, 2 | *::after, 3 | *::before { 4 | box-sizing: border-box; 5 | } 6 | 7 | :root { 8 | font-size: 18px; 9 | --color-text: #5e5754; 10 | --color-title: #944d3e; 11 | --color-bg: #080808; 12 | --color-link: #5e5754; 13 | --color-link-hover: #5e5754; 14 | --color-switch-bg: #f1e4dd; 15 | --color-switch: #000; 16 | --color-switch-active: #c1b7b1; 17 | --color-heading: #f1e4dd; 18 | } 19 | 20 | html { 21 | scroll-behavior: initial; 22 | } 23 | 24 | html, 25 | body { 26 | width: 100%; 27 | min-height: 100%; 28 | } 29 | 30 | body { 31 | margin: 0; 32 | color: var(--color-text); 33 | background-color: var(--color-bg); 34 | font-family: articulat-cf, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif; 35 | -webkit-font-smoothing: antialiased; 36 | -moz-osx-font-smoothing: grayscale; 37 | } 38 | 39 | body #cdawrap { 40 | justify-self: start; 41 | } 42 | 43 | .oh { 44 | position: relative; 45 | overflow: hidden; 46 | } 47 | 48 | .oh__inner { 49 | will-change: transform; 50 | display: inline-block; 51 | } 52 | 53 | .line { 54 | transform-origin: 0; 55 | white-space: nowrap; 56 | will-change: transform; 57 | } 58 | 59 | /* Page Loader */ 60 | .js .loading::before, 61 | .js .loading::after { 62 | content: ''; 63 | position: fixed; 64 | z-index: 1000; 65 | } 66 | 67 | .js .loading::before { 68 | top: 0; 69 | left: 0; 70 | width: 100%; 71 | height: 100%; 72 | background: var(--color-bg); 73 | } 74 | 75 | .js .loading::after { 76 | top: 50%; 77 | left: 50%; 78 | width: 60px; 79 | height: 60px; 80 | margin: -30px 0 0 -30px; 81 | border-radius: 50%; 82 | opacity: 0.4; 83 | background: var(--color-link); 84 | animation: loaderAnim 0.7s linear infinite alternate forwards; 85 | 86 | } 87 | 88 | @keyframes loaderAnim { 89 | to { 90 | opacity: 1; 91 | transform: scale3d(0.5,0.5,1); 92 | } 93 | } 94 | 95 | a { 96 | text-decoration: none; 97 | color: var(--color-link); 98 | outline: none; 99 | cursor: pointer; 100 | } 101 | 102 | a:hover { 103 | color: var(--color-link-hover); 104 | outline: none; 105 | } 106 | 107 | /* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */ 108 | a:focus { 109 | /* Provide a fallback style for browsers 110 | that don't support :focus-visible */ 111 | outline: none; 112 | background: lightgrey; 113 | } 114 | 115 | a:focus:not(:focus-visible) { 116 | /* Remove the focus indicator on mouse-focus for browsers 117 | that do support :focus-visible */ 118 | background: transparent; 119 | } 120 | 121 | a:focus-visible { 122 | /* Draw a very noticeable focus style for 123 | keyboard-focus on browsers that do support 124 | :focus-visible */ 125 | outline: 2px solid red; 126 | background: transparent; 127 | } 128 | 129 | .unbutton { 130 | background: none; 131 | border: 0; 132 | padding: 0; 133 | margin: 0; 134 | font: inherit; 135 | cursor: pointer; 136 | color: currentColor; 137 | } 138 | 139 | .unbutton:focus { 140 | outline: none; 141 | } 142 | 143 | .frame { 144 | position: relative; 145 | color: var(--color-title); 146 | padding: 1rem; 147 | display: grid; 148 | grid-template-columns: 100%; 149 | grid-template-rows: auto auto auto; 150 | grid-template-areas: 'title' 'prev' 'sponsor'; 151 | justify-content: start; 152 | justify-items: start; 153 | margin-bottom: 3rem; 154 | grid-gap: 0.5rem; 155 | } 156 | 157 | .frame a:not(.frame__title-back) { 158 | white-space: nowrap; 159 | overflow: hidden; 160 | position: relative; 161 | } 162 | 163 | .frame a:not(.frame__title-back)::before { 164 | content: ''; 165 | height: 1px; 166 | width: 100%; 167 | background: currentColor; 168 | position: absolute; 169 | top: 90%; 170 | transition: transform 0.3s; 171 | transform-origin: 0% 50%; 172 | } 173 | 174 | .frame a:not(.frame__title-back):hover::before { 175 | transform: scaleX(0); 176 | transform-origin: 100% 50%; 177 | } 178 | 179 | .frame__title { 180 | grid-area: title; 181 | display: flex; 182 | } 183 | 184 | .frame__title-main { 185 | font-size: 1rem; 186 | margin: 0; 187 | font-weight: normal; 188 | } 189 | 190 | .frame__title-back { 191 | position: relative; 192 | display: flex; 193 | align-items: flex-end; 194 | margin-bottom: 0.15rem; 195 | } 196 | 197 | .frame__title-back span { 198 | display: none; 199 | } 200 | 201 | .frame__title-back svg { 202 | fill: currentColor; 203 | } 204 | 205 | .frame__prev { 206 | grid-area: prev; 207 | } 208 | 209 | .heading { 210 | position: fixed; 211 | top: 6rem; 212 | left: 0; 213 | width: 100%; 214 | z-index: 200; 215 | pointer-events: none; 216 | mix-blend-mode: color-dodge; 217 | } 218 | 219 | .heading__main { 220 | display: inline-block; 221 | color: var(--color-heading); 222 | font-weight: 300; 223 | font-size: clamp(2rem,10vw,5.5rem); 224 | white-space: nowrap; 225 | margin: 0; 226 | margin-left: calc(13.25vw + 25vw + 1vw); 227 | line-height: 0.8; 228 | text-transform: uppercase; 229 | margin-top: 1rem; 230 | will-change: transform; 231 | } 232 | 233 | .heading__sub { 234 | display: inline-block; 235 | margin-left: calc(13.25vw + 25vw + 1vw + 1rem); 236 | color: var(--color-heading); 237 | font-size: 0.85rem; 238 | } 239 | 240 | .switch { 241 | padding: 1rem 1.5rem; 242 | position: fixed; 243 | background: var(--color-switch-bg); 244 | bottom: 1.5rem; 245 | left: 50%; 246 | transform: translateX(-50%); 247 | display: flex; 248 | z-index: 100; 249 | border-radius: 3rem; 250 | } 251 | 252 | .switch::after { 253 | content: ''; 254 | width: 1px; 255 | height: calc(100% - 2rem); 256 | position: absolute; 257 | left: 50%; 258 | background: var(--color-switch-active); 259 | } 260 | 261 | .switch__button { 262 | display: flex; 263 | margin: 0 0.5rem; 264 | padding: 0 0.25rem; 265 | fill: var(--color-switch); 266 | } 267 | 268 | .switch__button--current { 269 | fill: var(--color-switch-active); 270 | pointer-events: none; 271 | } 272 | 273 | .switch__button svg { 274 | pointer-events: none; 275 | } 276 | 277 | .content { 278 | position: relative; 279 | padding: 20vh 13.25vw 2.5rem; 280 | } 281 | 282 | .grid-open { 283 | overflow: hidden; 284 | height: 100vh; 285 | } 286 | 287 | .grid-open .content { 288 | pointer-events: none; 289 | } 290 | 291 | .item { 292 | grid-gap: 5vh; 293 | grid-template-columns: 100%; 294 | align-content: center; 295 | justify-content: center; 296 | display: grid; 297 | grid-template-areas: 'caption' 'img'; 298 | margin: 0 auto 20vh; 299 | } 300 | 301 | .item__image-wrap { 302 | grid-area: img; 303 | width: 100%; 304 | aspect-ratio: 800/500; 305 | justify-self: center; 306 | } 307 | 308 | .item__image { 309 | width: 100%; 310 | aspect-ratio: 800/500; 311 | position: relative; 312 | overflow: hidden; 313 | will-change: transform; 314 | } 315 | 316 | .item__image-inner { 317 | width: 100%; 318 | height: 100%; 319 | background-size: cover; 320 | will-change: transform; 321 | } 322 | 323 | .item__caption { 324 | grid-area: caption; 325 | position: relative; 326 | z-index: 10; 327 | } 328 | 329 | .item__caption-title { 330 | white-space: nowrap; 331 | width: min-content; 332 | line-height: 1.2; 333 | font-size: clamp(2rem,6vw,3.5rem); 334 | font-weight: 300; 335 | margin: 0; 336 | color: var(--color-title); 337 | } 338 | 339 | .item__caption-description { 340 | max-width: 200px; 341 | line-height: 1.2; 342 | } 343 | 344 | .item__caption-number { 345 | display: inline-block; 346 | } 347 | 348 | .grid { 349 | width: 100%; 350 | pointer-events: none; 351 | position: fixed; 352 | top: 0; 353 | display: grid; 354 | grid-template-columns: repeat(5,1fr); 355 | grid-gap: 1rem; 356 | height: 100vh; 357 | left: 0; 358 | align-content: center; 359 | padding: 2rem; 360 | } 361 | 362 | .grid-open .grid { 363 | pointer-events: auto; 364 | } 365 | 366 | .grid .item__image { 367 | cursor: not-allowed; 368 | } 369 | 370 | .grid .item__image:nth-child(1) { 371 | grid-row: 1; 372 | grid-column: 1; 373 | } 374 | 375 | .grid .item__image:nth-child(2) { 376 | grid-row: 1; 377 | grid-column: 2; 378 | } 379 | 380 | .grid .item__image:nth-child(3) { 381 | grid-row: 1; 382 | grid-column: 3; 383 | } 384 | 385 | .grid .item__image:nth-child(3) { 386 | grid-row: 1; 387 | grid-column: 3; 388 | } 389 | 390 | .grid .item__image:nth-child(4) { 391 | grid-row: 2; 392 | grid-column: 1; 393 | } 394 | 395 | .grid .item__image:nth-child(5) { 396 | grid-row: 2; 397 | grid-column: 3; 398 | } 399 | 400 | .grid .item__image:nth-child(6) { 401 | grid-row: 2; 402 | grid-column: 5; 403 | } 404 | 405 | .grid .item__image:nth-child(7) { 406 | grid-row: 3; 407 | grid-column: 1; 408 | } 409 | 410 | .grid .item__image:nth-child(8) { 411 | grid-row: 3; 412 | grid-column: 2; 413 | } 414 | 415 | .grid .item__image:nth-child(9) { 416 | grid-row: 3; 417 | grid-column: 4; 418 | } 419 | 420 | .grid .item__image:nth-child(10) { 421 | grid-row: 4; 422 | grid-column: 1; 423 | } 424 | 425 | .grid .item__image:nth-child(11) { 426 | grid-row: 4; 427 | grid-column: 3; 428 | } 429 | 430 | .grid .item__image:nth-child(12) { 431 | grid-row: 4; 432 | grid-column: 5; 433 | } 434 | 435 | @media screen and (min-width: 53em) { 436 | .frame { 437 | grid-column-gap: 2rem; 438 | grid-template-columns: auto auto; 439 | grid-template-rows: auto auto; 440 | grid-template-areas: 'title prev' 'sponsor ...'; 441 | } 442 | .item { 443 | grid-gap: 1vw; 444 | grid-template-columns: 25vw 1fr; 445 | grid-template-areas: 'caption img' ; 446 | } 447 | .content { 448 | padding-top: 40vh; 449 | } 450 | .content .item__image { 451 | grid-column: 2 / span 2; 452 | } 453 | .heading { 454 | top: 0; 455 | } 456 | .grid { 457 | left: calc((100vw - 950px ) / 2); 458 | max-width: 950px; 459 | } 460 | } -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/favicon.ico -------------------------------------------------------------------------------- /src/img/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/1.jpg -------------------------------------------------------------------------------- /src/img/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/10.jpg -------------------------------------------------------------------------------- /src/img/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/11.jpg -------------------------------------------------------------------------------- /src/img/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/12.jpg -------------------------------------------------------------------------------- /src/img/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/2.jpg -------------------------------------------------------------------------------- /src/img/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/3.jpg -------------------------------------------------------------------------------- /src/img/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/4.jpg -------------------------------------------------------------------------------- /src/img/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/5.jpg -------------------------------------------------------------------------------- /src/img/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/6.jpg -------------------------------------------------------------------------------- /src/img/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/7.jpg -------------------------------------------------------------------------------- /src/img/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/8.jpg -------------------------------------------------------------------------------- /src/img/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/OnScrollViewSwitch/dd8941a1ea08d5892010fcf9bc7470607b024fc6/src/img/9.jpg -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | On-Scroll Animations and View Switch | Codrops 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |

On-Scroll Animations & View Switch

21 | 22 | Back to the article 23 | 24 | 25 | 26 |
27 | Previous demo 28 |
29 |
30 |

Projects * Insomnia * Projects * Insomnia * Projects * Insomnia * Projects

31 | 1984 - 2022 32 |
33 |
34 | 42 | 52 |
53 |
54 |
55 |
56 | 01 57 |

Cast a spell

58 |

59 | All natural and technological processes 60 | Proceed in such a way that the availability 61 | Of the remaining energy decreases

62 |
63 |
64 |
65 |
66 |
67 | 02 68 |

Corruption

69 |

70 | In all energy exchanges, if no energy 71 | Enters or leaves an isolated system 72 | The entropy of that system increases

73 |
74 |
75 |
76 |
77 |
78 | 03 79 |

All their lives

80 |

81 | All natural and technological processes 82 | Proceed in such a way that the availability 83 | Of the remaining energy decreases

84 |
85 |
86 |
87 |
88 |
89 | 04 90 |

You'll burn in hell

91 |

92 | All natural and technological processes 93 | Proceed in such a way that the availability 94 | Of the remaining energy decreases

95 |
96 |
97 |
98 |
99 |
100 | 05 101 |

What we become

102 |

103 | All natural and technological processes 104 | Proceed in such a way that the availability 105 | Of the remaining energy decreases

106 |
107 |
108 |
109 |
110 |
111 | 06 112 |

Take a bow

113 |

114 | All natural and technological processes 115 | Proceed in such a way that the availability 116 | Of the remaining energy decreases

117 |
118 |
119 |
120 |
121 |
122 | 07 123 |

You bring death

124 |

125 | All natural and technological processes 126 | Proceed in such a way that the availability 127 | Of the remaining energy decreases

128 |
129 |
130 |
131 |
132 |
133 | 08 134 |

You must pay

135 |

136 | All natural and technological processes 137 | Proceed in such a way that the availability 138 | Of the remaining energy decreases

139 |
140 |
141 |
142 |
143 |
144 | 09 145 |

Feed the hex

146 |

147 | All natural and technological processes 148 | Proceed in such a way that the availability 149 | Of the remaining energy decreases

150 |
151 |
152 |
153 |
154 |
155 | 10 156 |

Beg for their lives

157 |

158 | All natural and technological processes 159 | Proceed in such a way that the availability 160 | Of the remaining energy decreases

161 |
162 |
163 |
164 |
165 |
166 | 11 167 |

For all your sins

168 |

169 | All natural and technological processes 170 | Proceed in such a way that the availability 171 | Of the remaining energy decreases

172 |
173 |
174 |
175 |
176 |
177 | 12 178 |

Beholden

179 |

180 | All natural and technological processes 181 | Proceed in such a way that the availability 182 | Of the remaining energy decreases

183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /src/js/index.js: -------------------------------------------------------------------------------- 1 | import { preloadImages, isInViewport } from './utils'; 2 | import { Item } from './item'; 3 | import Lenis from '@studio-freight/lenis' 4 | import { gsap } from 'gsap'; 5 | import { ScrollTrigger } from 'gsap/ScrollTrigger'; 6 | gsap.registerPlugin(ScrollTrigger); 7 | import { Flip } from 'gsap/Flip'; 8 | gsap.registerPlugin(Flip); 9 | 10 | // Item instances (Item is the .content > figure.item) 11 | const items = []; 12 | [...document.querySelectorAll('.item')].forEach(item => { 13 | items.push(new Item(item)); 14 | }); 15 | 16 | // Toggle grid view 17 | const switchCtrl = { 18 | grid: document.querySelector('.switch__button--grid'), 19 | list: document.querySelector('.switch__button--list') 20 | }; 21 | 22 | // Text element that moves horizontally as we scroll 23 | const heading = { 24 | el: document.querySelector('.heading'), 25 | main: document.querySelector('.heading .heading__main'), 26 | } 27 | 28 | // Placeholder for the grid items (.item__image). We'll use the gsap FLIP plugin to move the "".item .item__image" inside the grid element 29 | const grid = document.querySelector('.grid'); 30 | 31 | // Lenis smooth scrolling 32 | let lenis; 33 | 34 | // Initialize Lenis smooth scrolling 35 | const initSmoothScrolling = () => { 36 | lenis = new Lenis({ 37 | lerp: 0.1, 38 | smooth: true, 39 | }); 40 | const scrollFn = (time) => { 41 | lenis.raf(time); 42 | requestAnimationFrame(scrollFn); 43 | }; 44 | requestAnimationFrame(scrollFn); 45 | }; 46 | 47 | // ScrollTrigger animations for scrolling 48 | const animateOnScroll = () => { 49 | 50 | for (const item of items) { 51 | 52 | gsap.set(item.DOM.imageInner, {transformOrigin: '50% 0%'}); 53 | 54 | gsap.timeline({ 55 | scrollTrigger: { 56 | trigger: item.DOM.el, 57 | start: 'top bottom', 58 | end: 'bottom top', 59 | scrub: true 60 | } 61 | }) 62 | .addLabel('start', 0) 63 | // scale up the inner image 64 | .to(item.DOM.imageInner, { 65 | ease: 'none', 66 | scaleY: 2.4, 67 | scaleX: 1.2, 68 | opacity: 0 69 | }, 'start') 70 | // translate the title and number 71 | .to([item.DOM.title, item.DOM.number], { 72 | ease: 'none', 73 | yPercent: -150, 74 | }, 'start') 75 | // translate the inner title/number (overflow is hidden so they get hidden) 76 | .to([item.DOM.titleInner, item.DOM.numberInner], { 77 | scrollTrigger: { 78 | trigger: item.DOM.el, 79 | start: 'top bottom', 80 | end: 'top 20%', 81 | scrub: true, 82 | }, 83 | ease: 'expo.in', 84 | yPercent: -100 85 | }, 'start') 86 | /* 87 | .to(item.DOM.description, { 88 | scrollTrigger: { 89 | trigger: item.DOM.el, 90 | start: 'top bottom', 91 | end: 'bottom top', 92 | scrub: true, 93 | }, 94 | ease: 'none', 95 | yPercent: 100 96 | }, 'start') 97 | */ 98 | 99 | } 100 | 101 | // animate the heading element as we scroll (horizontally) 102 | let windowWidth = window.innerWidth; 103 | gsap.to(heading.main, { 104 | scrollTrigger: { 105 | start: 0, 106 | end: 'max', 107 | scrub: true 108 | }, 109 | ease: 'none', 110 | x: () => -heading.main.offsetWidth - (13.25*windowWidth/100 + 25*windowWidth/100 + windowWidth/100) + windowWidth 111 | }); 112 | }; 113 | 114 | const showGrid = () => { 115 | 116 | document.body.classList.add('grid-open'); 117 | 118 | // stop the smooth scrolling 119 | lenis.stop(); 120 | 121 | // get the DOM elements that we'll work with 122 | const DOM = getDOMElements(); 123 | 124 | // Disable active ScrollTrigger instances 125 | let Alltrigger = ScrollTrigger.getAll(); 126 | for (let i = 0; i < Alltrigger.length; i++) { 127 | Alltrigger[i].disable(false); 128 | } 129 | 130 | // Use gsap flip for the animation 131 | // save the current state of the images 132 | const flipstate = Flip.getState(DOM.allImages); 133 | // put them inside the .grid element 134 | grid.append(...DOM.allImages); 135 | 136 | // gsap stagger properties 137 | const staggerConfig = { 138 | grid: 'auto', 139 | // the order goes from the first item inside the viewport 140 | from: DOM.inViewportItems.length ? items.indexOf(DOM.inViewportItems[0]) : 0, 141 | amount: 0.06, 142 | }; 143 | 144 | // Flip it 145 | Flip.from(flipstate, { 146 | duration: 0.7, 147 | ease: 'power3.inOut', 148 | scale: true, 149 | stagger: staggerConfig 150 | }) 151 | // Also reset scales applied to the inner images (items inside the viewport) 152 | .to(DOM.inViewportImagesInner, { 153 | duration: 0.7, 154 | ease: 'power3.inOut', 155 | scaleX: 1, 156 | scaleY: 1, 157 | opacity: 1, 158 | stagger: staggerConfig 159 | }, 0) 160 | // For the items outside of the viewport, simply reset the scales with no animation 161 | .set(DOM.outViewportImagesInner, { 162 | scaleX: 1, 163 | scaleY: 1, 164 | opacity: 1 165 | }, 0) 166 | // hide the titles and numbers inner elments by translating them up 167 | .to([DOM.inViewportTitlesInner, DOM.inViewportNumbersInner], { 168 | duration: 0.4, 169 | ease: 'power3.inOut', 170 | yPercent: -100, 171 | opacity: 0 172 | }, 0) 173 | // hide description 174 | .to(DOM.inViewportDescription, { 175 | duration: 0.4, 176 | ease: 'power3.inOut', 177 | opacity: 0 178 | }, 0) 179 | // For all the items outside the viewport, simply set opacity to 0 180 | .set([DOM.outViewportTitlesInner, DOM.outViewportNumbersInner, DOM.outViewportDescription], { 181 | opacity: 0, 182 | }, 0) 183 | // hide the heading element 184 | .to(heading.el, { 185 | duration: 0.7, 186 | ease: 'power3.inOut', 187 | yPercent: -100, 188 | x: -100 189 | }, 0); 190 | 191 | }; 192 | 193 | const hideGrid = () => { 194 | 195 | document.body.classList.remove('grid-open'); 196 | 197 | // restart the smooth scrolling 198 | lenis.start(); 199 | 200 | // get the DOM elements that we'll work with 201 | const DOM = getDOMElements(); 202 | 203 | const flipstate = Flip.getState([DOM.allImages, DOM.allImagesInner], {props: 'opacity'}); 204 | 205 | DOM.allImages.forEach((image,pos) => { 206 | items[pos].DOM.imageWrap.appendChild(image) 207 | }); 208 | 209 | // Enable ScrollTrigger instances 210 | let Alltrigger = ScrollTrigger.getAll(); 211 | for (let i = 0; i < Alltrigger.length; i++) { 212 | Alltrigger[i].enable(false); 213 | } 214 | 215 | Flip.from(flipstate, { 216 | duration: 0.7, 217 | ease: 'power3.inOut', 218 | scale: true, 219 | }) 220 | .to([DOM.inViewportTitlesInner, DOM.inViewportNumbersInner, DOM.inViewportDescription], { 221 | duration: 0.4, 222 | ease: 'power3.inOut', 223 | startAt: {opacity: 0}, 224 | opacity: 1 225 | }, 0) 226 | .set([DOM.outViewportTitlesInner, DOM.outViewportNumbersInner, DOM.outViewportDescription], { 227 | opacity: 1 228 | }, 0) 229 | .to(heading.el, { 230 | duration: 0.7, 231 | ease: 'power3.inOut', 232 | yPercent: 0, 233 | x: 0 234 | }, 0); 235 | 236 | } 237 | 238 | // Returns some DOM elements that are needed for showing/hiding the grid 239 | const getDOMElements = () => { 240 | const inViewportItems = items.filter(item => isInViewport(item.DOM.el)); 241 | const outViewportItems = items.filter(n => !inViewportItems.includes(n)); 242 | 243 | return { 244 | allImages: items.map(item => item.DOM.image), 245 | allImagesInner: items.map(item => item.DOM.imageInner), 246 | inViewportItems: inViewportItems, 247 | outViewportItems: outViewportItems, 248 | inViewportImagesInner: inViewportItems.map(item => item.DOM.imageInner), 249 | outViewportImagesInner: outViewportItems.map(item => item.DOM.imageInner), 250 | inViewportDescription: inViewportItems.map(item => item.DOM.description), 251 | outViewportDescription: outViewportItems.map(item => item.DOM.description), 252 | inViewportTitlesInner: inViewportItems.map(item => item.DOM.titleInner), 253 | outViewportTitlesInner: outViewportItems.map(item => item.DOM.titleInner), 254 | inViewportNumbersInner: inViewportItems.map(item => item.DOM.numberInner), 255 | outViewportNumbersInner: outViewportItems.map(item => item.DOM.numberInner) 256 | }; 257 | } 258 | 259 | // Initialize the events 260 | const initEvents = () => { 261 | 262 | // show grid ctrl click 263 | switchCtrl.grid.addEventListener('click', () => { 264 | switchCtrl.grid.classList.add('switch__button--hidden', 'switch__button--current'); 265 | switchCtrl.list.classList.remove('switch__button--hidden', 'switch__button--current'); 266 | showGrid(); 267 | }); 268 | // hide grid ctrl click 269 | switchCtrl.list.addEventListener('click', () => { 270 | switchCtrl.list.classList.add('switch__button--hidden', 'switch__button--current'); 271 | switchCtrl.grid.classList.remove('switch__button--hidden', 'switch__button--current'); 272 | hideGrid(); 273 | }); 274 | 275 | }; 276 | 277 | // Preload images 278 | preloadImages('.item__image-inner').then(() => { 279 | document.body.classList.remove('loading'); 280 | 281 | initSmoothScrolling(); 282 | animateOnScroll(); 283 | initEvents(); 284 | }); -------------------------------------------------------------------------------- /src/js/item.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Class representing an Item element (.item) 3 | */ 4 | export class Item { 5 | // DOM elements 6 | DOM = { 7 | // main element (.item) 8 | el: null, 9 | // caption (.item__caption) 10 | caption : null, 11 | // imageWrap (.item__image-wrap) 12 | imageWrap: null, 13 | // image (.item__image) 14 | image: null, 15 | // imageInner (.item__image > .item__image-inner) 16 | imageInner: null, 17 | // title (.item__caption-title) 18 | title: null, 19 | // titleInner (.item__caption-title > .oh__inner) 20 | titleInner: null, 21 | // number (.item__caption-number) 22 | number: null, 23 | // numberInner (.item__caption-number > .oh__inner) 24 | numberInner: null, 25 | // description (.item__caption-description) 26 | description: null, 27 | }; 28 | 29 | /** 30 | * Constructor. 31 | * @param {Element} DOM_el - main element (.item) 32 | */ 33 | constructor(DOM_el) { 34 | this.DOM.el = DOM_el; 35 | this.DOM.caption = this.DOM.el.querySelector('.item__caption'); 36 | this.DOM.imageWrap = this.DOM.el.querySelector('.item__image-wrap'); 37 | this.DOM.image = this.DOM.el.querySelector('.item__image'); 38 | this.DOM.imageInner = this.DOM.image.querySelector('.item__image-inner'); 39 | this.DOM.title = this.DOM.el.querySelector('.item__caption-title'); 40 | this.DOM.titleInner = this.DOM.title.querySelector('.oh__inner'); 41 | this.DOM.number = this.DOM.el.querySelector('.item__caption-number'); 42 | this.DOM.numberInner = this.DOM.number.querySelector('.oh__inner'); 43 | this.DOM.description = this.DOM.el.querySelector('.item__caption-description'); 44 | } 45 | } -------------------------------------------------------------------------------- /src/js/preloader.js: -------------------------------------------------------------------------------- 1 | const imagesLoaded = require('imagesloaded'); 2 | 3 | const body = document.body; 4 | export const preloader = selector => { 5 | return new Promise(resolve => { 6 | 7 | const imgwrap = document.createElement('div'); 8 | imgwrap.style.visibility = 'hidden'; 9 | body.appendChild(imgwrap); 10 | 11 | [...document.querySelectorAll(selector)].forEach(el => { 12 | const imgEl = document.createElement('img'); 13 | imgEl.style.width = 0; 14 | imgEl.src = el.getAttributeNS('http://www.w3.org/1999/xlink', 'href'); 15 | imgEl.className = 'preload'; 16 | imgwrap.appendChild(imgEl); 17 | }); 18 | 19 | imagesLoaded(document.querySelectorAll('.preload'), () => { 20 | imgwrap.parentNode.removeChild(imgwrap); 21 | body.classList.remove('loading'); 22 | resolve(); 23 | }); 24 | 25 | }); 26 | }; -------------------------------------------------------------------------------- /src/js/utils.js: -------------------------------------------------------------------------------- 1 | const imagesLoaded = require('imagesloaded'); 2 | 3 | /** 4 | * Preload images 5 | * @param {String} selector - Selector/scope from where images need to be preloaded. Default is 'img' 6 | */ 7 | const preloadImages = (selector = 'img') => { 8 | return new Promise((resolve) => { 9 | imagesLoaded(document.querySelectorAll(selector), {background: true}, resolve); 10 | }); 11 | }; 12 | 13 | /** 14 | * Wraps the elements of an array. 15 | * @param {Array} arr - the array of elements to be wrapped 16 | * @param {String} wrapType - the type of the wrap element ('div', 'span' etc) 17 | * @param {String} wrapClass - the wrap class(es) 18 | */ 19 | const wrapLines = (arr, wrapType, wrapClass) => { 20 | arr.forEach(el => { 21 | const wrapEl = document.createElement(wrapType); 22 | wrapEl.classList = wrapClass; 23 | el.parentNode.appendChild(wrapEl); 24 | wrapEl.appendChild(el); 25 | }); 26 | } 27 | 28 | /** 29 | * Checks if an element is in the viewport 30 | * @param {Element} elem - the element to be checked 31 | */ 32 | const isInViewport = elem => { 33 | var bounding = elem.getBoundingClientRect(); 34 | return ( 35 | (bounding.bottom >= 0 && bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) || bounding.top >= 0 && bounding.top <= (window.innerHeight || document.documentElement.clientHeight)) && 36 | (bounding.right >= 0 && bounding.right <= (window.innerWidth || document.documentElement.clientWidth) || bounding.left >= 0 && bounding.left <= (window.innerWidth || document.documentElement.clientWidth)) 37 | ); 38 | }; 39 | 40 | export { 41 | preloadImages, 42 | wrapLines, 43 | isInViewport, 44 | }; --------------------------------------------------------------------------------