-
Notifications
You must be signed in to change notification settings - Fork 0
/
fidget-spinner.html
77 lines (76 loc) · 1.81 KB
/
fidget-spinner.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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<style type="text/css">
:root {
--root-dimension: 15px;
}
body {
margin-top: 100px;
}
.circle {
padding: var(--root-dimension);
position: relative;
border: var(--root-dimension) solid;
margin: 0 auto;
border-radius: 50%;
background-color: white;
}
.parent {
width: var(--root-dimension);
height: var(--root-dimension);
background-color: black;
animation: spin 0.75s infinite linear;
}
.space {
border: 1px solid white;
}
.wing:nth-child(1) {
top: calc(0.5 * 100%);
left: 50%;
}
.wing:nth-child(2) {
bottom: calc(5 * 100%);
left: calc(calc(0.5 * 100%) - calc(5 * 100%));
}
.wing:nth-child(3) {
bottom: calc(calc(13 * 100%) - calc(0.5 * 100%));
left: calc(-0.5 * 100%);
}
.space:nth-child(4) {
bottom: calc(10 * 100%);
left: calc(-1.5 * 100%);
}
.space:nth-child(5) {
bottom: calc(calc(17 * 100%) + 1px);
left: calc(calc(-2.5 * 100%) - 1px);
}
.space:nth-child(6) {
bottom: calc(calc(17.5 * 100%) + 2px);
left: calc(2.5 * 100%);
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="circle parent">
<div class="circle wing"></div>
<div class="circle wing"></div>
<div class="circle wing"></div>
<div class="circle space"></div>
<div class="circle space"></div>
<div class="circle space"></div>
</div>
</body>
</html>