-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
152 lines (140 loc) · 4.59 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Be The Change</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@700&display=swap">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
background: #cb2a34;
}
.label {
display: flex;
justify-content: end;
align-items: center;
width: 60%;
height: 100%;
position: relative;
text-align: right;
padding-right: 40px;
}
.be-the-change {
color: white;
text-transform: uppercase;
line-height: 1.1;
font-family: "Open Sans", sans-serif;
font-size: 35px;
font-weight: 700;
}
.be-the-change span{
color: transparent;
-webkit-text-stroke: 0.7px #fff;
}
.domino {
display: flex;
justify-content: start;
align-items: center;
width: 100%;
height: 100%;
position: relative;
cursor: pointer;
}
.domino-item {
width: 20px;
height: 100px;
background-color: #fff;
margin: 0 5px;
border-radius: 0px;
position: relative;
transform-origin: 100% 100%;
}
.domino-animation {
animation: domino 1s linear forwards;
}
.domino-item:nth-child(1) {
animation-delay: 0s;
animation-duration: 0.8s;
}
.domino-item:nth-child(2) {
animation-delay: 0.1s;
animation-duration: 0.8s;
}
.domino-item:nth-child(3) {
animation-delay: 0.25s;
animation-duration: 0.7s;
}
.domino-item:nth-child(4) {
animation-delay: 0.4s;
animation-duration: 0.6s;
}
.domino-item:nth-child(5) {
animation-delay: 0.6s;
animation-duration: 0.4s;
}
.domino-item:nth-child(6) {
animation-delay: 0.7s;
animation-duration: 0.3s;
}
.domino-item:nth-child(7) {
animation-delay: 0.85s;
animation-duration: 0.2s;
}
.domino-item:nth-child(8) {
background-color: #ededed;
}
@keyframes domino {
15% {
transform: rotate(0);
}
100% {
transform: rotate(var(--tilt-angle));
}
}
</style>
</head>
<body>
<div class="label">
<p class="be-the-change">Be <br>The <br><span>Change</span></p>
</div>
<div class="domino">
<div class="domino-item" style="--tilt-angle: 45deg; margin-right: 7px;"></div>
<div class="domino-item" style="--tilt-angle: 43deg; margin-right: 8px;"></div>
<div class="domino-item" style="--tilt-angle: 40deg; margin-right: 10px;"></div>
<div class="domino-item" style="--tilt-angle: 35deg; margin-right: 16px;"></div>
<div class="domino-item" style="--tilt-angle: 25deg; margin-right: 5px;"></div>
<div class="domino-item" style="--tilt-angle: 20deg; margin-right: 13px;"></div>
<div class="domino-item" style="--tilt-angle: 10deg; margin-right: 12px;"></div>
<div class="domino-item"></div>
<div class="domino-item"></div>
<div class="domino-item"></div>
<div class="domino-item"></div>
<div class="domino-item"></div>
<div class="domino-item"></div>
<div class="domino-item"></div>
<div class="domino-item"></div>
<div class="domino-item"></div>
</div>
<script>
const domino = document.querySelector('.domino');
const dominoItem = document.querySelectorAll('.domino-item');
domino.addEventListener('click', (event) => {
dominoItem.forEach((item) => {
item.classList.add('domino-animation');
});
});
</script>
</body>
</html>