├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── css └── base.css ├── favicon.ico ├── img ├── 1.jpg ├── 10.jpg ├── 11.jpg ├── 12.jpg ├── 13.jpg ├── 14.jpg ├── 15.jpg ├── 16.jpg ├── 17.jpg ├── 18.jpg ├── 19.jpg ├── 2.jpg ├── 20.jpg ├── 21.jpg ├── 22.jpg ├── 23.jpg ├── 24.jpg ├── 3.jpg ├── 4.jpg ├── 5.jpg ├── 6.jpg ├── 7.jpg ├── 8.jpg ├── 9.jpg ├── feat1.jpg ├── feat2.jpg └── feat2_small.jpg ├── index.html └── js ├── Flip.min.js ├── gsap.min.js ├── imagesloaded.pkgd.min.js ├── index.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 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2009 - 2023 [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 | # Grid View Switch Animation 2 | 3 | A concept for a view switch animation from grid to slideshow. Proof-of-concept. 4 | 5 | ![Grid View Switch Animation](https://tympanus.net/codrops/wp-content/uploads/2023/04/pixeltransition.jpg) 6 | 7 | [Article on Codrops](https://tympanus.net/codrops/?p=71437) 8 | 9 | [Demo](http://tympanus.net/Development/GridViewSwitch/) 10 | 11 | 12 | ## Installation 13 | 14 | Run this demo on a [local server](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Tools_and_setup/set_up_a_local_testing_server). 15 | 16 | ## Credits 17 | 18 | - Images by [cottonbro](https://www.instagram.com/cottonbro/) 19 | 20 | ## Misc 21 | 22 | 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/) 23 | 24 | ## License 25 | [MIT](LICENSE) 26 | 27 | Made with :blue_heart: by [Codrops](http://www.codrops.com) 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /css/base.css: -------------------------------------------------------------------------------- 1 | *, *::after, *::before { 2 | box-sizing: border-box; 3 | } 4 | 5 | :root { 6 | font-size: 16px; 7 | --color-text: rgba(0,0,0,0.8); 8 | --color-bg: #9f8b67; 9 | --color-link: #ebf47d; 10 | --color-link-hover: #000; 11 | --color-title: rgba(0,0,0,0.85); 12 | --color-switch-bg: #f1ff85; 13 | --color-switch: #000; 14 | --color-switch-active: #c0c867; 15 | } 16 | 17 | html, body { 18 | width: 100%; 19 | height: 100vh; 20 | overflow: hidden; 21 | margin: 0; 22 | } 23 | 24 | body { 25 | font-weight: 500; 26 | color: var(--color-text); 27 | background-color: var(--color-bg); 28 | font-family: "owners-wide", sans-serif; 29 | -webkit-font-smoothing: antialiased; 30 | -moz-osx-font-smoothing: grayscale; 31 | --grid-item-width: 50vw; 32 | --grid-item-height: 100vh; 33 | } 34 | 35 | /* Page Loader */ 36 | .js .loading::before, .js .loading::after { 37 | content: ''; 38 | position: fixed; 39 | z-index: 5000; 40 | } 41 | 42 | .js .loading::before { 43 | top: 0; 44 | left: 0; 45 | width: 100%; 46 | height: 100%; 47 | background: var(--color-bg); 48 | } 49 | 50 | .js .loading::after { 51 | top: 50%; 52 | left: 50%; 53 | width: 60px; 54 | height: 60px; 55 | margin: -30px 0 0 -30px; 56 | border-radius: 50%; 57 | opacity: 0.4; 58 | background: var(--color-link); 59 | animation: loaderAnim 0.7s linear infinite alternate forwards; 60 | } 61 | 62 | @keyframes loaderAnim { 63 | to { 64 | opacity: 1; 65 | transform: scale3d(0.5, 0.5, 1); 66 | } 67 | 68 | } 69 | 70 | a { 71 | text-decoration: none; 72 | color: var(--color-link); 73 | outline: none; 74 | } 75 | 76 | a:hover { 77 | color: var(--color-link-hover); 78 | outline: none; 79 | } 80 | 81 | /* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */ 82 | a:focus { 83 | 84 | /* Provide a fallback style for browsers 85 | that don't support :focus-visible */ 86 | outline: none; 87 | background: lightgrey; 88 | } 89 | 90 | a:focus:not(:focus-visible) { 91 | 92 | /* Remove the focus indicator on mouse-focus for browsers 93 | that do support :focus-visible */ 94 | background: transparent; 95 | } 96 | 97 | a:focus-visible { 98 | 99 | /* Draw a very noticeable focus style for 100 | keyboard-focus on browsers that do support 101 | :focus-visible */ 102 | outline: 2px solid red; 103 | background: transparent; 104 | } 105 | 106 | .unbutton { 107 | background: none; 108 | border: 0; 109 | padding: 0; 110 | margin: 0; 111 | font: inherit; 112 | } 113 | 114 | .unbutton:focus { 115 | outline: none; 116 | } 117 | 118 | .oh { 119 | position: relative; 120 | overflow: hidden; 121 | } 122 | 123 | .frame { 124 | padding: 1rem; 125 | display: grid; 126 | grid-template-columns: 100%; 127 | justify-items: start; 128 | grid-template-areas: 'heading' 'sponsor' 'title' 'prev'; 129 | grid-template-rows: 3.5rem auto; 130 | justify-content: start; 131 | align-items: start; 132 | position: fixed; 133 | top: 0; 134 | left: 0; 135 | width: 100%; 136 | grid-gap: 0.5rem; 137 | z-index: 1000; 138 | text-transform: uppercase; 139 | pointer-events: none; 140 | } 141 | 142 | .frame a, 143 | .frame button { 144 | pointer-events: auto; 145 | } 146 | 147 | .frame a:not(.frame__title-back) { 148 | white-space: nowrap; 149 | overflow: hidden; 150 | position: relative; 151 | display: inline-block; 152 | } 153 | 154 | .frame a:not(.frame__title-back)::before { 155 | content: ''; 156 | height: 1px; 157 | width: 100%; 158 | background: currentColor; 159 | position: absolute; 160 | top: 90%; 161 | transition: transform 0.3s; 162 | transform-origin: 0% 50%; 163 | } 164 | 165 | .frame a:not(.frame__title-back):hover::before { 166 | transform: scaleX(0); 167 | transform-origin: 100% 50%; 168 | } 169 | 170 | .frame__heading { 171 | grid-area: heading; 172 | align-self: center; 173 | text-transform: capitalize; 174 | font-family: antonia-variable, sans-serif; 175 | font-size: 2rem; 176 | font-variation-settings: "opsz" 48, "wght" 800; 177 | } 178 | 179 | body #cdawrap { 180 | align-self: center; 181 | display: flex; 182 | gap: 0.5rem; 183 | } 184 | 185 | .frame__title { 186 | grid-area: title; 187 | display: flex; 188 | } 189 | 190 | .frame__title-main { 191 | font-size: inherit; 192 | margin: 0; 193 | font-weight: inherit; 194 | } 195 | 196 | .frame__title-back { 197 | position: relative; 198 | display: flex; 199 | align-items: center; 200 | } 201 | 202 | .frame__title-back span { 203 | display: none; 204 | } 205 | 206 | .frame__title-back svg { 207 | fill: currentColor; 208 | } 209 | 210 | .frame__prev { 211 | grid-area: prev; 212 | } 213 | 214 | .columns { 215 | width: 100%; 216 | height: 100vh; 217 | position: relative; 218 | display: flex; 219 | justify-content: center; 220 | align-items: center; 221 | transform: scale(0.4); 222 | } 223 | 224 | .column { 225 | position: relative; 226 | display: grid; 227 | } 228 | 229 | .column-inner { 230 | position: relative; 231 | will-change: transform; 232 | } 233 | 234 | .column__item { 235 | margin: 0; 236 | position: relative; 237 | z-index: 1; 238 | width: var(--grid-item-width); 239 | height: var(--grid-item-height); 240 | } 241 | 242 | .column__item-imgwrap { 243 | width: 100%; 244 | height: 100%; 245 | position: relative; 246 | overflow: hidden; 247 | } 248 | 249 | .column__item-img { 250 | width: 100%; 251 | height: 100%; 252 | background-size: cover; 253 | background-position: 50% 20%; 254 | backface-visibility: hidden; 255 | } 256 | 257 | .flip .column__item-img { 258 | background-size: auto 100%; 259 | } 260 | 261 | .content { 262 | pointer-events: none; 263 | position: fixed; 264 | width: 100%; 265 | height: 100vh; 266 | top: 0; 267 | left: 0; 268 | display: grid; 269 | grid-template-rows: 1fr auto; 270 | } 271 | 272 | .content--current { 273 | pointer-events: auto; 274 | } 275 | 276 | .content__item { 277 | width: 100%; 278 | height: 100%; 279 | position: absolute; 280 | top: 0; 281 | left: 0; 282 | } 283 | 284 | .content__title { 285 | opacity: 0; 286 | text-transform: uppercase; 287 | align-self: center; 288 | margin: 0; 289 | position: relative; 290 | font-weight: 500; 291 | padding: 0 0.5rem; 292 | width: 100%; 293 | display: flex; 294 | pointer-events: none; 295 | justify-content: center; 296 | gap: 3vw; 297 | align-items: start; 298 | color: var(--color-title); 299 | font-size: clamp(2rem, 13.85vw, 14rem); 300 | } 301 | 302 | .content__title span { 303 | display: block; 304 | line-height: 0.65; 305 | padding-top: 0.075em; 306 | } 307 | 308 | .content__title > span:nth-child(2) { 309 | margin-top: 0.35em; 310 | } 311 | 312 | .content__nav { 313 | opacity: 0; 314 | width: 100%; 315 | position: relative; 316 | display: flex; 317 | gap: 0.5rem; 318 | padding: 1rem 1rem 6rem; 319 | justify-content: center; 320 | } 321 | 322 | .content__nav-item { 323 | cursor: not-allowed; 324 | width: 50px; 325 | border-radius: 5px; 326 | max-width: 90px; 327 | aspect-ratio: 1.3; 328 | background-size: cover; 329 | background-position: 50% 50%; 330 | place-items: center; 331 | font-size: 2rem; 332 | line-height: 0; 333 | font-weight: 400; 334 | display: none; 335 | } 336 | 337 | .content__nav-item:nth-child(-n+3), 338 | .content__nav-item:last-child { 339 | display: grid; 340 | } 341 | 342 | .content__nav-item--current { 343 | border: 2px solid var(--color-switch-bg); 344 | } 345 | 346 | .content__nav-item--more { 347 | aspect-ratio: unset; 348 | width: auto; 349 | padding: 0 0.5rem; 350 | } 351 | 352 | .switch { 353 | background: var(--color-switch-bg); 354 | z-index: 10; 355 | border-radius: 3rem; 356 | padding: 1.2rem 2rem 1rem; 357 | display: flex; 358 | position: fixed; 359 | bottom: 1rem; 360 | gap: 1.5rem; 361 | left: 50%; 362 | transform: translate(-50%); 363 | align-items: center; 364 | border: 2px solid #000; 365 | } 366 | 367 | .switch__text { 368 | white-space: nowrap; 369 | line-height: 1; 370 | display: none; 371 | } 372 | 373 | .switch__button { 374 | display: grid; 375 | place-items: center; 376 | fill: var(--color-switch); 377 | margin: 0; 378 | cursor: pointer; 379 | } 380 | 381 | .switch__button--current { 382 | fill: var(--color-switch-active); 383 | pointer-events: none; 384 | cursor: default; 385 | } 386 | 387 | .switch__button svg { 388 | pointer-events: none 389 | } 390 | 391 | @media screen and (min-width:53em) { 392 | .frame { 393 | align-content: space-between; 394 | height: 100%; 395 | grid-gap: 1rem; 396 | padding: 1.5rem; 397 | grid-template-columns: auto 1fr 1fr; 398 | grid-template-areas: 'heading ... sponsor' 'title prev ...'; 399 | } 400 | .content__title { 401 | padding: 0; 402 | } 403 | .content__nav { 404 | gap: 1rem; 405 | padding: 1.5rem; 406 | justify-content: flex-end; 407 | } 408 | .content__nav-item { 409 | display: grid; 410 | width: 7vw; 411 | border-radius: 0.5vw; 412 | } 413 | .switch { 414 | bottom: auto; 415 | top: 1.5rem; 416 | } 417 | .switch__text { 418 | display: block; 419 | } 420 | 421 | } 422 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/favicon.ico -------------------------------------------------------------------------------- /img/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/1.jpg -------------------------------------------------------------------------------- /img/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/10.jpg -------------------------------------------------------------------------------- /img/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/11.jpg -------------------------------------------------------------------------------- /img/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/12.jpg -------------------------------------------------------------------------------- /img/13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/13.jpg -------------------------------------------------------------------------------- /img/14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/14.jpg -------------------------------------------------------------------------------- /img/15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/15.jpg -------------------------------------------------------------------------------- /img/16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/16.jpg -------------------------------------------------------------------------------- /img/17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/17.jpg -------------------------------------------------------------------------------- /img/18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/18.jpg -------------------------------------------------------------------------------- /img/19.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/19.jpg -------------------------------------------------------------------------------- /img/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/2.jpg -------------------------------------------------------------------------------- /img/20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/20.jpg -------------------------------------------------------------------------------- /img/21.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/21.jpg -------------------------------------------------------------------------------- /img/22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/22.jpg -------------------------------------------------------------------------------- /img/23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/23.jpg -------------------------------------------------------------------------------- /img/24.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/24.jpg -------------------------------------------------------------------------------- /img/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/3.jpg -------------------------------------------------------------------------------- /img/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/4.jpg -------------------------------------------------------------------------------- /img/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/5.jpg -------------------------------------------------------------------------------- /img/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/6.jpg -------------------------------------------------------------------------------- /img/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/7.jpg -------------------------------------------------------------------------------- /img/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/8.jpg -------------------------------------------------------------------------------- /img/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/9.jpg -------------------------------------------------------------------------------- /img/feat1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/feat1.jpg -------------------------------------------------------------------------------- /img/feat2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/feat2.jpg -------------------------------------------------------------------------------- /img/feat2_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/GridViewSwitch/530cc792a07daec6ce84c7988c02ee5a12aa9ebd/img/feat2_small.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Grid View Switch Animation | Codrops 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |

Grid View Switch

21 | 22 | Back to the article 23 | 24 | 25 | 26 |
27 |
Linenique
28 | Previous demo 29 |
30 | Choose your view 31 | 32 | 33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 | 224 |
225 |

226 | Nadia 227 | Buriki 228 |

229 | 239 |
240 |
241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | -------------------------------------------------------------------------------- /js/Flip.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Flip 3.11.5 3 | * https://greensock.com 4 | * 5 | * @license Copyright 2023, GreenSock. All rights reserved. 6 | * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership. 7 | * @author: Jack Doyle, jack@greensock.com 8 | */ 9 | 10 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function p(t){var e=t.ownerDocument||t;!(w in t.style)&&"msTransform"in t.style&&(k=(w="msTransform")+"Origin");for(;e.parentNode&&(e=e.parentNode););if(y=window,d=new M,e){r=(g=e).documentElement,b=e.body,(a=g.createElementNS("http://www.w3.org/2000/svg","g")).style.transform="none";var i=e.createElement("div"),n=e.createElement("div");b.appendChild(i),i.appendChild(n),i.style.position="static",i.style[w]="translate3d(0,0,1px)",m=n.offsetParent!==i,b.removeChild(i)}return e}function t(){return y.pageYOffset||g.scrollTop||r.scrollTop||b.scrollTop||0}function u(){return y.pageXOffset||g.scrollLeft||r.scrollLeft||b.scrollLeft||0}function v(t){return t.ownerSVGElement||("svg"===(t.tagName+"").toLowerCase()?t:null)}function x(t,e){if(t.parentNode&&(g||p(t))){var i=v(t),n=i?i.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",r=i?e?"rect":"g":"div",a=2!==e?0:100,s=3===e?100:0,o="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",l=g.createElementNS?g.createElementNS(n.replace(/^https/,"http"),r):g.createElement(r);return e&&(i?(f=f||x(t),l.setAttribute("width",.01),l.setAttribute("height",.01),l.setAttribute("transform","translate("+a+","+s+")"),f.appendChild(l)):(c||((c=x(t)).style.cssText=o),l.style.cssText=o+"width:0.1px;height:0.1px;top:"+s+"px;left:"+a+"px",c.appendChild(l))),l}throw"Need document and parent."}function z(t){var e,i=t.getCTM();return i||(e=t.style[w],t.style[w]="none",t.appendChild(a),i=a.getCTM(),t.removeChild(a),e?t.style[w]=e:t.style.removeProperty(w.replace(/([A-Z])/g,"-$1").toLowerCase())),i||d.clone()}function A(t,e){var i,n,r,a,s,o,l=v(t),u=t===l,p=l?C:E,h=t.parentNode;if(t===y)return t;if(p.length||p.push(x(t,1),x(t,2),x(t,3)),i=l?f:c,l)u?(a=-(r=z(t)).e/r.a,s=-r.f/r.d,n=d):t.getBBox?(r=t.getBBox(),a=(n=(n=t.transform?t.transform.baseVal:{}).numberOfItems?1=o;t&&!n&&ha(H,!x),L&&X(e,L,t?"remove":"add")})},k&&(S=H.filter(function(t){return!t.sd&&!t.a.isVisible&&t.b.isVisible}).map(function(t){return t.a.element})),tt?(S&&(y=tt._abs).push.apply(y,ka(H,S)),tt._run.push(m)):(S&&la(ka(H,S)),m());var K=tt?tt.timeline:j;return K.revert=function(){return lt(K,1)},K}function Da(t){for(var e,i=t.idLookup={},n=t.alt={},r=t.elementStates,a=r.length;a--;)i[(e=r[a]).id]?n[e.id]=e:i[e.id]=e}var I,Q,tt,s,o,P,T,l,n,h=1,F={},O=180/Math.PI,N=Math.PI/180,D={},Y={},et={},it=S("onStart,onUpdate,onComplete,onReverseComplete,onInterrupt"),nt=S("transform,transformOrigin,width,height,position,top,left,opacity,zIndex,maxWidth,maxHeight,minWidth,minHeight"),rt={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},at={zIndex:1,simple:1,clearProps:1,scale:1,absolute:1,fitChild:1,getVars:1,props:1},st={},j="paddingTop,paddingRight,paddingBottom,paddingLeft,gridArea,transition".split(","),R=function _parseElementState(t,e,i,n){return t instanceof pt?t:t instanceof ut?function _findElStateInState(t,e){return e&&t.idLookup[R(e).id]||t.elementStates[0]}(t,n):new pt("string"==typeof t?V(t)||console.warn(t+" not found"):t,e,i)},ot=function _fit(t,e,i,n,r,a){var s,o,l,u,p,h,c,f=t.element,d=t.cache,m=t.parent,g=t.x,v=t.y,y=e.width,x=e.height,b=e.scaleX,w=e.scaleY,S=e.rotation,k=e.bounds,_=a&&T&&T(f,"transform"),C=t,V=e.matrix,E=V.e,M=V.f,B=t.bounds.width!==k.width||t.bounds.height!==k.height||t.scaleX!==b||t.scaleY!==w||t.rotation!==S,F=!B&&t.simple&&e.simple&&!r;return F||!m?(b=w=1,S=s=0):(h=(p=function _getInverseGlobalMatrix(t){var e=t._gsap||Q.core.getCache(t);return e.gmCache===Q.ticker.frame?e.gMatrix:(e.gmCache=Q.ticker.frame,e.gMatrix=getGlobalMatrix(t,!0,!1,!0))}(m)).clone().multiply(e.ctm?e.matrix.clone().multiply(e.ctm):e.matrix),S=W(Math.atan2(h.b,h.a)*O),s=W(Math.atan2(h.c,h.d)*O+S)%360,b=Math.sqrt(Math.pow(h.a,2)+Math.pow(h.b,2)),w=Math.sqrt(Math.pow(h.c,2)+Math.pow(h.d,2))*Math.cos(s*N),r&&(r=I(r)[0],u=Q.getProperty(r),c=r.getBBox&&"function"==typeof r.getBBox&&r.getBBox(),C={scaleX:u("scaleX"),scaleY:u("scaleY"),width:c?c.width:Math.ceil(parseFloat(u("width","px"))),height:c?c.height:parseFloat(u("height","px"))}),d.rotation=S+"deg",d.skewX=s+"deg"),i?(b*=y!==C.width&&C.width?y/C.width:1,w*=x!==C.height&&C.height?x/C.height:1,d.scaleX=b,d.scaleY=w):(y=P(y*b/C.scaleX,0),x=P(x*w/C.scaleY,0),f.style.width=y+"px",f.style.height=x+"px"),n&&pa(f,e.props),F||!m?(g+=E-t.matrix.e,v+=M-t.matrix.f):B||m!==e.parent?(d.renderTransform(1,d),h=getGlobalMatrix(r||f,!1,!1,!0),o=p.apply({x:h.e,y:h.f}),g+=(l=p.apply({x:E,y:M})).x-o.x,v+=l.y-o.y):(p.e=p.f=0,g+=(l=p.apply({x:E-t.matrix.e,y:M-t.matrix.f})).x,v+=l.y),g=P(g,.02),v=P(v,.02),!a||a instanceof pt?(d.x=g+"px",d.y=v+"px",d.renderTransform(1,d)):_&&_.revert(),a&&(a.x=g,a.y=v,a.rotation=S,a.skewX=s,i?(a.scaleX=b,a.scaleY=w):(a.width=y,a.height=x)),a||d},G=[],H="width,height,overflowX,overflowY".split(","),lt=function _killFlip(t,e){if(t&&t.progress()<1&&!t.paused())return e&&(function _interrupt(t){t.vars.onInterrupt&&t.vars.onInterrupt.apply(t,t.vars.onInterruptParams||[]),t.getChildren(!0,!1,!0).forEach(_interrupt)}(t),e<2&&t.progress(1),t.kill()),!0},ut=((n=FlipState.prototype).update=function update(t){var e=this;return this.elementStates=this.targets.map(function(t){return new pt(t,e.props,e.simple)}),Da(this),this.interrupt(t),this.recordInlineStyles(),this},n.clear=function clear(){return this.targets.length=this.elementStates.length=0,Da(this),this},n.fit=function fit(t,e,i){for(var n,r,a=ea(this.elementStates.slice(0),!1,!0),s=(t||this).idLookup,o=0;oa;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t,e}function ya(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,a=e._next;n?n._next=a:t[r]===e&&(t[r]=a),a?a._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null}function za(t,e){!t.parent||e&&!t.parent.autoRemoveChildren||t.parent.remove(t),t._act=0}function Aa(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function Ca(t,e,r,i){return t._startAt&&(B?t._startAt.revert(ht):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))}function Ea(t){return t._repeat?Tt(t._tTime,t=t.duration()+t._rDelay)*t:0}function Ga(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function Ha(t){return t._end=ja(t._start+(t._tDur/Math.abs(t._ts||t._rts||X)||0))}function Ia(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=ja(r._time-(0X)&&e.render(r,!0)),Aa(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur(n=Math.abs(n))&&(a=i,o=n);return a}function tb(t){return za(t),t.scrollTrigger&&t.scrollTrigger.kill(!!B),t.progress()<1&&St(t,"onInterrupt"),t}function wb(t){if(x()){var e=(t=!t.name&&t.default||t).name,r=s(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:T,render:fe,add:Qt,kill:_e,modifier:pe,rawVars:0},a={targetTest:0,get:0,getSetter:re,aliases:{},register:0};if(Ft(),t!==i){if(pt[e])return;qa(i,qa(ua(t,n),a)),yt(i.prototype,yt(n,ua(t,a))),pt[i.prop=e]=i,t.targetTest&&(gt.push(i),ft[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}S(e,i),t.register&&t.register(Pe,i,ge)}else Ct.push(t)}function zb(t,e,r){return(6*(t+=t<0?1:1>16,e>>8&Pt,e&Pt]:0:Dt.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),Dt[e])p=Dt[e];else if("#"===e.charAt(0)){if(e.length<6&&(e="#"+(n=e.charAt(1))+n+(a=e.charAt(2))+a+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&Pt,p&Pt,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&Pt,e&Pt]}else if("hsl"===e.substr(0,3))if(p=d=e.match(tt),r){if(~e.indexOf("="))return p=e.match(et),i&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,u=p[1]/100,n=2*(h=p[2]/100)-(a=h<=.5?h*(u+1):h+u-h*u),3=U?u.endTime(!1):t._dur;return r(e)&&(isNaN(e)||e in o)?(a=e.charAt(0),s="%"===e.substr(-1),n=e.indexOf("="),"<"===a||">"===a?(0<=n&&(e=e.replace(/=/,"")),("<"===a?u._start:u.endTime(0<=u._repeat))+(parseFloat(e.substr(1))||0)*(s?(n<0?u:i).totalDuration()/100:1)):n<0?(e in o||(o[e]=h),o[e]):(a=parseFloat(e.charAt(n-1)+e.substr(n+1)),s&&i&&(a=a/100*(Z(i)?i[0]:i).totalDuration()),1=r&&te)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start=n._start)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0=this.totalDuration()||!v&&_)&&(f!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||(!t&&g||!(v===m&&0=i&&(a instanceof Jt?e&&n.push(a):(r&&n.push(a),t&&n.push.apply(n,a.getChildren(!0,e,r)))),a=a._next;return n},e.getById=function getById(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function remove(t){return r(t)?this.removeLabel(t):s(t)?this.killTweensOf(t):(ya(this,t),t===this._recent&&(this._recent=this._last),Aa(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ja(Rt.time-(0r:!r||s.isActive())&&n.push(s):(i=s.getTweensOf(a,r)).length&&n.push.apply(n,i),s=s._next;return n},e.tweenTo=function tweenTo(t,e){e=e||{};var r,i=this,n=xt(i,t),a=e.startAt,s=e.onStart,o=e.onStartParams,u=e.immediateRender,h=Jt.to(i,qa({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||X,onStart:function onStart(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&Ra(h,t,0,1).render(h._time,!0,!0),r=1}s&&s.apply(h,o||[])}},e));return u?h.render(0):h},e.tweenFromTo=function tweenFromTo(t,e,r){return this.tweenTo(e,qa({startAt:{time:xt(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),rb(this,xt(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),rb(this,xt(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+X)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);for(var i,n=this._first,a=this.labels;n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in a)a[i]>=r&&(a[i]+=t);return Aa(this)},e.invalidate=function invalidate(t){var e=this._first;for(this._lock=0;e;)e.invalidate(t),e=e._next;return i.prototype.invalidate.call(this,t)},e.clear=function clear(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Aa(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=U;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-t:t));if(a._dirty){for(i=a.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),o<(r=s._start)&&a._sort&&s._ts&&!a._lock?(a._lock=1,Ka(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=r/a._ts,a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-Infinity),o=0),s._end>n&&s._ts&&(n=s._end),s=e;Ra(a,a===L&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(L._ts&&(na(L,Ga(t,L)),f=Rt.frame),Rt.frame>=mt){mt+=V.autoSleep||120;var e=L._first;if((!e||!e._ts)&&V.autoSleep&&Rt._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Rt.sleep()}}},Timeline}(Ut);qa(Xt.prototype,{_lock:0,_hasPause:0,_forcing:0});function ac(t,e,i,n,a,o){var u,h,l,f;if(pt[t]&&!1!==(u=new pt[t]).init(a,u.rawVars?e[t]:function _processVars(t,e,i,n,a){if(s(t)&&(t=Gt(t,a,e,i,n)),!v(t)||t.style&&t.nodeType||Z(t)||J(t))return r(t)?Gt(t,a,e,i,n):t;var o,u={};for(o in t)u[o]=Gt(t[o],a,e,i,n);return u}(e[t],n,a,o,i),i,n,o)&&(i._pt=h=new ge(i._pt,a,t,0,1,u.render,u,0,u.priority),i!==c))for(l=i._ptLookup[i._targets.indexOf(a)],f=u._props.length;f--;)l[u._props[f]]=h;return u}function gc(t,r,e,i){var n,a,s=r.ease||i||"power1.inOut";if(Z(r))a=e[t]||(e[t]=[]),r.forEach(function(t,e){return a.push({t:e/(r.length-1)*100,v:t,e:s})});else for(n in r)a=e[n]||(e[n]=[]),"ease"===n||a.push({t:parseFloat(t),v:r[n],e:s})}var Nt,Wt,Qt=function _addPropTween(t,e,i,n,a,o,u,h,l,f){s(n)&&(n=n(a||0,t,o));var c,d=t[e],p="get"!==i?i:s(d)?l?t[e.indexOf("set")||!s(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():d,_=s(d)?l?ee:te:Zt;if(r(n)&&(~n.indexOf("random(")&&(n=ob(n)),"="===n.charAt(1)&&(!(c=ka(p,n)+(Ya(p)||0))&&0!==c||(n=c))),!f||p!==n||Wt)return isNaN(p*n)||""===n?(d||e in t||Q(e,n),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,c,d,p,_=new ge(this._pt,t,e,0,1,le,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(d=~(i+="").indexOf("random("))&&(i=ob(i)),a&&(a(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(it)||[];o=it.exec(i);)l=o[0],f=i.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(c=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:c,c:"="===l.charAt(1)?ka(c,l)-c:parseFloat(l)-c,m:h&&h<4?Math.round:0},m=it.lastIndex);return _.c=m")}),s.duration();else{for(l in u={},x)"ease"===l||"easeEach"===l||gc(l,x[l],u,x.easeEach);for(l in u)for(C=u[l].sort(function(t,e){return t.t-e.t}),o=E=0;o=t._tDur||e<0)&&t.ratio===u&&(u&&za(t,1),r||B||(St(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},e.targets=function targets(){return this._targets},e.invalidate=function invalidate(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),z.prototype.invalidate.call(this,t)},e.resetTo=function resetTo(t,e,r,i){d||Rt.wake(),this._ts||this.play();var n,a=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Kt(this,a),n=this._ease(a/this._dur),function _updatePropTweens(t,e,r,i,n,a,s){var o,u,h,l,f=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!f)for(f=t._ptCache[e]=[],h=t._ptLookup,l=t._targets.length;l--;){if((o=h[l][e])&&o.d&&o.d._pt)for(o=o.d._pt;o&&o.p!==e&&o.fp!==e;)o=o._next;if(!o)return Wt=1,t.vars[e]="+=0",Kt(t,s),Wt=0,1;f.push(o)}for(l=f.length;l--;)(o=(u=f[l])._pt||u).s=!i&&0!==i||n?o.s+(i||0)+a*o.c:i,o.c=r-o.s,u.e&&(u.e=ia(r)+Ya(u.e)),u.b&&(u.b=o.s+Ya(u.b))}(this,t,e,r,i,n,a)?this.resetTo(t,e,r,i):(Ia(this,0),this.parent||xa(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?tb(this):this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Nt&&!0!==Nt.vars.overwrite)._first||tb(this),this.parent&&i!==this.timeline.totalDuration()&&Ra(this,this._dur*this.timeline._tDur/i,0,1),this}var n,a,s,o,u,h,l,f=this._targets,c=t?Mt(t):f,d=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function _arraysMatch(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(f,c))return"all"===e&&(this._pt=0),tb(this);for(n=this._op=this._op||[],"all"!==e&&(r(e)&&(u={},ha(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?fa(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=yt({},e),o)if(i in r)for(n=(a=o[i].split(",")).length;n--;)r[a[n]]=r[i];return r}(f,e)),l=f.length;l--;)if(~c.indexOf(f[l]))for(u in a=d[l],"all"===e?(n[l]=e,o=a,s={}):(s=n[l]=n[l]||{},o=e),o)(h=a&&a[u])&&("kill"in h.d&&!0!==h.d.kill(u)||ya(this,h,"_pt"),delete a[u]),"all"!==s&&(s[u]=1);return this._initted&&!this._pt&&p&&tb(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return Va(1,arguments)},Tween.delayedCall=function delayedCall(t,e,r,i){return new Tween(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},Tween.fromTo=function fromTo(t,e,r){return Va(2,arguments)},Tween.set=function set(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new Tween(t,e)},Tween.killTweensOf=function killTweensOf(t,e,r){return L.killTweensOf(t,e,r)},Tween}(Ut);qa(Jt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ha("staggerTo,staggerFrom,staggerFromTo",function(r){Jt[r]=function(){var t=new Xt,e=kt.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function oc(t,e,r){return t.setAttribute(e,r)}function wc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var Zt=function _setterPlain(t,e,r){return t[e]=r},te=function _setterFunc(t,e,r){return t[e](r)},ee=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},re=function _getSetter(t,e){return s(t[e])?te:u(t[e])&&t.setAttribute?oc:Zt},se=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},oe=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},le=function _renderComplexString(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},fe=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},pe=function _addPluginModifier(t,e,r,i){for(var n,a=this._pt;a;)n=a._next,a.p===i&&a.modifier(t,e,r),a=n},_e=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?ya(this,i,"_pt"):i.dep||(e=1),i=r;return!e},me=function _sortPropTweensByPriority(t){for(var e,r,i,n,a=t._pt;a;){for(e=a._next,r=i;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:n)?a._prev._next=a:i=a,(a._next=r)?r._prev=a:n=a,a=e}t._pt=i},ge=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=wc,this.m=t,this.mt=r,this.tween=e},PropTween);function PropTween(t,e,r,i,n,a,s,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=a||se,this.d=s||this,this.set=o||Zt,this.pr=u||0,(this._next=t)&&(t._prev=this)}ha(vt+"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 ft[t]=1}),ot.TweenMax=ot.TweenLite=Jt,ot.TimelineLite=ot.TimelineMax=Xt,L=new Xt({sortChildren:!1,defaults:q,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),V.stringFilter=Fb;function Dc(t){return(be[t]||xe).map(function(t){return t()})}function Ec(){var t=Date.now(),o=[];2{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){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&&s&&s.log(`progress: ${i}`,t,e)},n.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)}},h.prototype=Object.create(e.prototype),h.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)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.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())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n})); -------------------------------------------------------------------------------- /js/index.js: -------------------------------------------------------------------------------- 1 | import { preloadImages } from './utils.js'; 2 | 3 | // Grid element 4 | const grid = document.querySelector('.columns'); 5 | 6 | // The grid columns iiner elements that move upwards/downwards 7 | const columnsInner = { 8 | up: grid.querySelectorAll('.column--moveup > .column-inner'), 9 | down: grid.querySelectorAll('.column--movedown > .column-inner') 10 | }; 11 | 12 | // Content element 13 | const content = document.querySelector('.content'); 14 | 15 | // Content item element 16 | const contentItem = content.querySelector('.content__item') 17 | 18 | // Content nav and content nav items 19 | const contentNav = content.querySelector('.content__nav'); 20 | const contentNavItems = contentNav.querySelectorAll('.content__nav-item'); 21 | 22 | // Content title and both title spans 23 | const contentTitle = content.querySelector('.content__title'); 24 | const contentTitleWords = contentTitle.querySelectorAll('.oh > span'); 25 | 26 | // Element that "flips" (GSAP Flip). This element will be inserted in the contentItem. 27 | const flipItem = grid.querySelector('.flip'); 28 | 29 | // Also its parent 30 | const flipItemParent = flipItem.parentNode; 31 | 32 | // The element on the left of the flipItem (when there are only two visible grid items in the viewport) 33 | const pushItem = grid.querySelector('.push'); 34 | 35 | // There are two modes: grid mode and list mode 36 | const switchMode = document.querySelector('.switch'); 37 | 38 | const switchToggle = { 39 | list: switchMode.querySelector('.switch__button--list'), 40 | grid: switchMode.querySelector('.switch__button--grid') 41 | }; 42 | 43 | // We start with the grid mode by default 44 | let currentMode = 'grid'; 45 | switchToggle[currentMode].classList.add('switch__button--current'); 46 | 47 | let isAnimating; 48 | 49 | gsap.set([grid, columnsInner.up, columnsInner.down, contentTitleWords, pushItem, flipItem, contentNavItems], {willChange: 'transform, opacity'}); 50 | 51 | // Toggle function 52 | const toggleMode = mode => { 53 | if ( isAnimating || currentMode === mode ) return; 54 | isAnimating = true; 55 | // Switch current state/class 56 | switchToggle[currentMode].classList.remove('switch__button--current'); 57 | switchToggle[mode].classList.add('switch__button--current'); 58 | // Set new mode 59 | currentMode = mode; 60 | // Call showList or showGrid functions 61 | switchActions[currentMode]().then(() => isAnimating = false); 62 | }; 63 | 64 | // Show list mode 65 | const showList = () => { 66 | return gsap 67 | .timeline({ 68 | defaults: { 69 | duration: 1.7, 70 | ease: 'power2.inOut' 71 | }, 72 | onStart: () => { 73 | // pointer events to auto 74 | content.classList.add('content--current'); 75 | } 76 | }) 77 | .addLabel('start', 0) 78 | .fromTo(grid, { 79 | scale: 0.4 80 | }, { 81 | scale: 1 82 | }, 'start') 83 | .to(columnsInner.up, { 84 | y: '-200vh' 85 | }, 'start') 86 | .to(columnsInner.down, { 87 | y: '200vh' 88 | }, 'start') 89 | 90 | // At this point there are only two items/images (flip and push items) in the viewport 91 | .addLabel('flip', 1.7) 92 | 93 | // contentTitle motion: 94 | // First show contentTitle 95 | .add(() => { 96 | gsap.set(contentTitle, {opacity: 1}); 97 | }, 'flip-=1') 98 | // Now slide in each word/span 99 | .fromTo(contentTitleWords, { 100 | yPercent: pos => pos ? -200 : 200 101 | }, { 102 | duration: 0.85, 103 | ease: 'power2', 104 | yPercent: 0 105 | }, 'start+=0.85') 106 | // Then switch positions of both words 107 | .to([...contentTitleWords].map(word => word.parentNode), { 108 | duration: 1, 109 | ease: 'power4', 110 | yPercent: pos => pos ? -43 : 43 111 | }) 112 | 113 | .add(() => { 114 | // Save current state of the flipItem 115 | const flipstate = Flip.getState(flipItem); 116 | // Insert the flipItem in the contentItem 117 | contentItem.appendChild(flipItem); 118 | // Animate the element using the GSAP Flip magic 119 | Flip.from(flipstate, { 120 | duration: 1, 121 | ease: 'power4' 122 | }); 123 | // show contentNav 124 | gsap.set(contentNav, {opacity: 1}); 125 | }, 'flip') 126 | .to(pushItem, { 127 | duration: 1, 128 | ease: 'power4', 129 | xPercent: -100, 130 | //startAt: {filter: 'brightness(100%)'}, 131 | //filter: 'brightness(60%)' 132 | }, 'flip') 133 | .fromTo(contentNavItems, { 134 | yPercent: 200, 135 | opacity: 0 136 | }, { 137 | duration: .7, 138 | ease: 'power4', 139 | stagger: 0.03, 140 | yPercent: 0, 141 | opacity: 1 142 | }, 'flip') 143 | }; 144 | 145 | // Show grid mode 146 | const showGrid = () => { 147 | return gsap 148 | .timeline({ 149 | defaults: { 150 | duration: 1.7, 151 | ease: 'power2.inOut' 152 | }, 153 | onStart: () => { 154 | // pointer events to none 155 | content.classList.remove('content--current'); 156 | } 157 | }) 158 | .addLabel('flip', 0) 159 | .to(contentNavItems, { 160 | duration: .7, 161 | stagger: -0.03, 162 | yPercent: 200, 163 | opacity: 0, 164 | onComplete: () => { 165 | // hide contentNav 166 | gsap.set(contentNav, {opacity: 1}); 167 | } 168 | }, 'flip') 169 | .to(pushItem, { 170 | duration: 1, 171 | xPercent: 0 172 | }, 'flip') 173 | .add(() => { 174 | // Save current state of the flipItem 175 | const flipstate = Flip.getState(flipItem); 176 | // Insert the flipItem in the original flipItemParent 177 | flipItemParent.appendChild(flipItem); 178 | // Animate the element using the GSAP Flip magic 179 | Flip.from(flipstate, { 180 | duration: 1, 181 | ease: 'power2.inOut', 182 | }); 183 | }, 'flip') 184 | 185 | .addLabel('columns', 1) 186 | 187 | // contentTitle motion: 188 | .to([...contentTitleWords].map(word => word.parentNode), { 189 | duration: 1, 190 | yPercent: 0 191 | }, 'flip') 192 | // Now slide out each word/span 193 | .to(contentTitleWords, { 194 | duration: 0.85, 195 | yPercent: pos => pos ? -200 : 200, 196 | onComplete: () => gsap.set(contentTitle, {opacity: 0}) 197 | }, 'columns') 198 | 199 | .to([columnsInner.down, columnsInner.up], { 200 | y: 0 201 | }, 'columns') 202 | .to(grid, { 203 | scale: 0.4 204 | }, 'columns') 205 | }; 206 | 207 | const switchActions = { 208 | list: showList, 209 | grid: showGrid 210 | }; 211 | 212 | // Toggle mode events 213 | switchToggle.list.addEventListener('click', () => toggleMode('list')); 214 | switchToggle.grid.addEventListener('click', () => toggleMode('grid')); 215 | 216 | // Preload images then remove loader (loading class) from body 217 | preloadImages('.column__item-img').then(() => document.body.classList.remove('loading')); -------------------------------------------------------------------------------- /js/utils.js: -------------------------------------------------------------------------------- 1 | // Preload images 2 | const preloadImages = (selector = 'img') => { 3 | return new Promise((resolve) => { 4 | imagesLoaded(document.querySelectorAll(selector), {background: true}, resolve); 5 | }); 6 | }; 7 | 8 | export { 9 | preloadImages, 10 | }; --------------------------------------------------------------------------------