├── .gitignore ├── README.md ├── css ├── demo.css ├── mirror.css └── normalize.css ├── favicon.ico ├── img ├── 1.jpg ├── 2.jpg ├── 3.jpg ├── 4.jpg ├── LicenseFreepik.txt ├── bg.jpg ├── veggie1.svg ├── veggie2.svg ├── veggie3.svg ├── veggie4.svg ├── wave1.svg ├── wave2.svg ├── wave3.svg └── wave4.svg ├── index.html ├── index2.html ├── index3.html └── js ├── anime.min.js ├── imagesloaded.pkgd.min.js ├── mirrorFx.js └── slideshow.js /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mirror Effect 2 | 3 | Mirror effect as seen around the Web lately, i.e. on [Corentin Fardeau's](http://www.corentinfardeau.fr/) and [Method's](http://method.digital/) website. The idea is to mirror an image and animate it within the context of a slideshow. 4 | 5 | [Article on Codrops](https://tympanus.net/codrops/?p=29492) 6 | 7 | [Demo](http://tympanus.net/Development/MirrorEffect/) 8 | 9 | ## License 10 | 11 | Integrate or build upon it for free in your personal or commercial projects. Don't republish, redistribute or sell "as-is". 12 | 13 | Read more here: [License](http://tympanus.net/codrops/licensing/) 14 | 15 | ## Credits 16 | 17 | - [anime.js](http://anime-js.com/) by Julian Garnier 18 | - [imagesLoaded](http://imagesloaded.desandro.com/) by David DeSandro 19 | - Photos from [Unsplash.com](http://unsplash.com) and [Pexel.com](http://pexels.com), licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/) 20 | - Sound waves from [Freepik.com](http://freepik.com), [license information](http://support.freepik.com/hc/en-us) 21 | - Veggies from [Freepik.com](http://www.freepik.com/index.php?goto=74&idfoto=969209), [license information](http://support.freepik.com/hc/en-us). See the license file within the images folder. 22 | - Background from [Freepik.com](http://www.freepik.com) 23 | - Play Button by [Madebyolive](http://www.flaticon.com/authors/madebyoliver) from [Flaticon.com](http://www.flaticon.com/free-icon/play-button_149125) 24 | 25 | ## Misc 26 | 27 | Follow Codrops: [Twitter](http://www.twitter.com/codrops), [Facebook](https://www.facebook.com/codrops/), [Google+](https://plus.google.com/101095823814290637419), [GitHub](https://github.com/codrops), [Pinterest](http://www.pinterest.com/codrops/), [Instagram](https://www.instagram.com/codropsss/) 28 | 29 | 30 | [© Codrops 2017](http://www.codrops.com) 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /css/demo.css: -------------------------------------------------------------------------------- 1 | *, 2 | *::after, 3 | *::before { 4 | -webkit-box-sizing: border-box; 5 | box-sizing: border-box; 6 | } 7 | 8 | body { 9 | font-family: 'Roboto', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, sans-serif; 10 | color: #909090; 11 | background: #111; 12 | } 13 | 14 | a { 15 | text-decoration: none; 16 | color: #909090; 17 | outline: none; 18 | } 19 | 20 | a:hover, 21 | a:focus { 22 | color: #fff; 23 | } 24 | 25 | .hidden { 26 | position: absolute; 27 | overflow: hidden; 28 | width: 0; 29 | height: 0; 30 | pointer-events: none; 31 | } 32 | 33 | 34 | /* Icons */ 35 | 36 | .icon { 37 | display: block; 38 | width: 1.5em; 39 | height: 1.5em; 40 | margin: 0 auto; 41 | fill: currentColor; 42 | } 43 | 44 | 45 | /* Page Loader */ 46 | 47 | .js body::before { 48 | content: 'Loading...'; 49 | font-family: 'Montserrat'; 50 | letter-spacing: 0.2em; 51 | text-indent: -0.2em; 52 | text-transform: uppercase; 53 | font-weight: bold; 54 | display: flex; 55 | align-items: center; 56 | justify-content: center; 57 | color: #000; 58 | position: fixed; 59 | top: -100%; 60 | left: 0; 61 | width: 100%; 62 | height: 100%; 63 | background: #facb7a; 64 | z-index: 1000; 65 | pointer-events: none; 66 | transition: transform 0.5s; 67 | } 68 | 69 | .js .loading::before { 70 | transform: translate3d(0,100%,0); 71 | } 72 | 73 | /* Header */ 74 | 75 | .codrops-header { 76 | position: relative; 77 | display: flex; 78 | flex-direction: row; 79 | flex-wrap: wrap; 80 | align-items: center; 81 | width: 100%; 82 | padding: 1em; 83 | z-index: 100; 84 | } 85 | 86 | .codrops-header__title { 87 | font-size: 1em; 88 | font-weight: 400; 89 | margin: 0; 90 | padding: 0 1em 0 0.25em; 91 | } 92 | 93 | 94 | /* Top Navigation Style */ 95 | 96 | .codrops-links { 97 | position: relative; 98 | display: flex; 99 | justify-content: center; 100 | text-align: center; 101 | white-space: nowrap; 102 | font-size: 0.85em; 103 | } 104 | 105 | .codrops-links::after { 106 | content: ''; 107 | height: 100%; 108 | width: 1px; 109 | background: currentColor; 110 | position: absolute; 111 | transform: rotate(22.5deg); 112 | left: 50%; 113 | top: 0; 114 | } 115 | 116 | .codrops-icon { 117 | pointer-events: visible; 118 | display: inline-block; 119 | padding: 0.6em; 120 | } 121 | 122 | 123 | /* Demo links */ 124 | 125 | .demos { 126 | margin: 0 1em 0 auto; 127 | } 128 | 129 | .demo { 130 | margin: 0 1em 0.5em 0; 131 | padding: 0 0 0.25em; 132 | border-bottom: 2px solid transparent; 133 | } 134 | 135 | .demos .demo--current { 136 | border-color: currentColor; 137 | } 138 | 139 | /* Content */ 140 | 141 | .content { 142 | text-align: center; 143 | } 144 | 145 | .content--full { 146 | height: 100vh; 147 | min-height: 600px; 148 | overflow: hidden; 149 | } 150 | 151 | .flexy { 152 | display: flex; 153 | flex-wrap: wrap; 154 | flex-direction: column; 155 | align-items: center; 156 | } 157 | 158 | .flexy--center { 159 | justify-content: center; 160 | } 161 | 162 | .flexy--row { 163 | flex-direction: row; 164 | } 165 | 166 | 167 | /* Slideshow */ 168 | 169 | .slideshow { 170 | position: relative; 171 | width: 100%; 172 | height: calc(100vh - 5.5em); 173 | } 174 | 175 | .slide { 176 | position: relative; 177 | width: 100%; 178 | display: flex; 179 | flex-direction: column; 180 | justify-content: center; 181 | margin: 0 0 1em 0; 182 | pointer-events: none; 183 | } 184 | 185 | .js .slide { 186 | position: absolute; 187 | top: 0; 188 | left: 0; 189 | height: 100%; 190 | margin: 0; 191 | pointer-events: none; 192 | opacity: 0; 193 | } 194 | 195 | .js .slide--current { 196 | pointer-events: auto; 197 | opacity: 1; 198 | } 199 | 200 | .slide__title { 201 | font-family: 'Arapey'; 202 | font-weight: normal; 203 | position: relative; 204 | z-index: 10; 205 | font-size: 13vw; 206 | margin: 0; 207 | line-height: 0.8; 208 | color: #8dbd2b; 209 | pointer-events: none; 210 | } 211 | 212 | .slide .mirror { 213 | position: absolute; 214 | top: 50%; 215 | width: 100%; 216 | left: 50%; 217 | transform: translate3d(-50%, -50%, 0); 218 | } 219 | 220 | .slideshow__nav { 221 | position: absolute; 222 | display: flex; 223 | flex-direction: column; 224 | flex-wrap: wrap; 225 | align-items: flex-end; 226 | bottom: 0; 227 | right: 0; 228 | padding: 0 2em 1em; 229 | overflow: hidden; 230 | } 231 | 232 | .slideshow__nav--inline { 233 | display: block; 234 | top: 30vh; 235 | left: 0; 236 | width: 100%; 237 | pointer-events: none; 238 | } 239 | 240 | .slideshow__nav--inline .btn { 241 | display: inline-block; 242 | margin: 0 1em; 243 | pointer-events: auto; 244 | } 245 | 246 | .slideshow__nav--nopad { 247 | padding: 0; 248 | } 249 | 250 | .btn { 251 | border: 0; 252 | background: 0; 253 | margin: 0; 254 | padding: 0; 255 | display: block; 256 | position: relative; 257 | padding: 0.25em 0; 258 | margin: 0.5em 0 0.75em; 259 | color: inherit; 260 | border-bottom: 2px solid transparent; 261 | transition: border-color 0.3s; 262 | } 263 | 264 | .btn:focus { 265 | outline: none; 266 | } 267 | 268 | .btn--current { 269 | border-color: currentColor; 270 | } 271 | 272 | .btn--nav:last-child { 273 | margin-bottom: 0; 274 | } 275 | 276 | .btn--line { 277 | width: 100%; 278 | text-align: right; 279 | padding: 0.15em 30px 0.15em 0; 280 | transition: color 0.3s; 281 | } 282 | 283 | .btn--line::before { 284 | content: ''; 285 | width: 10px; 286 | height: 2px; 287 | position: absolute; 288 | right: 0; 289 | top: 50%; 290 | z-index: -1; 291 | margin-top: -1px; 292 | background: #ffb74d; 293 | transition: transform 0.3s; 294 | } 295 | 296 | .btn--line.btn--current { 297 | border-color: transparent; 298 | color: #fff; 299 | } 300 | 301 | .btn--line.btn--current::before { 302 | transform: scale3d(26, 20, 1); 303 | } 304 | 305 | .btn--play { 306 | top: 70vh; 307 | left: 50%; 308 | color: #ffb74d; 309 | font-size: 3em; 310 | transform: translateX(-50%); 311 | position: absolute; 312 | transition: color 0.3s; 313 | } 314 | 315 | .btn--play:hover { 316 | color: #fff; 317 | } 318 | 319 | .link--sponsor { 320 | position: absolute; 321 | left: 0; 322 | margin: 0 0 2em 2em; 323 | bottom: 0; 324 | } 325 | 326 | .page-title { 327 | font-family: 'Montserrat'; 328 | position: absolute; 329 | top: 25vh; 330 | pointer-events: none; 331 | text-align: center; 332 | width: 100%; 333 | padding: 0 1em; 334 | margin: 0; 335 | font-size: 2em; 336 | letter-spacing: 0.2em; 337 | text-indent: 0.2em; 338 | text-transform: uppercase; 339 | color: #fff; 340 | } 341 | 342 | .overlay { 343 | position: fixed; 344 | top: 0; 345 | right: 0; 346 | width: 50%; 347 | height: 100%; 348 | background: #A8A9C8 url(../img/bg.jpg); 349 | background-size: cover; 350 | } 351 | 352 | /* Themes */ 353 | 354 | .demo-1 .page-title { 355 | z-index: 10; 356 | font-size: 0.85em; 357 | font-family: inherit; 358 | letter-spacing: 0.5em; 359 | text-indent: 0.5em; 360 | top: 38vh; 361 | } 362 | 363 | .demo-1 .slide:first-child .slide__title, 364 | .demo-1 .slideshow__nav .btn:first-child { 365 | color: #facb7a; 366 | } 367 | 368 | .demo-1 .slide:nth-child(2) .slide__title, 369 | .demo-1 .slideshow__nav .btn:nth-child(2) { 370 | color: #d06690; 371 | } 372 | 373 | .demo-1 .slide:nth-child(3) .slide__title, 374 | .demo-1 .slideshow__nav .btn:nth-child(3) { 375 | color: #9ccc65; 376 | } 377 | 378 | .demo-1 .slide:nth-child(4) .slide__title, 379 | .demo-1 .slideshow__nav .btn:nth-child(4) { 380 | color: #90a4ae; 381 | } 382 | 383 | .js body.demo-2::before { 384 | background: #fda32f; 385 | color: #fff; 386 | } 387 | 388 | .demo-2 { 389 | background: #f53c56; 390 | color: #fff; 391 | } 392 | 393 | .demo-2 a { 394 | color: #fff; 395 | } 396 | 397 | .demo-2 a:hover, 398 | .demo-2 a:focus { 399 | color: #000; 400 | } 401 | 402 | .demo-2 .slide__title { 403 | font-family: 'Anton', sans-serif; 404 | text-transform: uppercase; 405 | color: #fff; 406 | } 407 | 408 | .demo-2 .slideshow { 409 | overflow: hidden; 410 | } 411 | 412 | .demo-2 .slideshow__nav { 413 | padding-bottom: 2em; 414 | min-width: 10em; 415 | } 416 | 417 | .demo-3 { 418 | background: #2357c1; 419 | color: #fff; 420 | } 421 | 422 | .js body.demo-3::before { 423 | background: #a4b7e4; 424 | color: #fff; 425 | } 426 | 427 | .demo-3 a { 428 | color: #fff; 429 | } 430 | 431 | .demo-3 a:hover, 432 | .demo-3 a:focus { 433 | color: #fff; 434 | } 435 | 436 | .demo-3 .demo, 437 | .demo-3 .github { 438 | color: #2d3f61; 439 | } 440 | 441 | .demo-3 .slide { 442 | mix-blend-mode: color-burn; 443 | } 444 | 445 | .demo-3 .slideshow__nav { 446 | left: 0; 447 | right: auto; 448 | } 449 | 450 | .demo-3 .mirror { 451 | opacity: 0.25; 452 | } 453 | 454 | .demo-3 .mirror__side { 455 | padding: 4em 0; 456 | } 457 | 458 | .demo-3 .slide__title { 459 | color: #2d3f61; 460 | font-family: Raleway, sans-serif; 461 | text-transform: uppercase; 462 | font-weight: 900; 463 | font-size: 7em; 464 | } 465 | 466 | .demo-3 .slideshow__nav .btn { 467 | color: #ffeb3b; 468 | } 469 | 470 | .demo-3 .slideshow__nav .btn:hover { 471 | color: #fff; 472 | } 473 | 474 | .demo-3 .mirror__img { 475 | max-height: 65vh; 476 | } 477 | 478 | 479 | @media screen and (max-width: 50em) { 480 | .codrops-header { 481 | justify-content: center; 482 | } 483 | .link--sponsor { 484 | width: 100%; 485 | margin: 0; 486 | padding: 1em; 487 | } 488 | .demos { 489 | width: 100%; 490 | margin: 1em 0 0; 491 | } 492 | .page-title { 493 | font-size: 1.25em; 494 | } 495 | .slideshow__nav { 496 | width: 100%; 497 | padding: 0; 498 | bottom: auto; 499 | top: 0; 500 | display: block; 501 | } 502 | .page-title { 503 | top: 8em; 504 | } 505 | .demo-3 .slide__title { 506 | font-size: 2em; 507 | } 508 | .btn { 509 | width: auto; 510 | padding: 0; 511 | display: inline-block; 512 | margin: 0.15em; 513 | } 514 | .btn--line::before { 515 | display: none; 516 | } 517 | .btn--current.btn--line::before { 518 | transform: none; 519 | display: block; 520 | top: auto; 521 | bottom: -0.5em; 522 | width: 100%; 523 | } 524 | } 525 | -------------------------------------------------------------------------------- /css/mirror.css: -------------------------------------------------------------------------------- 1 | .mirror { 2 | width: 60vw; 3 | max-width: 1100px; 4 | margin: 0 auto; 5 | display: flex; 6 | align-items: center; 7 | } 8 | 9 | .mirror[data-layout="vertical"] { 10 | flex-direction: row; 11 | flex-wrap: wrap; 12 | } 13 | 14 | .mirror__side { 15 | flex: none; 16 | overflow: hidden; 17 | width: 50%; 18 | display: flex; 19 | align-items: flex-end; 20 | } 21 | 22 | .mirror[data-layout="vertical"] .mirror__side{ 23 | height: 50%; 24 | width: 100%; 25 | } 26 | 27 | .mirror__img { 28 | display: block; 29 | width: 100%; 30 | transform: translate3d(100%,0,0); 31 | } 32 | 33 | .mirror[data-layout="vertical"] .mirror__img { 34 | transform: translate3d(0,100%,0); 35 | } 36 | 37 | .mirror__side--two { 38 | transform: scale3d(-1,1,1); 39 | } 40 | 41 | .mirror[data-layout="vertical"] .mirror__side--two { 42 | transform: scale3d(1,-1,1); 43 | } -------------------------------------------------------------------------------- /css/normalize.css: -------------------------------------------------------------------------------- 1 | article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;} -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MirrorEffect/70cc1f1406d6f4970bdcae2b4f07c286941a342c/favicon.ico -------------------------------------------------------------------------------- /img/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MirrorEffect/70cc1f1406d6f4970bdcae2b4f07c286941a342c/img/1.jpg -------------------------------------------------------------------------------- /img/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MirrorEffect/70cc1f1406d6f4970bdcae2b4f07c286941a342c/img/2.jpg -------------------------------------------------------------------------------- /img/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MirrorEffect/70cc1f1406d6f4970bdcae2b4f07c286941a342c/img/3.jpg -------------------------------------------------------------------------------- /img/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MirrorEffect/70cc1f1406d6f4970bdcae2b4f07c286941a342c/img/4.jpg -------------------------------------------------------------------------------- /img/LicenseFreepik.txt: -------------------------------------------------------------------------------- 1 | IMPORTANT NOTICE: This license only applies if you downloaded this vector as 2 | an unsubscribed user. If you are a premium user (ie, you pay a subscription) 3 | you are bound to the license terms described in the accompanying file 4 | "License premium.txt". 5 | 6 | --------------------- 7 | 8 | You must attribute the image to its author: 9 | 10 | In order to use a vector or a part of it, you must attribute it to Freepik, 11 | so we will be able to continue creating new graphic resources every day. 12 | 13 | 14 | How to attribute it? 15 | 16 | For websites: 17 | 18 | Please, copy this code on your website to accredit the author: 19 | Designed by Freepik 20 | 21 | For printing: 22 | 23 | Paste this text on the final work so the authorship is known. 24 | - For example, in the acknowledgements chapter of a book: 25 | "Designed by Freepik" 26 | 27 | 28 | You are free to use this image: 29 | 30 | - For both personal and commercial projects and to modify it. 31 | - In a website or presentation template or application or as part of your design. 32 | 33 | You are not allowed to: 34 | 35 | - Sub-license, resell or rent it. 36 | - Include it in any online or offline archive or database. 37 | 38 | The full terms of the license are described in section 7 of the Freepik 39 | terms of use, available online in the following link: 40 | 41 | http://www.freepik.com/terms_of_use 42 | 43 | The terms described in the above link have precedence over the terms described 44 | in the present document. In case of disagreement, the Freepik Terms of Use 45 | will prevail. 46 | -------------------------------------------------------------------------------- /img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codrops/MirrorEffect/70cc1f1406d6f4970bdcae2b4f07c286941a342c/img/bg.jpg -------------------------------------------------------------------------------- /img/wave1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 239 | 463 | 464 | 465 | -------------------------------------------------------------------------------- /img/wave2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 537 | 538 | -------------------------------------------------------------------------------- /img/wave3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 430 | 431 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Mirror Effect | Demo 1 | Codrops 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 29 |
30 |
31 |
32 | 36 |

Mirror Effect

37 | 43 |
44 |

Maitri Animal Sanctuary

45 |
46 |
47 |
48 |
49 | Some image 50 |
51 |
52 | Some image 53 |
54 |
55 |

Simba

56 |
57 |
58 |
59 |
60 | Some image 61 |
62 |
63 | Some image 64 |
65 |
66 |

Anette

67 |
68 |
69 |
70 |
71 | Some image 72 |
73 |
74 | Some image 75 |
76 |
77 |

Matuba

78 |
79 |
80 |
81 |
82 | Some image 83 |
84 |
85 | Some image 86 |
87 |
88 |

Boris

89 |
90 | 96 |
97 | Become an animal sponsor 98 |
99 |
100 | 101 | 102 | 103 | 104 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /index2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Mirror Effect | Demo 2 | Codrops 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 32 |
33 |
34 |
35 | 39 |

Mirror Effect

40 | 46 |
47 |

Dreams in Colors

48 |
49 |
50 |
51 |
52 | Some image 53 |
54 |
55 | Some image 56 |
57 |
58 |

Clouds

59 |
60 |
61 |
62 |
63 | Some image 64 |
65 |
66 | Some image 67 |
68 |
69 |

Unfolding

70 |
71 |
72 |
73 |
74 | Some image 75 |
76 |
77 | Some image 78 |
79 |
80 |

Sleeping

81 |
82 |
83 |
84 |
85 | Some image 86 |
87 |
88 | Some image 89 |
90 |
91 |

Horizons

92 |
93 | 99 |
100 | 101 |
102 |
103 | 104 | 105 | 106 | 107 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /index3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Mirror Effect | Demo 3 | Codrops 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 29 |
30 |
31 |
32 |
33 | 37 |

Mirror Effect

38 | 44 |
45 |
46 |
47 |
48 |
49 | Some image 50 |
51 |
52 | Some image 53 |
54 |
55 |

Artichoke

56 |
57 |
58 |
59 |
60 | Some image 61 |
62 |
63 | Some image 64 |
65 |
66 |

Avocado

67 |
68 |
69 |
70 |
71 | Some image 72 |
73 |
74 | Some image 75 |
76 |
77 |

Lemon

78 |
79 |
80 |
81 |
82 | Some image 83 |
84 |
85 | Some image 86 |
87 |
88 |

Beetroot

89 |
90 | 96 |
97 |
98 |
99 | 100 | 101 | 102 | 103 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /js/anime.min.js: -------------------------------------------------------------------------------- 1 | (function(t,q){"function"===typeof define&&define.amd?define([],q):"object"===typeof module&&module.exports?module.exports=q():t.anime=q()})(this,function(){var t={duration:1E3,delay:0,loop:!1,autoplay:!0,direction:"normal",easing:"easeOutElastic",elasticity:400,round:!1,begin:void 0,update:void 0,complete:void 0},q="translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY".split(" "),x,f={arr:function(a){return Array.isArray(a)},obj:function(a){return-1< 2 | Object.prototype.toString.call(a).indexOf("Object")},svg:function(a){return a instanceof SVGElement},dom:function(a){return a.nodeType||f.svg(a)},num:function(a){return!isNaN(parseInt(a))},str:function(a){return"string"===typeof a},fnc:function(a){return"function"===typeof a},und:function(a){return"undefined"===typeof a},nul:function(a){return"null"===typeof a},hex:function(a){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a)},rgb:function(a){return/^rgb/.test(a)},hsl:function(a){return/^hsl/.test(a)}, 3 | col:function(a){return f.hex(a)||f.rgb(a)||f.hsl(a)}},C=function(){var a={},b={Sine:function(a){return 1+Math.sin(Math.PI/2*a-Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a,b){if(0===a||1===a)return a;var c=1-Math.min(b,998)/1E3,d=a/1-1;return-(Math.pow(2,10*d)*Math.sin(2*(d-c/(2*Math.PI)*Math.asin(1))*Math.PI/c))},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var b,c=4;a<((b=Math.pow(2,--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((3*b-2)/22-a,2)}}; 4 | ["Quad","Cubic","Quart","Quint","Expo"].forEach(function(a,d){b[a]=function(a){return Math.pow(a,d+2)}});Object.keys(b).forEach(function(c){var d=b[c];a["easeIn"+c]=d;a["easeOut"+c]=function(a,b){return 1-d(1-a,b)};a["easeInOut"+c]=function(a,b){return.5>a?d(2*a,b)/2:1-d(-2*a+2,b)/2};a["easeOutIn"+c]=function(a,b){return.5>a?(1-d(1-2*a,b))/2:(d(2*a-1,b)+1)/2}});a.linear=function(a){return a};return a}(),y=function(a){return f.str(a)?a:a+""},D=function(a){return a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}, 5 | E=function(a){if(f.col(a))return!1;try{return document.querySelectorAll(a)}catch(b){return!1}},z=function(a){return a.reduce(function(a,c){return a.concat(f.arr(c)?z(c):c)},[])},r=function(a){if(f.arr(a))return a;f.str(a)&&(a=E(a)||a);return a instanceof NodeList||a instanceof HTMLCollection?[].slice.call(a):[a]},F=function(a,b){return a.some(function(a){return a===b})},Q=function(a,b){var c={};a.forEach(function(a){var d=JSON.stringify(b.map(function(b){return a[b]}));c[d]=c[d]||[];c[d].push(a)}); 6 | return Object.keys(c).map(function(a){return c[a]})},G=function(a){return a.filter(function(a,c,d){return d.indexOf(a)===c})},A=function(a){var b={},c;for(c in a)b[c]=a[c];return b},u=function(a,b){for(var c in b)a[c]=f.und(a[c])?b[c]:a[c];return a},R=function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,c,l){return b+b+c+c+l+l});var b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);a=parseInt(b[1],16);var c=parseInt(b[2],16),b=parseInt(b[3],16);return"rgb("+a+","+c+","+b+")"}, 7 | S=function(a){a=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a);var b=parseInt(a[1])/360,c=parseInt(a[2])/100,d=parseInt(a[3])/100;a=function(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+(b-a)*(2/3-c)*6:a};if(0==c)c=d=b=d;else var e=.5>d?d*(1+c):d+c-d*c,h=2*d-e,c=a(h,e,b+1/3),d=a(h,e,b),b=a(h,e,b-1/3);return"rgb("+255*c+","+255*d+","+255*b+")"},p=function(a){return/([\+\-]?[0-9|auto\.]+)(%|px|pt|em|rem|in|cm|mm|ex|pc|vw|vh|deg)?/.exec(a)[2]},H=function(a,b,c){return p(b)? 8 | b:-1=b.delay&&(d.begin&&d.begin(b),d.begin=void 0,d.update&&d.update(b));c.current>=b.duration&&(d.loop?(c.start=a,"alternate"===d.direction&&B(b,!0),f.num(d.loop)&&d.loop--):(b.ended=!0,b.pause(),d.complete&&d.complete(b)),c.last=0)};b.seek=function(a){O(b,a/100*b.duration)};b.pause=function(){ba(b);var a=n.indexOf(b);-1< 18 | a&&n.splice(a,1)};b.play=function(a){b.pause();a&&(b=u(P(u(a,b.settings)),b));c.start=0;c.last=b.ended?0:b.currentTime;a=b.settings;"reverse"===a.direction&&B(b);"alternate"!==a.direction||a.loop||(a.loop=1);aa(b);n.push(b);w||ea()};b.restart=function(){b.reversed&&B(b);b.pause();b.seek(0);b.play()};b.settings.autoplay&&b.play();return b};k.version="1.1.3";k.speed=1;k.list=n;k.remove=function(a){a=z(f.arr(a)?a.map(r):r(a));for(var b=n.length-1;0<=b;b--)for(var c=n[b],d=c.tweens,e=d.length-1;0<=e;e--)for(var h= 19 | d[e].animatables,k=h.length-1;0<=k;k--)F(a,h[k].target)&&(h.splice(k,1),h.length||d.splice(e,1),d.length||c.pause())};k.easings=C;k.getValue=J;k.path=function(a){a=f.str(a)?E(a)[0]:a;return{path:a,value:a.getTotalLength()}};k.random=function(a,b){return Math.floor(Math.random()*(b-a+1))+a};return k}); -------------------------------------------------------------------------------- /js/imagesloaded.pkgd.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * imagesLoaded PACKAGED v4.1.1 3 | * JavaScript is all like "You images are done yet or what?" 4 | * MIT License 5 | */ 6 | 7 | !function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i img.mirror__img'), 55 | side2: this.el.querySelector('.mirror__side--two > img.mirror__img') 56 | }; 57 | // check possible data-attrs in the DOM element. 58 | if( this.el.getAttribute('data-visible-area') != undefined ) { 59 | this.options.visibleArea = this.el.getAttribute('data-visible-area'); 60 | } 61 | if( this.el.getAttribute('data-layout') != undefined ) { 62 | this.options.layout = this.el.getAttribute('data-layout'); 63 | } 64 | if( this.el.getAttribute('data-tilt') != undefined ) { 65 | this.options.tilt = true; 66 | } 67 | } 68 | 69 | MirrorFx.prototype.options = { 70 | // Animation duration for when showing and hiding the image(s). 71 | duration: {show: 1500, hide: 1000}, 72 | // Animation easing for when showing and hiding the image(s). 73 | easing: {show: 'easeOutExpo', hide: 'easeOutQuint'}, 74 | // horizontal||vertical layout. 75 | layout: 'horizontal', 76 | // This is the amount of the image that is shown. Value goes from 0 to 1. The higher the value the more the image gets revealed. 77 | visibleArea: 1, 78 | // Mousemove functionality. 79 | tilt: false, 80 | // Each image will move from visibleArea and visibleArea*tiltFactor 81 | tiltFactor: 0.6, 82 | // Rotation on the z-axis 83 | tiltRotation: 10 84 | }; 85 | 86 | MirrorFx.prototype._initTilt = function() { 87 | var self = this; 88 | this.imgs.side1.style.WebkitTransition = this.imgs.side2.style.transition = 'transform 0.2s ease-out'; 89 | 90 | this.mousemoveFn = function(ev) { 91 | requestAnimationFrame(function() { 92 | // Mouse position relative to the document. 93 | var mousepos = getMousePos(ev), 94 | // Document scrolls. 95 | docScrolls = {left : document.body.scrollLeft + document.documentElement.scrollLeft, top : document.body.scrollTop + document.documentElement.scrollTop}, 96 | win = {width: window.innerWidth, height: window.innerHeight}, 97 | // Mouse position relative to the main element (this.el). 98 | relmousepos = { x : mousepos.x - docScrolls.left, y : mousepos.y - docScrolls.top }, 99 | 100 | d = self.options.layout === 'horizontal' ? win.width : win.height, 101 | m = self.options.layout === 'horizontal' ? relmousepos.x : relmousepos.y, 102 | tVal = m < d/2 ? 103 | lineEq(self.options.visibleArea, self.options.visibleArea*self.options.tiltFactor, d/2, 0, m) : 104 | lineEq(self.options.visibleArea*self.options.tiltFactor, self.options.visibleArea, d, d/2, m), 105 | 106 | rz = self.options.tiltRotation/win.height*relmousepos.y; 107 | 108 | self.imgs.side1.style.WebkitTransform = self.imgs.side1.style.transform = self.imgs.side2.style.WebkitTransform = self.imgs.side2.style.transform = 'translate' + (self.options.layout === 'horizontal' ? 'X' : 'Y') + '(' + (1-tVal)*100 + '%) rotateZ(' + rz + 'deg)'; 109 | }); 110 | }; 111 | window.addEventListener('mousemove', this.mousemoveFn); 112 | }; 113 | 114 | MirrorFx.prototype._removeTilt = function() { 115 | this.imgs.side1.style.WebkitTransition = this.imgs.side2.style.transition = 'none'; 116 | window.removeEventListener('mousemove', this.mousemoveFn); 117 | }; 118 | 119 | MirrorFx.prototype._animate = function(action, callback) { 120 | this._removeTilt(); 121 | 122 | var opts = { 123 | targets: [this.imgs.side1, this.imgs.side2], 124 | duration: this.options.duration[action], 125 | easing: this.options.easing[action], 126 | opacity: { 127 | value: action === 'show' ? [0,1] : [1,0], 128 | duration: action === 'show' ? this.options.duration[action] : this.options.duration[action]*.5, 129 | easing: this.options.easing[action] 130 | }, 131 | rotateZ: 0 132 | }; 133 | 134 | if( this.options.layout === 'horizontal' ) { 135 | opts.translateX = action === 'show' ? ['100%', Math.ceil((1-this.options.visibleArea)*100) + '%'] : '100%'; 136 | } 137 | else { 138 | opts.translateY = action === 'show' ? ['100%', Math.ceil((1-this.options.visibleArea)*100) + '%'] : '100%'; 139 | } 140 | 141 | var self = this; 142 | 143 | opts.complete = typeof callback === 'function' ? 144 | function() { 145 | callback(); 146 | if( self.options.tilt && action === 'show' ) { 147 | self._initTilt(); 148 | } 149 | } : 150 | function() { 151 | if( self.options.tilt && action === 'show' ) { 152 | self._initTilt(); 153 | } 154 | }; 155 | 156 | anime.remove(this.imgs.side1); 157 | anime.remove(this.imgs.side2); 158 | anime(opts); 159 | }; 160 | 161 | MirrorFx.prototype.show = function(callback) { 162 | this._animate('show', callback); 163 | }; 164 | 165 | MirrorFx.prototype.hide = function(callback) { 166 | this._animate('hide', callback); 167 | }; 168 | 169 | window.MirrorFx = MirrorFx; 170 | 171 | })(window); -------------------------------------------------------------------------------- /js/slideshow.js: -------------------------------------------------------------------------------- 1 | /** 2 | * main.js 3 | * http://www.codrops.com 4 | * 5 | * Licensed under the MIT license. 6 | * http://www.opensource.org/licenses/mit-license.php 7 | * 8 | * Copyright 2017, Codrops 9 | * http://www.codrops.com 10 | */ 11 | ;(function(window) { 12 | 13 | 'use strict'; 14 | 15 | // Helper vars and functions. 16 | function extend( a, b ) { 17 | for( var key in b ) { 18 | if( b.hasOwnProperty( key ) ) { 19 | a[key] = b[key]; 20 | } 21 | } 22 | return a; 23 | } 24 | 25 | function Slideshow(el, options) { 26 | this.el = el; 27 | this.options = extend({}, this.options); 28 | extend(this.options, options); 29 | this.items = [].slice.call(this.el.querySelectorAll('.slide')); 30 | this.itemsTotal = this.items.length; 31 | this.nav = this.el.querySelector('.slideshow__nav'); 32 | this.navitems = [].slice.call(this.nav.querySelectorAll('.btn--nav')); 33 | this.current = 0; 34 | this._init(); 35 | } 36 | 37 | Slideshow.prototype.options = { 38 | duration: {show: 1500, hide: 500}, 39 | delay: {show: 250, hide: 0}, 40 | easing: {show: 'easeOutExpo', hide: 'easeOutExpo'}, 41 | titleAnimation: 'vertical' 42 | }; 43 | 44 | Slideshow.prototype._init = function() { 45 | var self = this; 46 | 47 | // Initialize a MirrorFx instance per item and store the references in an array: 48 | this.mirrorElems = []; 49 | this.items.forEach(function(item) { 50 | self.mirrorElems.push(new MirrorFx(item.querySelector('.mirror'))); 51 | }); 52 | 53 | // Show the first item´s images and title: 54 | this.items[this.current].classList.add('slide--current'); 55 | this.mirrorElems[this.current].show(); 56 | this._showTitle(); 57 | 58 | // Set the current class to the navigation link. 59 | this.navitems[this.current].classList.add('btn--current'); 60 | // Init/Bind the events. 61 | this._initEvents(); 62 | }; 63 | 64 | Slideshow.prototype._showTitle = function(pos) { 65 | this._toggleTitle('show', pos); 66 | }; 67 | 68 | Slideshow.prototype._hideTitle = function(pos) { 69 | this._toggleTitle('hide', pos); 70 | }; 71 | 72 | Slideshow.prototype._toggleTitle = function(action, pos) { 73 | var pos = pos != undefined ? pos : this.current, 74 | title = this.items[pos].querySelector('.slide__title'); 75 | 76 | anime.remove(title); 77 | var opts = { 78 | targets: title, 79 | duration: this.options.duration[action], 80 | easing: this.options.easing[action], 81 | delay: this.options.delay[action], 82 | opacity: action === 'show' ? [0,1] : [1,0] 83 | }; 84 | 85 | if( this.options.titleAnimation === 'vertical' ) { 86 | opts.translateY = action === 'show' ? [50,0] : [0,50]; 87 | } 88 | else { 89 | opts.translateX = action === 'show' ? [50,0] : [0,50]; 90 | } 91 | 92 | anime(opts); 93 | }; 94 | 95 | Slideshow.prototype._initEvents = function() { 96 | var self = this; 97 | 98 | this.navitems.forEach(function(item, pos) { 99 | self._clickNavItem = function(ev) { 100 | if( self.current === pos || self.isAnimating ) { 101 | return false; 102 | } 103 | self.isAnimating = true; 104 | self._navigate(pos); 105 | }; 106 | item.addEventListener('click', self._clickNavItem); 107 | }); 108 | }; 109 | 110 | Slideshow.prototype._navigate = function(pos) { 111 | var self = this, 112 | currentItem = this.items[this.current], 113 | currentItemTitle = currentItem.querySelector('.slide__title'), 114 | nextItem = this.items[pos]; 115 | 116 | this.navitems[this.current].classList.remove('btn--current'); 117 | this.navitems[pos].classList.add('btn--current'); 118 | 119 | this.mirrorElems[this.current].hide(function() { 120 | currentItem.style.opacity = 0; 121 | currentItem.classList.remove('slide--current'); 122 | 123 | self.current = pos; 124 | 125 | self.mirrorElems[self.current].show(); 126 | 127 | nextItem.style.opacity = 1; 128 | nextItem.classList.add('slide--current'); 129 | // Show the next title. 130 | self._showTitle(pos); 131 | 132 | self.isAnimating = false; 133 | }); 134 | 135 | // Hide the current title. 136 | this._hideTitle(); 137 | }; 138 | 139 | window.Slideshow = Slideshow; 140 | 141 | })(window); --------------------------------------------------------------------------------