-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbox-fan.html
372 lines (330 loc) · 9.4 KB
/
box-fan.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
<!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">
<link rel="stylesheet" href="main.css">
<title>CSS Art | Box Fan</title>
</head>
<body>
<style>
*,
*::before,
*::after {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
background: linear-gradient(to top, powderblue, skyblue);
}
.wrapper {
display: grid;
align-items: center;
justify-items: center;
margin: 0;
padding: 0;
min-height: 400px;
height: 100vh;
background: linear-gradient(to top, powderblue, skyblue);
}
.content {
position: relative;
}
.controls {
position: relative;
width: 300px;
z-index: 1;
}
/* handle */
.controls::before {
position: absolute;
right: 50%;
bottom: 0;
width: 80px;
height: 20px;
border: 0.5px solid transparent;
border-right-color: black;
border-top-color: black;
border-top-right-radius: 18px 100%;
border-top-left-radius: 18px 100%;
background: linear-gradient(ivory, cornsilk 97%, black 97% 100%);
clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 90% 100%, 85% 45%, 15% 45%, 10% 100%, 0% 100%);
transform: translateX(50%);
content: '';
}
/* knob */
.controls::after {
position: absolute;
right: 20%;
bottom: 0;
width: 20px;
height: 12px;
border: 0.5px solid transparent;
border-top-color: black;
border-right-color: black;
border-top-right-radius: 8px 100%;
border-top-left-radius: 8px 100%;
background:
linear-gradient(ivory 2px, transparent 3px 97%, black 97% 100%),
linear-gradient(80deg, transparent 15px, lightgrey 15px 16px, transparent 16px),
linear-gradient(90deg, transparent 9px, lightgrey 9px 10px, transparent 10px),
linear-gradient(100deg, transparent 4px, lightgrey 4px 5px, transparent 5px),
linear-gradient(to right, ivory, cornsilk 75%, beige);
content: '';
}
.fan {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 300px;
height: 300px;
box-shadow:
0 0 0 2px lightgrey,
4px 4px 10px 1px black,
inset 4px 4px 10px 3px black;
border-radius: 45px;
background:
linear-gradient(to right, transparent 38%, grey 38% 42%, transparent 42% 58%, grey 58% 62%, transparent 62%),
repeating-linear-gradient(to right, transparent, transparent calc(5% - 5px), beige calc(5% - 5px) calc(5% - 4px), transparent calc(5% - 4px) 5%);
}
/* fan frame */
.fan::before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
border: 9px solid ivory;
border-radius: 45px;
content: ''
}
/* fan grate and screws */
.fan::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 45px;
background:
radial-gradient(circle at 18% 4px, lightgrey, grey 2px, transparent 2px 100%),
radial-gradient(ellipse at 17.5% -1px, ivory 6px, darkgrey 8px, transparent 8px 100%),
radial-gradient(circle at 82% 4px, lightgrey, grey 2px, transparent 2px 100%),
radial-gradient(ellipse at 82.5% -1px, ivory 6px, darkgrey 8px, transparent 8px 100%),
radial-gradient(circle at 4px 50%, lightgrey, grey 2px, transparent 2px 100%),
radial-gradient(circle at 0.5px 49.5%, ivory 6px, darkgrey 8px, transparent 8px 100%),
radial-gradient(circle at calc(100% - 4px) 50%, lightgrey, grey 2px, transparent 2px 100%),
radial-gradient(circle at calc(100% - 0.5px) 49.5%, ivory 6px, darkgrey 8px, transparent 8px 100%),
radial-gradient(circle at 18% calc(100% - 4px), lightgrey, grey 2px, transparent 2px 100%),
radial-gradient(ellipse at 17.5% calc(100% + 1px), ivory 6px, darkgrey 8px, transparent 8px 100%),
radial-gradient(circle at 82% calc(100% - 4px), lightgrey, grey 2px, transparent 2px 100%),
radial-gradient(ellipse at 82.5% calc(100% + 1px), ivory 6px, darkgrey 8px, transparent 8px 100%),
repeating-linear-gradient(to right, transparent, transparent calc(5% - 1.5px), ivory calc(5% - 1.5px) 5%),
repeating-linear-gradient(transparent, transparent calc(2% - 1px), ivory calc(2% - 1px) 2%);
content: '';
}
@keyframes twitch {
0% {
transform: rotate(0deg);
}
15% {
transform: rotate(4deg);
}
25% {
transform: rotate(4deg);
}
40% {
transform: rotate(6deg);
}
50% {
transform: rotate(6deg);
}
80% {
transform: rotate(-5deg);
}
85% {
transform: rotate(-5deg);
}
95% {
transform: rotate(-3deg);
}
99% {
transform: rotate(-1deg);
}
}
.axle {
position: relative;
width: 80px;
height: 80px;
border-radius: 50%;
animation-name: twitch;
animation-duration: 18s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.axle::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: ivory;
box-shadow:
inset 0 0 1px 3px oldlace,
inset 0 0 1px 4px silver,
inset -10px -10px 5px 0 beige,
inset -10px -10px 20px 1px cornsilk,
2px 1px 2px 0px rgba(0, 0, 0, 0.5);
content: '';
}
.blade {
position: absolute;
bottom: 50%;
right: calc(50% - 25px);
width: 50px;
height: 115px;
border-top-left-radius: 40% 60%;
border-top-right-radius: 60% 70%;
border-bottom-left-radius: 50% 40%;
border-bottom-right-radius: 50% 30%;
background: linear-gradient(80deg, ivory, oldlace, cornsilk 70%, burlywood);
transform-origin: bottom;
}
.blade:nth-child(1) {
box-shadow: 2px 1px 2px 0px rgba(0, 0, 0, 0.5);
transform: translateY(-20px);
}
.blade:nth-child(2) {
box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.5);
transform: rotate(72deg) translateY(-20px);
}
.blade:nth-child(3) {
box-shadow: -1px -4px 2px 0px rgba(0, 0, 0, 0.5);
transform: rotate(144deg) translateY(-20px);
}
.blade:nth-child(4) {
box-shadow: -2px 2px 2px 1px rgba(0, 0, 0, 0.5);
transform: rotate(216deg) translateY(-20px);
}
.blade:nth-child(5) {
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.5);
transform: rotate(288deg) translateY(-20px);
}
.feet {
position: relative;
width: 300px
}
.feet::before,
.feet::after {
position: absolute;
top: 0;
width: 15px;
height: 4px;
border-bottom-right-radius: 2px 100%;
border-bottom-left-radius: 2px 100%;
background-color: ivory;
content: '';
}
.feet::before {
right: 80%;
}
.feet::after {
left: 80%;
}
.cord {
position: absolute;
bottom: 0;
left: 100%;
width: 200px;
height: 50px;
border: 3px solid ivory;
border-bottom-color: transparent;
border-left-color: transparent;
border-radius: 50% 50% 50% 0%;
box-shadow: inset -2px 3px 2px 0px rgba(0, 0, 0, 0.5);
transform: translate(-20px, 34%);
}
/* cord loop */
.cord::before {
position: absolute;
top: 0;
right: 50%;
width: 50%;
height: 50%;
border: 3px solid ivory;
border-radius: 50%;
box-shadow:
inset 2px 2px 0px rgba(0, 0, 0, 0.5),
2px 2px 2px 0px rgba(0, 0, 0, 0.5);
transform: translate(65%, -3px);
content: '';
}
.plug {
position: absolute;
right: 0;
bottom: 0;
width: 10px;
height: 13px;
border-radius: 25% 25% 0 0;
background: linear-gradient(blue, navy);
box-shadow: 1px 0px 1px 0px rgba(0, 0, 0, 0.5);
transform-origin: top;
transform: rotate(55deg) translateX(-1px);
}
.plug::after {
position: absolute;
top: 100%;
right: 50%;
width: 13px;
height: 2px;
background-color: navy;
transform: translateX(50%);
content: '';
}
/* tines */
.plug::before {
position: absolute;
top: 100%;
right: 50%;
width: 100%;
height: 10px;
background: linear-gradient(to right, transparent 1px, grey 1px 3px, transparent 3px 7px, grey 7px 9px, transparent 9px);
transform: translateX(50%);
content: '';
}
</style>
<header class="art-page-header">
<a href="index.html" class="app-text-link">
<span>index.html</span>
</a>
</header>
<div class="wrapper">
<div class="content">
<div class="cord">
<div class="plug"></div>
</div>
<div class="controls"></div>
<div class="fan">
<div class="axle">
<div class="blade"></div>
<div class="blade"></div>
<div class="blade"></div>
<div class="blade"></div>
<div class="blade"></div>
</div>
</div>
<div class="feet"></div>
</div>
</div>
</body>
</html>