-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathourworldabout.html
More file actions
841 lines (813 loc) · 21.1 KB
/
Copy pathourworldabout.html
File metadata and controls
841 lines (813 loc) · 21.1 KB
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
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>ZeroCat - 关于</title>
<link rel="shortcut icon" href="/img/siteicon.png">
<meta name="description" content="每一行代码都足以改变世界">
<meta name="keyword" content="每一行代码都足以改变世界">
<script type="text/javascript" src="https://unpkg.com/jquery@3.7.1/dist/jquery.js"></script>
</head>
<body>
<div>
<div class="wrap">
<div class="back">
<div class="back__slide active">
<div class="progress"></div>
</div>
<div class="back__slide">
<div class="progress"></div>
<div class="back-front-image"></div>
</div>
</div>
<div class="card">
<div class="card__slide active">
<div class="image"></div><span class="number">01</span><span class="date">悟元喵 <span class="date__time">是 ZeroCat 成员</span></span>
</div>
<div class="card__slide">
<div class="back-image"></div>
<div class="image"></div><span class="number">02</span><span class="date">悟元喵 <span class="date__time">是 ZeroCat 成员</span></span>
</div>
<div class="content">
<div class="content__slide active">
<h2 class="title"> <span class="title__line"> <span class="title__inner">ZeroCat</span></span><br/><span class="title__line"> <span class="title__inner">社区</span></span></h2>
<p class="desc">从前,有一个叫做思快池的池塘,人们每天快乐地在里面玩耍。但有一天,有一些心怀不轨的人在里面种了一种花,叫辱花。这种花会源源不断地释放出两种毒:岗毒和苔毒。之前,这些毒物并没被人接触到,可是有一天,一个矮小的黑影摘下了辱花,将这两种毒释放了出来。有人怀疑这个黑影是来自边城的猫,但未下定论。这些毒物被释放出来之后,开始毒害思快池中快乐游玩着的人们,最终,思快池中的一点毒水被人发现,官员们害怕这点毒水会毒害更多的人们,就把思快池填平了。之前在其中游玩的人们很怀念思快池,所以~就有了这个网站
<br/>——哔哩哔哩 是一刀斩哒<br/>
</p>
<div class="button-wrap"><a class="button tobutton">关于 孙悟元<span class="button__hover"></span></a></div>
</div>
<div class="content__slide">
<h2 class="title"> <span class="title__line"> <span class="title__inner">社区开发者</span></span><br/><span class="title__line"> <span class="title__inner">孙悟元</span></span></h2>
<p class="desc">B站悟元喵<br/>博客:https://wuyuan.dev</p>
<div class="button-wrap"><a class="button tobutton">返回<span class="button__hover"></span></a><a> </a><a href="https://wuyuan.dev" class="button">博客<span class="button__hover"></span></a></div>
</div>
<div class="content__ping content__ping--noanimation"></div>
</div>
</div>
</div>
<style>
* {
-webkit-backface-visibility: hidden;
}
html {
font-size: 1vw;
height: 100vh;
overflow: hidden;
}
@media screen and (min-aspect-ratio: 8/5) {
html {
font-size: 1.5vh;
}
}
body, .wrap {
height: 100vh;
}
.back {
height: 100%;
}
.back__slide {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
background: #1c1c1c;
transition: opacity 300ms 800ms linear;
}
.back__slide .progress {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 0.25rem;
opacity: 0.5;
background: linear-gradient(90deg, #7b29ff, #304ffe);
transform-origin: 0% 50%;
transform: scaleX(0);
}
.back__slide:before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-position: center;
background-size: cover;
}
.back__slide.active {
opacity: 1;
}
.back__slide:nth-child(even) {
background: #ffffff;
}
.back__slide:nth-child(even) .progress {
background: #000000;
transform-origin: 100% 50%;
opacity: 0.5;
}
.back__slide:nth-child(1):before {
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/908370/jelly-back-back.png");
opacity: 0.1;
}
.back__slide:nth-child(2):before {
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/908370/mountain-back-crop2.png");
opacity: 0.2;
background-repeat: no-repeat;
background-size: 101% auto;
background-position: right calc(50% - 14rem);
}
.back__slide:nth-child(2) .back-front-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/908370/mountain-front-crop.png");
background-size: 101% auto;
background-position: center calc(50% + 21rem);
background-repeat: no-repeat;
z-index: 0;
opacity: 0;
transform: translate3d(0, 10rem, 0);
transition: transform 600ms 300ms linear, opacity 300ms 500ms linear;
}
.back__slide:nth-child(2) .back-front-image:after {
content: "";
background: linear-gradient(rgba(255, 255, 255, 0), #ffffff 80%);
display: block;
position: absolute;
left: 0;
top: calc(50% + 20rem);
height: 20.5rem;
width: 100%;
}
.back__slide:nth-child(2).active .back-front-image {
opacity: 0.2;
transform: translate3d(0, 0, 0);
transition: transform 1200ms 1300ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 1300ms linear;
}
.card {
background: rgba(0, 0, 0, 0.2);
position: absolute;
top: 50%;
left: 50%;
transform: translate3d(-50%, -50%, 0);
width: 90rem;
height: 50rem;
background: #000000;
}
.card__slide {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-shadow: 0 0rem 2rem rgba(0, 0, 0, 0);
transition: box-shadow 400ms 400ms linear;
}
.card__slide .number {
opacity: 0;
transform: translatex(-5rem);
transition: transform 600ms 400ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 400ms linear;
}
.card__slide .date {
opacity: 0;
transform: translatex(-5rem) rotate(-90deg);
transition: transform 600ms 400ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 400ms linear;
}
.card__slide.active {
box-shadow: 0 1rem 4rem rgba(0, 0, 0, 0.4);
}
.card__slide.active .number {
opacity: 1;
transform: translatex(0rem);
transition: transform 600ms 900ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 900ms linear;
}
.card__slide.active .date {
opacity: 1;
transform: translatex(0rem) rotate(-90deg);
transition: transform 600ms 900ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 900ms linear;
}
.card__slide.exit .number {
transform: translatex(0rem);
transition: transform 600ms 1000ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 200ms 1000ms linear;
}
.card__slide.exit .date {
transform: translatex(5rem) rotate(-90deg);
}
.card__slide:nth-child(even) {
box-shadow: 0 1rem 4rem rgba(0, 0, 0, 0.2);
}
.card__slide:nth-child(even) .date, .card__slide:nth-child(even) .number {
color: #000000;
}
.card__slide:nth-child(even) .date {
left: 5.5%;
}
.card__slide:nth-child(even) .number {
left: 94.5%;
}
.card__slide:nth-child(even) .date:before {
border-bottom: 0.15rem solid #000000;
}
.card__slide:nth-child(even) .number:before {
border-left: 0.15rem solid #000000;
}
.card__slide:nth-child(even):after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #ffffff;
transform: scaleX(0);
transform-origin: 100% 50%;
transition: transform 500ms 600ms ease-in-out;
}
.card__slide:nth-child(even).active {
box-shadow: 0 1rem 4rem rgba(0, 0, 0, 0.2);
}
.card__slide:nth-child(even).active .number {
opacity: 1;
transition: opacity 200ms 400ms linear;
}
.card__slide:nth-child(even).active .date {
transition: transform 600ms 1200ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 1200ms linear;
}
.card__slide:nth-child(even).active:after {
transform: scaleX(1);
transform-origin: 0% 50%;
}
.card__slide:nth-child(even).exit .date {
transform: translatex(0rem) rotate(-90deg);
}
.card__slide:nth-child(even).exit .number {
transform: translatex(4rem);
transition: transform 600ms 700ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 700ms linear;
}
.card__slide:nth-child(1) .image {
background-image: url("/img/分组 2 (1).png");
background-size: 150% auto;
background-position: center;
background-repeat: no-repeat;
width: 40%;
height: 150%;
position: absolute;
top: 50%;
left: 25%;
transform: translate3d(-55%, -40%, 0);
z-index: 2;
opacity: 0;
}
.card__slide:nth-child(1).active .image {
opacity: 1;
transform: translate3d(-50%, -50%, 0);
transition: transform 1200ms 1000ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 1000ms linear;
}
.card__slide:nth-child(1).exit .image {
transform: translate3d(-45%, -60%, 0);
transition: transform 600ms 300ms linear, opacity 300ms 500ms linear;
}
.card__slide:nth-child(1):after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/908370/jelly-back.png");
background-size: 135% auto;
background-position: center;
opacity: 0.15;
filter: contrast(150%);
}
.card__slide:nth-child(2) {
overflow: hidden;
}
.card__slide:nth-child(2) .image {
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/908370/mountain-front-crop.png");
background-size: 100% auto;
background-position: 50% top;
background-repeat: no-repeat;
width: 100vw;
height: 100%;
position: absolute;
top: 55%;
left: -5vw;
transform: translate3d(0, 20%, 0);
z-index: 2;
opacity: 0;
pointer-events: none;
z-index: 1;
transition: transform 600ms 300ms linear, opacity 300ms 500ms linear;
}
.card__slide:nth-child(2) .back-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/908370/mountain-back-crop2.png");
background-size: 101% auto;
background-position: center 85%;
background-repeat: no-repeat;
z-index: 1;
opacity: 0;
transform: translatey(0);
transition: transform 600ms 300ms linear, opacity 300ms 500ms linear;
}
.card__slide:nth-child(2) .back-image:after {
content: "";
background: linear-gradient(rgba(255, 255, 255, 0), #ffffff 100%);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
height: 50%;
top: 50%;
}
.card__slide:nth-child(2).active .image {
opacity: 1;
transform: translate3d(0, 0, 0);
transition: transform 1200ms 1300ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 1300ms linear;
}
.card__slide:nth-child(2).active .back-image {
opacity: 1;
transform: translatey(-2rem);
transition: transform 1200ms 1000ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms 1000ms linear;
}
.card__slide:nth-child(2).exit .back-image {
transform: translatey(-4rem);
}
.number {
color: #ffffff;
z-index: 1;
font-family: "Roboto Mono", monospace;
font-weight: 500;
letter-spacing: 0.02em;
position: absolute;
left: 5%;
top: calc(50% + 6rem);
}
.number:before {
content: "";
position: absolute;
left: 50%;
transform: translatex(-50%);
bottom: 2.5rem;
display: block;
height: 4rem;
border-left: 0.15rem solid #ffffff;
}
.date {
color: #ffffff;
z-index: 1;
font-family: "Roboto Mono", monospace;
font-weight: 500;
letter-spacing: 0.15em;
position: absolute;
left: 95%;
width: 30%;
top: calc(83% - 0.5rem);
transform-origin: 0 50%;
transform: rotate(-90deg);
}
.date__time {
opacity: 0.25;
}
.date:before {
content: "";
display: inline-block;
transform: translatey(-0.35rem);
width: 4rem;
margin-right: 1.5rem;
border-bottom: 0.15rem solid #ffffff;
}
.content {
position: absolute;
left: 40%;
top: 50%;
transform: translatey(-50%);
width: 44%;
height: 68%;
z-index: 2;
}
.content__ping {
position: absolute;
bottom: 0;
width: 4rem;
transition: transform 500ms ease-out;
}
.content__ping:after {
content: "";
display: block;
height: 0.15rem;
background: #ffffff;
width: 100%;
transition: background 200ms 700ms linear;
-webkit-animation: widenFromLeft 1200ms ease-out;
animation: widenFromLeft 1200ms ease-out;
}
@-webkit-keyframes widenFromLeft {
0% {
transform: scaleX(1);
transform-origin: 0 50%;
}
20% {
transform: scaleX(4);
transform-origin: 0 50%;
}
100% {
transform: scaleX(1);
transform-origin: 0 50%;
}
}
@keyframes widenFromLeft {
0% {
transform: scaleX(1);
transform-origin: 0 50%;
}
20% {
transform: scaleX(4);
transform-origin: 0 50%;
}
100% {
transform: scaleX(1);
transform-origin: 0 50%;
}
}
@-webkit-keyframes widenFromRight {
0% {
transform: scaleX(1);
transform-origin: 100% 50%;
}
20% {
transform: scaleX(4);
transform-origin: 100% 50%;
}
100% {
transform: scaleX(1);
transform-origin: 100% 50%;
}
}
@keyframes widenFromRight {
0% {
transform: scaleX(1);
transform-origin: 100% 50%;
}
20% {
transform: scaleX(4);
transform-origin: 100% 50%;
}
100% {
transform: scaleX(1);
transform-origin: 100% 50%;
}
}
.content__ping--right {
transform: translateX(35.5rem);
}
.content__ping--right:after {
background: #000000;
-webkit-animation: widenFromRight 1200ms ease-out;
animation: widenFromRight 1200ms ease-out;
}
.content__ping--noanimation:after {
-webkit-animation: none !important;
animation: none !important;
}
.content__slide {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.content__slide.active {
pointer-events: auto;
}
.content__slide.active .title__line:before {
transform: scaleX(1);
transition: transform 1000ms cubic-bezier(0.165, 0.84, 0.44, 1);
transition-delay: 1000ms;
}
.content__slide.active .title__line:nth-child(2):before {
transition-delay: 1200ms;
}
.content__slide.active .title__inner, .content__slide.active .desc, .content__slide.active .button-wrap {
opacity: 1;
transform: translatey(0);
}
.content__slide.active .title__inner {
transition-delay: 1600ms;
}
.content__slide.active .desc {
transition-delay: 1800ms;
}
.content__slide.active .button-wrap {
transition-delay: 2000ms;
}
.content__slide.exit .title__inner, .content__slide.exit .desc, .content__slide.exit .button-wrap {
transform: translatey(-2.5rem);
transition: transform 400ms ease-out, opacity 300ms linear;
}
.content__slide.exit .title__inner {
transition-delay: 150ms;
}
.content__slide.exit .desc {
transition-delay: 300ms;
}
.content__slide.exit .button-wrap {
transition-delay: 450ms;
}
.content__slide:nth-child(even) {
text-align: right;
}
.content__slide:nth-child(even) .title, .content__slide:nth-child(even) .desc {
color: #000000;
}
.content__slide:nth-child(even) .button {
background: transparent;
color: #ffffff;
border: 0.15rem solid #000000;
box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.1);
}
.content__slide:nth-child(even) .button:before, .content__slide:nth-child(even) .button:after {
display: none;
}
.content__slide:nth-child(even) .button__hover {
background: #000000;
-webkit-animation: full-rest 10s forwards;
animation: full-rest 10s forwards;
}
@-webkit-keyframes full-rest {
0% {
transform-origin: right center;
transform: scaleX(1);
}
100% {
transform-origin: right center;
transform: scaleX(1);
}
}
@keyframes full-rest {
0% {
transform-origin: right center;
transform: scaleX(1);
}
100% {
transform-origin: right center;
transform: scaleX(1);
}
}
.content__slide:nth-child(even) .button:hover .button__hover {
-webkit-animation: empty-swipe 500ms forwards;
animation: empty-swipe 500ms forwards;
}
@-webkit-keyframes empty-swipe {
0% {
transform-origin: left center;
transform: scaleX(1);
}
50% {
transform-origin: left center;
transform: scaleX(0);
}
51% {
transform-origin: right center;
transform: scaleX(0);
}
100% {
transform-origin: right center;
transform: scaleX(1);
}
}
@keyframes empty-swipe {
0% {
transform-origin: left center;
transform: scaleX(1);
}
50% {
transform-origin: left center;
transform: scaleX(0);
}
51% {
transform-origin: right center;
transform: scaleX(0);
}
100% {
transform-origin: right center;
transform: scaleX(1);
}
}
.content__slide:nth-child(even) .title__line:before {
left: -4rem;
background: #f9f9f9;
transform-origin: 0% 50%;
}
.content__slide:nth-child(even).active .title__line:before {
transform-origin: 100% 50%;
}
.title {
color: #ffffff;
font-size: 5.5rem;
font-family: "Playfair Display", serif;
line-height: 1;
letter-spacing: 0.03em;
margin: 0 0 3.6rem;
}
.title__line {
display: inline-block;
position: relative;
}
.title__line:before {
background: linear-gradient(90deg, #7b29ff, #304ffe);
transform-origin: 100% 50%;
transition: transform 500ms ease-out;
transform: scaleX(0);
content: "";
display: block;
position: absolute;
width: calc(100% + 6rem);
top: 2rem;
left: -2rem;
height: 2rem;
z-index: -1;
}
.title__line:nth-child(2):before {
transition-delay: 200ms;
}
.title__inner {
position: relative;
display: inline-block;
}
.desc {
font-size: 0.8rem;
font-family: "Libre Franklin", sans-serif;
line-height: 1.84;
margin: 0 0 3.6rem;
color: #ffffff;
}
.button {
background: rgba(0, 0, 0, 0.2);
display: inline-block;
font-size: 1rem;
font-family: "Montserrat", sans-serif;
text-transform: uppercase;
line-height: 1;
font-weight: 600;
letter-spacing: 0.1em;
padding: 1.15rem 2rem;
cursor: pointer;
position: relative;
z-index: 2;
color: #ffffff;
border-top: 0.15rem solid #304ffe;
border-bottom: 0.15rem solid #7b29ff;
box-shadow: 0 1rem 2rem rgba(123, 41, 255, 0.2);
transition: transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1);
}
.button:before, .button:after, .button__hover {
content: "";
position: absolute;
top: -1%;
height: 102%;
width: 0.15rem;
background: linear-gradient(#304ffe, #7b29ff);
}
.button:before {
left: 0;
}
.button:after {
right: 0;
}
.button__hover {
left: -1%;
width: 102%;
height: 102%;
z-index: -1;
-webkit-animation: rest 10s forwards;
animation: rest 10s forwards;
}
@-webkit-keyframes rest {
0% {
transform-origin: right center;
transform: scaleX(0);
}
100% {
transform-origin: right center;
transform: scaleX(0);
}
}
@keyframes rest {
0% {
transform-origin: right center;
transform: scaleX(0);
}
100% {
transform-origin: right center;
transform: scaleX(0);
}
}
.button:hover {
transform: translatey(-0.5rem);
}
.button:hover .button__hover {
-webkit-animation: swipe 500ms forwards;
animation: swipe 500ms forwards;
}
@-webkit-keyframes swipe {
0% {
transform-origin: left center;
transform: scaleX(0);
}
50% {
transform-origin: left center;
transform: scaleX(1);
}
51% {
transform-origin: right center;
transform: scaleX(1);
}
100% {
transform-origin: right center;
transform: scaleX(0);
}
}
@keyframes swipe {
0% {
transform-origin: left center;
transform: scaleX(0);
}
50% {
transform-origin: left center;
transform: scaleX(1);
}
51% {
transform-origin: right center;
transform: scaleX(1);
}
100% {
transform-origin: right center;
transform: scaleX(0);
}
}
.title__inner, .desc, .button-wrap {
opacity: 0;
transform: translatey(2.5rem);
position: relative;
transition: transform 800ms cubic-bezier(0.165, 0.84, 0.44, 1), opacity 300ms linear;
}
</style><script>// Design by Catalin V. (@hiskio https://twitter.com/hiskio)
// https://dribbble.com/shots/3408986-Info-Card-Daily-UI-045
const slideElements = ['.back__slide', '.card__slide', '.content__slide'];
let inProgress = false;
const goToSlide = (slideElements, index) => {
if (!inProgress) {
inProgress = true;
$('.active').addClass('exit');
$('.active').removeClass('active');
slideElements.forEach(elem => {
$(`${elem}:nth-child(${index})`).addClass('active');
});
const evenSlide = index % 2 === 0;
if (evenSlide)
$('.content__ping').addClass('content__ping--right');else
$('.content__ping').removeClass('content__ping--right');
$('.content__ping--noanimation').removeClass('content__ping--noanimation');
setTimeout(() => $('.exit').removeClass('exit'), 1000);
setTimeout(() => inProgress = false, 2000);
}
};
$('.content__slide:nth-child(1) .tobutton').on('click', () => goToSlide(slideElements, 2));
$('.content__slide:nth-child(2) .tobutton').on('click', () => goToSlide(slideElements, 1));
setTimeout(() => goToSlide(slideElements, 2), 2000);
setTimeout(() => goToSlide(slideElements, 1), 6000);
// let amount = 0;
// let slide = 0;
// const progress = () => {
// amount++
// $('.active .progress').css('transform', `scaleX(${amount/400})`)
// if (amount >= 400){
// amount = 0;
// $('.active .progress').css('transform', `scaleX(${amount/400})`)
// slide = (slide + 1) % 2 ;
// goToSlide(slideElements, slide + 1);
// clearInterval(progressInterval);
// setTimeout(()=>{
// progressInterval = setInterval(progress,20);
// $('.back__slide:not(.active) .progress').css('transform', 'scaleX(0)')
// }, 2000);
// }
// }
// let progressInterval = setInterval(progress,20);
</script>
</div>
</body>
</html>