-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcassette-animation.html
294 lines (267 loc) · 7.9 KB
/
cassette-animation.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="CSS animations">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CSS animations</title>
<link rel="stylesheet" href="css/main.min.css">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
</head>
<body>
<div id="loader" aria-hidden="true">Loading...</div>
<input type="checkbox" id="theme" aria-label="theme" title="Theme">
<label for="theme" id="theme-label">Theme</label>
<!--[if lt IE 8]>
<p class="browsehappy">
You are using an <strong>outdated</strong> browser. Please
<a href="#">upgrade your browser</a> to improve your experience.
</p>
<![endif]-->
<div id="wrapper">
<a id="top"></a>
<header id="header">
<a href="/"><span>daug.eu</span><span id="logo"></span></a>
</header>
<button class="toggle-btn" id="menu">menu</button>
<div class="nav">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="tetris-animation.html">tetris animation</a></li>
<li><a href="spining-dots-animation.html">spinning dots animation</a></li>
<li><a href="loader3d-animation.html">loader3d animation</a></li>
<li><a href="lithuania-animation.html">lithuania animation</a></li>
<li><a href="cassette-animation.html">cassette animation</a></li>
<li><a href="box3d-animation.html">box3d animation</a></li>
<li><a href="scale-animation.html">scale animation</a></li>
<li><a href="numbers-animation.html">numbers animation</a></li>
<li><a href="loader-animation.html">loader animation</a></li>
</ul>
</div>
<main class="container">
<article>
<h1 class="title">Cassette Animation</h1>
<div class="block">
<h2>HTML</h2>
<div class="box code">
<pre><div class="cassette">
<div class="cassette__center">
<div class="cassette__center-item"></div>
<div class="cassette__center-divider">l|l|l|l</div>
<div class="cassette__center-item"></div>
</div>
<div class="cassette__bottom"></div>
<div class="cassette__description">
<span class="cassette__description-icon">A</span>
top songs of the '90s
</div>
<div class="cassette__square"></div>
</div></pre>
</div>
</div>
<div class="block">
<h2>CSS</h2>
<div class="box code">
<pre>@keyframes rotateCassette {
to {
transform: rotateZ(360deg)
}
}
.cassette {
height: 158px;
width: 248px;
position: relative;
border-radius: 6px;
overflow: hidden;
box-shadow: 1px 1px 0 1px #777,-1px -1px 0 1px #fff;
font-size: 14px;
top: 0
}
.cassette__bottom {
transform: perspective(100px) rotateX(15deg);
content: "";
height: 24%;
width: 66%;
background: #aaa;
bottom: 0;
left: 17%;
box-shadow: inherit;
border-radius: 3% 3%0 0
}
.cassette__square::after,.cassette__square::before {
content: "";
border-radius: 30%;
background: #333;
bottom: 4%;
box-shadow: -1px -1px 0 0#eee inset;
z-index: 1;
position: absolute;
display: block;
height: 10px;
width: 10px
}
.cassette__square::before {
left: 34%
}
.cassette__square::after {
right: 34%
}
.cassette__description {
position: absolute;
top: 10%;
left: 0;
margin: auto;
bottom: 0;
right: 0;
color: #000;
text-indent: 8%;
z-index: 1
}
.cassette__description-icon {
background: var(--theme-bg-color);
color: var(--theme-text-color);
padding: 1% 2%;
position: relative;
font-weight: 700;
top: 5px;
left: 2px;
margin: 0 10px 0 0
}
.cassette__description::after,.cassette__description::before {
content: "";
position: absolute;
width: 10px;
height: 10px;
border-radius: 50%;
background: #333;
bottom: 2%;
box-shadow: -1px -1px 0 0#eee inset;
z-index: 1
}
.cassette__description::before {
left: 23%
}
.cassette__description::after {
right: 23%
}
.cassette::after {
content: "";
clip-path: polygon(0 0,0 100%,22% 100%,22% 33%,78% 33%,78% 58%,22% 58%,22% 100%,100% 100%,100%0);
height: 100%;
width: 100%;
position: absolute;
left: 0;
top: 0;
background: #aaa
}
.cassette::before,.cassette__bottom,.cassette__center {
position: absolute;
z-index: 1
}
.cassette::before {
background: linear-gradient(transparent 0 10px,#080808 10px 11px,transparent 11px 20px,#080808 20px 21px,transparent 21px 30px,#080808 30px 31px,var(--theme-text-color) 31px 40px,var(--theme-text-color) 40px 51px,var(--theme-base-color) 50px 62px,var(--theme-base-color) 62px) no-repeat 100%/100%#eee;
clip-path: polygon(0 0,0 100%,22% 100%,22% 40%,80% 40%,80% 78%,22% 78%,22% 100%,100% 100%,100%0);
content: "";
width: 88%;
background-clip: content-box;
padding: 0 1%;
height: 66%;
top: 7%;
left: 5%;
overflow: hidden;
border-radius: inherit;
box-shadow: 1px 1px 0#333 inset,-2px -1px 0#fff inset,0 0 0 10px #eee inset
}
.cassette__center,.cassette__center>div {
display: flex;
align-items: center
}
.cassette__center {
width: 60%;
height: 26%;
align-content: center;
margin: 0 auto;
left: 20%;
border-radius: 4px;
top: 32%;
overflow: hidden;
box-shadow: inherit;
background: rgba(17,17,17,.3)
}
.cassette__center>div {
font: 6px Arial;
height: 100%;
flex-direction: row;
justify-content: center;
text-indent: 1em;
letter-spacing: 1em
}
.cassette__center div:nth-child(2) {
background: linear-gradient(#eee 14%,transparent 14%,transparent 50%,#eee 80%);
width: 44%
}
.cassette__center div:nth-child(1),.cassette__center div:nth-child(3) {
background: radial-gradient(circle at center,#777 42%,#fff 43%,#fff 47%,#aaa 48%,#aaa 57%,#eee 60%);
width: 28%
}
.cassette__center div:nth-child(1)::after,.cassette__center div:nth-child(3)::after {
content: "";
background: #000;
border-radius: 50%;
box-sizing: border-box;
margin: auto;
width: 45%;
height: 45%;
box-shadow: 0-12px 0-8px #fff,0 12px 0-8px #fff,-10px -6px 0-8px #fff,10px -6px 0-8px #fff,10px 6px 0-8px #fff,-10px 6px 0-8px #fff
}
.cassette__center::after,.cassette__center::before {
content: "";
position: absolute;
background: repeating-radial-gradient(#4d2410 0 1px,#000 1px 2px) center;
height: 60px;
width: 60px;
z-index: -1;
border-radius: 50%
}
.animation .cassette .cassette__center div:nth-child(1)::after,.animation .cassette .cassette__center div:nth-child(3)::after,.animation .cassette .cassette__center::after,.animation .cassette .cassette__center::before {
animation: rotateCassette 5s linear infinite
}
.cassette__center::before {
right: 0
}</pre>
</div>
</div>
</article>
<aside>
<div class="block">
<h2>Animation</h2>
<div class="ani box state animation">
<div class="cassette">
<div class="cassette__center">
<div class="cassette__center-item"></div>
<div class="cassette__center-divider">l|l|l|l</div>
<div class="cassette__center-item"></div>
</div>
<div class="cassette__bottom"></div>
<div class="cassette__description">
<span class="cassette__description-icon">A</span>
top songs of the '90s
</div>
<div class="cassette__square"></div>
</div>
</div>
</div>
</aside>
</main>
<footer>
<p>2023 by Kostas Šliažas</p>
</footer>
<a href="#top" id="totop">Back to top</a>
</div>
<script src="js/script.min.js" defer></script>
</body>
</html>