-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstyle.css
205 lines (176 loc) · 4.19 KB
/
style.css
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
/* ----- Designed by @Rachit-Pal ----- */
:root {
--u: 1.5vmin;
--clr: #777;
--bg: #444857;
}
body {
margin: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
background-color: #131417;
background-image: linear-gradient(315deg, #131417 0%, #1e1f26 74%);
}
.button {
position: relative;
width: calc(var(--u) * 10);
height: calc(var(--u) * 10);
}
input { display: none; }
label {
background: var(--bg);
width: 100%;
height: 100%;
position: absolute;
border-radius: calc(var(--u) * 1.5);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
label:before {
content: "49";
position: absolute;
min-width: 50%;
left: 25%;
text-align: center;
top: 0;
bottom: 0;
background: var(--bg);
border-radius: calc(var(--u) * 2);
font-size: calc(var(--u) * 2);
font-family: Arial, Helvetica, serif;
padding: calc(var(--u) * 0.5);
box-sizing: border-box;
color: var(--clr);
line-height: calc(var(--u) * 2.25);
z-index: -1;
transition: all 0.5s ease 0s;
animation: counter-bot 1s ease 0s;
}
input:checked + label:before {
content: "50";
color: #fff;
background: #ff3c41;
bottom: inherit;
transition: all 0.5s ease 0s;
animation: counter-top 1s ease 0s;
}
@keyframes counter-top {
70% { top: calc(var(--u) * -4.75); }
}
@keyframes counter-bot {
70% {
top: inherit;
bottom: calc(var(--u) * -5);
}
}
label:after {
content: "";
width: calc(var(--u) * 8);
height: calc(var(--u) * 8);
position: absolute;
border-radius: 100%;
box-sizing: border-box;
z-index: -2;
animation: disc-gray 1s ease 0s, spin-gray 0.65s ease-in-out 0.25s;
transform: rotate(0deg);
--pos: 95%;
background:
radial-gradient(circle at 50% 50%, #fff0 0 62%, var(--bg) 63% 65%, #fff0 66% 100%),
radial-gradient(circle at 50% var(--pos), var(--bg) 0 4%, #fff0 4.5% 100%);
}
@keyframes spin-gray {
100% {
transform: rotate(-360deg);
}
}
@keyframes spin-red {
100% {
transform: rotate(360deg);
}
}
@keyframes disc-gray {
70% {
width: calc(var(--u) * 19);
height: calc(var(--u) * 19);
}
}
@keyframes disc-red {
70% {
width: calc(var(--u) * 19);
height: calc(var(--u) * 19);
}
}
input:checked + label:after {
--bg: #ff3c41;
--pos: 5%;
animation: disc-red 1s ease 0s, spin-red 0.65s ease-in-out 0.25s;
}
label span {
position: absolute;
width: 100%;
height: 100%;
animation: dislike 0.5s ease 0s;
}
/*
label span:before {
content: "";
width: 2px;
height: 2px;
position: absolute;
border-radius: calc(var(--u) * 5);
transform: translate(calc(var(--u) * 2.235), calc(var(--u) * 4.5));
border: calc(var(--u) * 2.71) solid transparent;
border-top: calc(var(--u) * 2.9) solid var(--clr);
}
label span:after {
content: "";
background:
radial-gradient(circle at 40% 45%, var(--clr) 0 calc(var(--u) * 1.25), #fff0 calc(var(--u) * 1.325) 100%),
radial-gradient(circle at 60% 45%, var(--clr) 0 calc(var(--u) * 1.25), #fff0 calc(var(--u) * 1.325) 100%);
width: 100%;
height: 100%;
position: absolute;
}
*/
label span:before {
content: "";
position: absolute;
border-radius: 0.25vmin;
border: 3.6vmin solid #fff0;
border-top: 4vmin solid var(--clr);
margin-top: 7.65vmin;
margin-left: 4vmin;
}
label span:after {
content: "";
position: absolute;
background: var(--clr);
width: 5vmin;
height: 5vmin;
border-radius: 100%;
margin-left: 3.35vmin;
margin-top: 3.5vmin;
box-shadow: 3.5vmin 0 0 0 var(--clr);
}
input:checked + label span {
--clr: #ff3c41;
animation: like 0.5s ease 0s;
}
@keyframes like {
75% { transform: scale(1.25); }
}
@keyframes dislike {
75% { transform: scale(0.75); }
}
.button:hover label span:before, .button:hover label span:after {
--clr: #9d4958;
}
.button:hover input:checked + label span:before, .button:hover input:checked + label span:after {
--clr: #ff3c41;
}