-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathindex.html
executable file
·669 lines (633 loc) · 31.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Inspiration for Letter Effects with anime.js | Codrops</title>
<meta name="description" content="An inspirational set of letter animations for display typography powered by anime.js" />
<meta name="keywords" content="typography, animation, effect, web design, javascript, anime.js" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed|Arapey|Archivo+Black|Elsie+Swash+Caps|Playfair+Display|Anton|Rubik|Teko:600|Sacramento|Abril+Fatface|Cormorant+Garamond|Neucha|Unica+One|Old+Standard+TT" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/decolines.css" />
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/lettereffect.css" />
<link rel="stylesheet" type="text/css" href="css/pater.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script>document.documentElement.className = 'js';</script>
</head>
<body class="loading">
<svg class="hidden">
<defs>
<symbol id="icon-arrow" viewBox="0 0 24 24">
<title>arrow</title>
<polygon points="6.3,12.8 20.9,12.8 20.9,11.2 6.3,11.2 10.2,7.2 9,6 3.1,12 9,18 10.2,16.8 "/>
</symbol>
<symbol id="icon-drop" viewBox="0 0 24 24">
<title>drop</title>
<path d="M12,21c-3.6,0-6.6-3-6.6-6.6C5.4,11,10.8,4,11.4,3.2C11.6,3.1,11.8,3,12,3s0.4,0.1,0.6,0.3c0.6,0.8,6.1,7.8,6.1,11.2C18.6,18.1,15.6,21,12,21zM12,4.8c-1.8,2.4-5.2,7.4-5.2,9.6c0,2.9,2.3,5.2,5.2,5.2s5.2-2.3,5.2-5.2C17.2,12.2,13.8,7.3,12,4.8z"/><path d="M12,18.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7c1.3,0,2.4-1.1,2.4-2.4c0-0.4,0.3-0.7,0.7-0.7c0.4,0,0.7,0.3,0.7,0.7C15.8,16.5,14.1,18.2,12,18.2z"/>
</symbol>
<symbol id="icon-cross" viewBox="0 0 24 24">
<title>cross</title>
<path d="M2.9,2.9l18.2,18.2 M2.9,21.1L21.1,2.9 M21.8,20.4L13.4,12l8.4-8.4l-1.4-1.4L12,10.6L3.6,2.2L2.2,3.6l8.4,8.4l-8.4,8.4l1.4,1.4l8.4-8.4l8.4,8.4L21.8,20.4z"/>
</symbol>
</defs>
</svg>
<main>
<header class="codrops-header">
<div class="codrops-links">
<a class="codrops-icon codrops-icon--prev" href="http://tympanus.net/Development/LineMaker/" title="Previous Demo"><svg class="icon icon--arrow"><use xlink:href="#icon-arrow"></use></svg></a>
<a class="codrops-icon codrops-icon--drop" href="http://tympanus.net/codrops/?p=28372" title="Back to the article"><svg class="icon icon--drop"><use xlink:href="#icon-drop"></use></svg></a>
</div>
<h1 class="codrops-header__title">Letter Effects <span>with <a href="http://anime-js.com/">anime.js</a></span></h1>
<a href="https://github.com/codrops/LetterEffects/" class="github-corner">
<svg width="80" height="80" viewBox="0 0 250 250" class="github-icon">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
</svg>
</a>
<button class="btn btn--modal-trigger">Credits</button>
</header>
<section class="content content--c1" id="section1">
<a href="#section1" class="section-link">#1</a>
<div class="slideshow slideshow--1" data-effect="fx1">
<div class="slide slide--current"><h2 class="title title--style-1">Forever</h2></div>
<div class="slide"><h2 class="title title--style-1">Glorious</h2></div>
<div class="slide"><h2 class="title title--style-1">Timeless</h2></div>
<div class="slide"><h2 class="title title--style-1">Love</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger btn--prev">Previous</button>
<button class="btn btn--trigger btn--next">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c2" id="section2">
<a href="#section2" class="section-link">#2</a>
<div class="slideshow slideshow--2" data-effect="fx3">
<div class="slide slide--current"><h2 class="title title--style-2 title--centered">Monday</h2></div>
<div class="slide"><h2 class="title title--style-2 title--centered">Tuesday</h2></div>
<div class="slide"><h2 class="title title--style-2 title--centered">Wednesday</h2></div>
<div class="slide"><h2 class="title title--style-2 title--centered">Thursday</h2></div>
<div class="slide"><h2 class="title title--style-2 title--centered">Friday</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger btn--prev">Previous</button>
<button class="btn btn--trigger btn--next">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c3" id="section3">
<a href="#section3" class="section-link">#3</a>
<div class="slideshow slideshow--3" data-effect="fx2">
<div class="slide slide--current"><h2 class="title title--style-3 title--centered">Freedom</h2></div>
<div class="slide"><h2 class="title title--style-3 title--centered">Equality</h2></div>
<div class="slide"><h2 class="title title--style-3 title--centered">Justice</h2></div>
<div class="slide"><h2 class="title title--style-3 title--centered">Knowledge</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger btn--prev">Previous</button>
<button class="btn btn--trigger btn--next">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c4" id="section4">
<a href="#section4" class="section-link">#4</a>
<div class="slideshow slideshow--4" data-effect="fx4">
<div class="slide slide--current"><h2 class="title title--style-4 title--right">Psycho</h2></div>
<div class="slide"><h2 class="title title--style-4 title--right">Uprising</h2></div>
<div class="slide"><h2 class="title title--style-4 title--right">Revolt</h2></div>
<div class="slide"><h2 class="title title--style-4 title--right">Resistance</h2></div>
<div class="slide"><h2 class="title title--style-4 title--right">Aftermath</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger btn--prev">Previous</button>
<button class="btn btn--trigger btn--next">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c5" id="section5">
<a href="#section5" class="section-link">#5</a>
<div class="slideshow slideshow--5" data-effect="fx5">
<div class="slide slide--current"><h2 class="title title--style-5">Crocodile</h2></div>
<div class="slide"><h2 class="title title--style-5">Koala</h2></div>
<div class="slide"><h2 class="title title--style-5">Cassowary</h2></div>
<div class="slide"><h2 class="title title--style-5">Echidna</h2></div>
<div class="slide"><h2 class="title title--style-5">Kangaroo</h2></div>
<div class="slide"><h2 class="title title--style-5">Dugong</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger btn--prev">Previous</button>
<button class="btn btn--trigger btn--next">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c6" id="section6">
<a href="#section6" class="section-link">#6</a>
<div class="slideshow slideshow--6" data-effect="fx6">
<div class="slide slide--current"><h2 class="title title--style-6">Samoa</h2></div>
<div class="slide"><h2 class="title title--style-6">Hossegor</h2></div>
<div class="slide"><h2 class="title title--style-6">Bali</h2></div>
<div class="slide"><h2 class="title title--style-6">Tofino</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c7" id="section7">
<a href="#section7" class="section-link">#7</a>
<div class="slideshow slideshow--7" data-effect="fx7">
<div class="slide slide--current"><h2 class="title title--style-7">Birth Place: Earth</h2></div>
<div class="slide"><h2 class="title title--style-7">Race: Human</h2></div>
<div class="slide"><h2 class="title title--style-7">Politics: Freedom</h2></div>
<div class="slide"><h2 class="title title--style-7">Religion: Love</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger btn--prev">Previous</button>
<button class="btn btn--trigger btn--next">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c8" id="section8">
<a href="#section8" class="section-link">#8</a>
<div class="slideshow slideshow--8" data-effect="fx8">
<div class="slide slide--current"><h2 class="title title--style-8 title--right">Fennel</h2></div>
<div class="slide"><h2 class="title title--style-8 title--right">Ginger</h2></div>
<div class="slide"><h2 class="title title--style-8 title--right">Cardamom</h2></div>
<div class="slide"><h2 class="title title--style-8 title--right">Turmeric</h2></div>
<div class="slide"><h2 class="title title--style-8 title--right">Garlic</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c9" id="section9">
<a href="#section9" class="section-link">#9</a>
<div class="slideshow slideshow--9" data-effect="fx9">
<div class="slide slide--current"><h2 class="title title--style-9">Begonia</h2></div>
<div class="slide"><h2 class="title title--style-9">Foxglove</h2></div>
<div class="slide"><h2 class="title title--style-9">Tulip</h2></div>
<div class="slide"><h2 class="title title--style-9">Marigold</h2></div>
<div class="slide"><h2 class="title title--style-9">Narcissus</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c10" id="section10">
<a href="#section10" class="section-link">#10</a>
<div class="slideshow slideshow--10" data-effect="fx10">
<div class="slide slide--current"><h2 class="title title--style-10 title--centered">Mercury</h2></div>
<div class="slide"><h2 class="title title--style-10 title--centered">Venus</h2></div>
<div class="slide"><h2 class="title title--style-10 title--centered">Earth</h2></div>
<div class="slide"><h2 class="title title--style-10 title--centered">Mars</h2></div>
<div class="slide"><h2 class="title title--style-10 title--centered">Jupiter</h2></div>
<div class="slide"><h2 class="title title--style-10 title--centered">Saturn</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c11" id="section11">
<a href="#section11" class="section-link">#11</a>
<div class="slideshow slideshow--11" data-effect="fx11">
<div class="slide slide--current"><h2 class="title title--style-11">Keystone</h2></div>
<div class="slide"><h2 class="title title--style-11">North Dakota</h2></div>
<div class="slide"><h2 class="title title--style-11">Seminole</h2></div>
<div class="slide"><h2 class="title title--style-11">Yellowstone</h2></div>
<div class="slide"><h2 class="title title--style-11">Lakehead</h2></div>
<div class="slide"><h2 class="title title--style-11">Enbridge</h2></div>
<div class="slide"><h2 class="title title--style-11">Jayhawk</h2></div>
<div class="slide"><h2 class="title title--style-11">Longhorn</h2></div>
<div class="slide"><h2 class="title title--style-11">Magellan</h2></div>
<div class="slide"><h2 class="title title--style-11">Dixie</h2></div>
<div class="slide"><h2 class="title title--style-11">Calnev</h2></div>
<div class="slide"><h2 class="title title--style-11">Bakken</h2></div>
<div class="slide"><h2 class="title title--style-11">Seaway</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c12" id="section12">
<a href="#section12" class="section-link">#12</a>
<div class="slideshow slideshow--12" data-effect="fx12">
<div class="slide slide--current"><h2 class="title title--style-12">Broccoli</h2></div>
<div class="slide"><h2 class="title title--style-12">Lentils</h2></div>
<div class="slide"><h2 class="title title--style-12">Beans</h2></div>
<div class="slide"><h2 class="title title--style-12">Amaranth</h2></div>
<div class="slide"><h2 class="title title--style-12">Chia Seeds</h2></div>
<div class="slide"><h2 class="title title--style-12">Almonds</h2></div>
<div class="slide"><h2 class="title title--style-12">Asparagus</h2></div>
<div class="slide"><h2 class="title title--style-12">Spirulina</h2></div>
<div class="slide"><h2 class="title title--style-12">Hemp Seeds</h2></div>
<div class="slide"><h2 class="title title--style-12">Edamame</h2></div>
<div class="slide"><h2 class="title title--style-12">Chickpeas</h2></div>
<div class="slide"><h2 class="title title--style-12">Quinoa</h2></div>
<div class="slide"><h2 class="title title--style-12">Pumpkin Seeds</h2></div>
<div class="slide"><h2 class="title title--style-12">Spinach</h2></div>
</div>
<img class="deco-image" src="img/11.png" alt="Broccoli" />
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c13" id="section13">
<a href="#section13" class="section-link">#13</a>
<div class="slideshow slideshow--13" data-effect="fx13">
<div class="slide slide--current"><h2 class="title title--style-13 title--centered">Lakabe</h2></div>
<div class="slide"><h2 class="title title--style-13 title--centered">Suderbyn</h2></div>
<div class="slide"><h2 class="title title--style-13 title--centered">Sachawasi</h2></div>
<div class="slide"><h2 class="title title--style-13 title--centered">Auroville</h2></div>
<div class="slide"><h2 class="title title--style-13 title--centered">Heathcote</h2></div>
<div class="slide"><h2 class="title title--style-13 title--centered">Permacore</h2></div>
<div class="slide"><h2 class="title title--style-13 title--centered">Arcosanti</h2></div>
<div class="slide"><h2 class="title title--style-13 title--centered">Lemulawen</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c14" id="section14">
<a href="#section14" class="section-link">#14</a>
<div class="slideshow slideshow--14" data-effect="fx14">
<div class="slide slide--current"><h2 class="title title--style-14 title--centered">Salvador</h2></div>
<div class="slide"><h2 class="title title--style-14 title--centered">Manaus</h2></div>
<div class="slide"><h2 class="title title--style-14 title--centered">Brasília</h2></div>
<div class="slide"><h2 class="title title--style-14 title--centered">Natal</h2></div>
<div class="slide"><h2 class="title title--style-14 title--centered">Curitiba</h2></div>
<div class="slide"><h2 class="title title--style-14 title--centered">Guarulhos</h2></div>
<div class="slide"><h2 class="title title--style-14 title--centered">Fortaleza</h2></div>
<div class="slide"><h2 class="title title--style-14 title--centered">Recife</h2></div>
<div class="slide"><h2 class="title title--style-14 title--centered">Niterói</h2></div>
<div class="slide"><h2 class="title title--style-14 title--centered">Campinas</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c15" id="section15">
<a href="#section15" class="section-link">#15</a>
<div class="slideshow slideshow--15" data-effect="fx15">
<div class="slide slide--current"><h2 class="title title--style-15">Botanico</h2></div>
<div class="slide"><h2 class="title title--style-15">Native Roots</h2></div>
<div class="slide"><h2 class="title title--style-15">Lightshade</h2></div>
<div class="slide"><h2 class="title title--style-15">Kind Love</h2></div>
<div class="slide"><h2 class="title title--style-15">Silver Stem</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c16" id="section16">
<a href="#section16" class="section-link">#16</a>
<div class="slideshow slideshow--16" data-effect="fx16">
<div class="slide slide--current"><h2 class="title title--style-16 title--centered">Hydrogen</h2></div>
<div class="slide"><h2 class="title title--style-16 title--centered">Radium</h2></div>
<div class="slide"><h2 class="title title--style-16 title--centered">Selenium</h2></div>
<div class="slide"><h2 class="title title--style-16 title--centered">Uranium</h2></div>
<div class="slide"><h2 class="title title--style-16 title--centered">Neon</h2></div>
<div class="slide"><h2 class="title title--style-16 title--centered">Promethium</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c17" id="section17">
<a href="#section17" class="section-link">#17</a>
<div class="slideshow slideshow--17" data-effect="fx17">
<div class="slide slide--current"><h2 class="title title--style-17 title--centered">Violin</h2></div>
<div class="slide"><h2 class="title title--style-17 title--centered">Mandolin</h2></div>
<div class="slide"><h2 class="title title--style-17 title--centered">Sallameh</h2></div>
<div class="slide"><h2 class="title title--style-17 title--centered">Balalaika</h2></div>
<div class="slide"><h2 class="title title--style-17 title--centered">Ukulele</h2></div>
<div class="slide"><h2 class="title title--style-17 title--centered">Nyckelharpa</h2></div>
<div class="slide"><h2 class="title title--style-17 title--centered">Sitar</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<section class="content content--c18" id="section18">
<a href="#section18" class="section-link">#18</a>
<div class="slideshow slideshow--18" data-effect="fx18">
<div class="slide slide--current"><h2 class="title title--style-18 title--centered">Guayaquil</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">Kolkata</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">Bangkok</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">Odessa</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">Guangzhou</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">Mumbai</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">New Orleans</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">Amsterdam</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">Venice</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">Miami</h2></div>
<div class="slide"><h2 class="title title--style-18 title--centered">New York</h2></div>
</div>
<nav class="actions">
<button class="btn btn--trigger">Previous</button>
<button class="btn btn--trigger">Next</button>
</nav>
</section><!-- /content -->
<!-- Related demos -->
<section class="related">
<h3 class="related__title">Related Demos</h3>
<p>If you enjoyed this demo you might also like:</p>
<a class="media-item" href="http://tympanus.net/codrops/2016/03/02/creative-svg-letter-animations/">
<img class="media-item__img" src="img/related/AnimatedLetters.png">
<h3 class="media-item__title">Creative SVG Letter Animations</h3>
</a>
<a class="media-item" href="http://tympanus.net/Development/TextStylesHoverEffects/">
<img class="media-item__img" src="img/related/LinkStyles.jpg">
<h3 class="media-item__title">Text Styles & Hover Effects</h3>
</a>
</section>
</main>
<div class="modal modal--closed">
<div class="modal__overlay"></div>
<div class="modal__content">
<button class="btn btn--close modal__action"><svg class="icon icon--cross"><use xlink:href="#icon-cross"></use></svg></button>
<div class="modal__text">
<h3 class="modal__heading">Credits</h3>
<ul class="modal__list">
<li><a href="http://anime-js.com/">anime.js</a> by Julian Garnier</li>
<li>Images by <a href="http://unsplash.com">Unsplash.com</a> and <a href="http://pngimg.com/">pngimg.com</a></li>
<li><a href="https://github.com/yuanqing/charming">Charming.js</a> by Yuan Qing</li>
<li><a href="http://imagesloaded.desandro.com/">imagesLoaded</a> by Dave DeSandro</li>
<li><a href="http://tympanus.net/codrops/2016/10/12/animated-decorative-lines/">Line Maker</a> by Codrops</li>
</ul>
</div>
</div>
</div>
<!-- Our Sponsor -->
<a class="pater" href="https://goo.gl/E3OUW6" rel="nofollow">
<div class="pater__inner">
<img class="pater__img" src="img/sponsor/hired.png" alt="Hired"/>
<h3 class="pater__title">Get 5+ Job Offers in 1 Week with Hired</h3>
<p class="pater__description">As a talented developer or designer, shouldn’t companies apply to you? Hired empowers you in your job search by giving you transparency into job offers, plus personalized support to ensure your next job is your dream job. <strong>Try Hired Today →</strong></p>
</div>
</a>
<script src="js/charming.min.js"></script>
<script src="js/anime.min.js"></script>
<script src="js/lineMaker.js"></script>
<script src="js/imagesloaded.pkgd.min.js"></script>
<script src="js/textfx.js"></script>
<script>
(function() {
/*
How to use the plugin:
// Initialize
var txt = new TextFx(this.el.querySelector('.title'));
// Show letters:
// txt.show([effect] [,callback]);
// If nothing is passed, then no animation.
// ´effect´ can either be one of the predefined effects: ['fx1',...,'fx17'] or a object literal representing both in and out animations (anime.js based):
// example:
effect = {
in: {
duration: 500,
delay: function(el, index) {
return 250+index*40;
},
easing: 'easeOutExpo',
opacity: 1,
translateY: ['50%','0%']
},
out: {
duration: 500,
delay: function(el, index) {
return index*40;
},
easing: 'easeOutExpo',
opacity: 0,
translateY: '-50%'
}
}
// ´callback´ is the callback function, after all the letters finish the animation.
// Hide letters:
// txt.hide([effect] [,callback]); (same logic of show)
*/
// For demo purposes only:
// Let´s build a simple slideshow to exemplify the TextFx plugin:
// Body element.
var bodyEl = document.body;
// Preload all images..
imagesLoaded(bodyEl, { background: true }, function() {
bodyEl.classList.remove('loading');
});
// Slide obj: each Slideshow´s slide will contain the HTML element and the instance of TextFx.
var Slide = function(el) {
this.el = el;
this.txt = new TextFx(this.el.querySelector('.title'));
},
// The Slideshow obj.
Slideshow = function(el) {
this.el = el;
this.current = 0;
this.slides = [];
var self = this;
[].slice.call(this.el.querySelectorAll('.slide')).forEach(function(slide) {
self.slides.push(new Slide(slide));
});
this.slidesTotal = this.slides.length;
this.effect = this.el.getAttribute('data-effect');
};
Slideshow.prototype._navigate = function(direction) {
if( this.isAnimating ) {
return false;
}
this.isAnimating = true;
var self = this, currentSlide = this.slides[this.current];
this.current = direction === 'next' ? (this.current < this.slidesTotal - 1 ? this.current + 1 : 0) : (this.current = this.current > 0 ? this.current - 1 : this.slidesTotal - 1);
var nextSlide = this.slides[this.current];
var checkEndCnt = 0, checkEnd = function() {
++checkEndCnt;
if( checkEndCnt === 2 ) {
currentSlide.el.classList.remove('slide--current');
nextSlide.el.classList.add('slide--current');
self.isAnimating = false;
}
};
// Call the TextFx hide method and pass the effect string defined in the data-effect attribute of the Slideshow element.
currentSlide.txt.hide(this.effect, function() {
currentSlide.el.style.opacity = 0;
checkEnd();
});
// First hide the next slide´s TextFx text.
nextSlide.txt.hide();
nextSlide.el.style.opacity = 1;
// And now call the TextFx show method.
nextSlide.txt.show(this.effect, function() {
checkEnd();
});
};
Slideshow.prototype.next = function() { this._navigate('next'); };
Slideshow.prototype.prev = function() { this._navigate('prev'); };
function getDecoColor(pos) {
switch(pos) {
case 0 : return '#d9d9e0'; break;
case 2 : return '#171412'; break;
case 6 : return '#87d6b5'; break;
case 11 : return '#CBD6CB'; break;
case 13 : return '#F1D50E'; break;
case 14 : return '#52CA67'; break;
default : return '#fff'; break;
};
}
[].slice.call(document.querySelectorAll('.content')).forEach(function(el, pos) {
var slideshow = new Slideshow(el.querySelector('.slideshow'));
el.querySelector('.actions').firstElementChild.addEventListener('click', function() { slideshow.prev(); });
el.querySelector('.actions').lastElementChild.addEventListener('click', function() { slideshow.next(); });
if( pos === 0 || pos === 2 || pos === 6 || pos === 11 || pos === 13 || pos === 14 ) {
var decoColor = getDecoColor(pos);
new LineMaker({
parent: {element: el, position: 'prepend'},
lines: pos % 2 === 0 ? [
{top: 0, left: '6%', width: 1, height: '100vh', color: decoColor},
{top: 0, left: '26%', width: 1, height: '100vh', color: decoColor},
{top: 0, left: '46%', width: 1, height: '100vh', color: decoColor},
{top: 0, left: '66%', width: 1, height: '100vh', color: decoColor},
{top: 0, left: '86%', width: 1, height: '100vh', color: decoColor}
] : [
{top: '20%', left: 0, width: '100vw', height: 1, color: decoColor},
{top: '40%', left: 0, width: '100vw', height: 1, color: decoColor},
{top: '60%', left: 0, width: '100vw', height: 1, color: decoColor},
{top: '80%', left: 0, width: '100vw', height: 1, color: decoColor}
]
});
}
});
// Credits Modal:
var modal = document.querySelector('.modal'),
modalOverlay = modal.querySelector('.modal__overlay'),
modalCloseCtrl = modal.querySelector('.modal__action'),
modalContent = modal.querySelector('.modal__content'),
inner = modal.querySelector('.modal__text').children;
modalContent.style.WebkitTransform = modalContent.style.transform = 'scale3d(1,0,1)';
modalCloseCtrl.style.opacity = 0;
[].slice.call(inner).forEach(function(el) {
el.style.opacity = 0;
})
// bezier function: https://github.com/arian/cubic-bezier
function bezier(x1, y1, x2, y2, epsilon) {
var curveX = function(t){
var v = 1 - t;
return 3 * v * v * t * x1 + 3 * v * t * t * x2 + t * t * t;
};
var curveY = function(t){
var v = 1 - t;
return 3 * v * v * t * y1 + 3 * v * t * t * y2 + t * t * t;
};
var derivativeCurveX = function(t){
var v = 1 - t;
return 3 * (2 * (t - 1) * t + v * v) * x1 + 3 * (- t * t * t + 2 * v * t) * x2;
};
return function(t){
var x = t, t0, t1, t2, x2, d2, i;
// First try a few iterations of Newton's method -- normally very fast.
for (t2 = x, i = 0; i < 8; i++){
x2 = curveX(t2) - x;
if (Math.abs(x2) < epsilon) return curveY(t2);
d2 = derivativeCurveX(t2);
if (Math.abs(d2) < 1e-6) break;
t2 = t2 - x2 / d2;
}
t0 = 0, t1 = 1, t2 = x;
if (t2 < t0) return curveY(t0);
if (t2 > t1) return curveY(t1);
// Fallback to the bisection method for reliability.
while (t0 < t1){
x2 = curveX(t2);
if (Math.abs(x2 - x) < epsilon) return curveY(t2);
if (x > x2) t0 = t2;
else t1 = t2;
t2 = (t1 - t0) * .5 + t0;
}
// Failure
return curveY(t2);
};
};
var duration = 500, epsilon = (1000 / 60 / duration) / 4, easing1 = bezier(0.1, 1, 0.9, 1, epsilon);
anime.easings['myCustomEasing'] = function(t){ return easing1(t); };
function openCredits() {
modal.classList.remove('modal--closed');
anime({
targets: modalOverlay,
duration: duration,
easing: 'myCustomEasing',
opacity: [0,1]
});
anime({
targets: modalContent,
duration: duration,
easing: 'myCustomEasing',
scaleY: [0,1]
});
anime({
targets: modalCloseCtrl,
duration: 200,
delay: 300,
easing: 'easeOutExpo',
opacity: [0,1]
});
anime({
targets: inner,
duration: 800,
delay: function(el, index) { return 250+index*70; },
opacity: {
easing: 'linear',
value: [0, 1]
},
translateY: {
easing: 'easeOutExpo',
value: [30, 0]
}
});
}
function closeCredits() {
modal.classList.add('modal--closed');
}
document.querySelector('.btn--modal-trigger').addEventListener('click', openCredits);
modalCloseCtrl.addEventListener('click', closeCredits);
var paterEl = document.querySelector('.pater'),
pater = new TextFx(paterEl.querySelector('.pater__title')),
fxPater = {
in: {
duration: 400,
delay: function(el, index) { return 50+index*20; },
easing: 'easeOutExpo',
opacity: 1,
translateY: ['50%','0%']
},
out: {
duration: 400,
delay: function(el, index) {
return index*20;
},
easing: 'easeOutExpo',
opacity: 0,
translateY: '-50%'
}
};
paterEl.addEventListener('mouseenter', function() {
pater.hide();
setTimeout(function() {
pater.show(fxPater);
},60);
});
paterEl.addEventListener('mouseleave', function() {
pater.show();
});
})();
</script>
</body>
</html>