1
- * {
1
+ * {
2
2
margin : 0 ;
3
3
padding : 0 ;
4
4
box-sizing : border-box;
5
5
}
6
6
7
- html {
8
- font-size : 65% ;
9
- }
10
- body {
7
+ body {
11
8
height : 100vh ;
12
9
background-color : black;
13
10
display : flex;
14
11
justify-content : center;
15
12
align-items : center;
16
13
}
17
14
18
- .circle {
15
+ .circle {
19
16
width : 40rem ;
20
17
height : 40rem ;
21
- background-color : white ;
18
+ background-color : # 6E6071 ;
22
19
border-radius : 50% ;
23
- box-shadow : 0 0 0 5rem red ;
20
+ box-shadow : 0 0 0 5rem # 282B59 ;
24
21
display : flex;
25
22
justify-content : center;
26
23
align-items : center;
24
+ cursor : pointer;
25
+ transition : background-color 0.5s ease;
27
26
}
28
27
29
- .center {
28
+ .center {
30
29
width : 20rem ;
31
30
height : 20rem ;
32
31
background-color : blue;
33
32
border-radius : 50% ;
34
- box-shadow : 0 0 0 5rem red ;
33
+ box-shadow : 0 0 0 5rem # 282B59 ;
35
34
position : relative;
35
+ transition : all 0.5s ease;
36
36
}
37
37
38
- .arrow {
38
+ .arrow {
39
39
width : 0rem ;
40
40
height : 0rem ;
41
41
position : absolute;
@@ -45,19 +45,95 @@ body{
45
45
left : 0 ;
46
46
}
47
47
48
- .arrow : first-child {
48
+ .arrow : first-child {
49
49
top : 5.5rem ;
50
50
left : 1rem ;
51
51
}
52
52
53
- .arrow : nth-child (2 ){
53
+ .arrow : nth-child (2 ) {
54
54
transform : rotate (68deg );
55
55
left : -3.5rem ;
56
56
top : 3.5rem ;
57
57
}
58
58
59
- .arrow : last-child {
59
+ .arrow : last-child {
60
60
transform : rotate (-68deg );
61
61
left : 5.5rem ;
62
62
top : 3.5rem ;
63
- }
63
+ }
64
+
65
+ @keyframes rotate {
66
+ from {
67
+ transform : rotate (0deg );
68
+ }
69
+ to {
70
+ transform : rotate (360deg );
71
+ }
72
+ }
73
+
74
+ .center : hover {
75
+ animation : rotate 0.5s ease-in-out;
76
+ }
77
+
78
+ @keyframes circleAnimation {
79
+ 0% {
80
+ background-color : # 6E6071 ;
81
+ box-shadow : 0 0 0 5rem # 282B59 ;
82
+ }
83
+ 100% {
84
+ background-color : white;
85
+ box-shadow : 0 0 0 5rem red;
86
+ }
87
+ }
88
+
89
+ @keyframes centerAnimation {
90
+ 0% {
91
+ box-shadow : 0 0 0 5rem # 282B59 ;
92
+ }
93
+ 100% {
94
+ box-shadow : 0 0 0 5rem # ff0000 ;
95
+ }
96
+ }
97
+
98
+ # animationTrigger : checked + .circle {
99
+ animation : circleAnimation 1s ease forwards;
100
+ }
101
+
102
+ # animationTrigger : checked + .circle .center {
103
+ animation : centerAnimation 1s ease forwards;
104
+ }
105
+
106
+ @keyframes colorChange {
107
+ 0% {
108
+ background-color : # 6E6071 ;
109
+ }
110
+ 50% {
111
+ background-color : white;
112
+ }
113
+ 100% {
114
+ background-color : # 6E6071 ;
115
+ }
116
+ }
117
+
118
+ @keyframes boxShadowChange {
119
+ 0% {
120
+ box-shadow : 0 0 0 5rem # 282B59 ;
121
+ }
122
+ 50% {
123
+ box-shadow : 0 0 0 5rem red;
124
+ }
125
+ 100% {
126
+ box-shadow : 0 0 0 5rem # 282B59 ;
127
+ }
128
+ }
129
+
130
+
131
+ input [type = "checkbox" ]: checked + label .circle {
132
+ animation : colorChange 1s ease forwards;
133
+ }
134
+
135
+
136
+ input [type = "checkbox" ]: checked + label .circle {
137
+ animation : boxShadowChange 1s ease forwards;
138
+ }
139
+
0 commit comments