-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.css
138 lines (134 loc) · 2.75 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
.heart-switch {
--duration: .45s;
--stroke: #D1D6EE;
--stroke-active: #ec4472;
--fill: #fff;
--fill-active: #ec638e;
--shadow: rgba(0, 9, 61, 0.25);
cursor: pointer;
position: relative;
transform: scale(var(--s, 1)) translateZ(0);
transition: transform 0.2s;
-webkit-tap-highlight-color: transparent;
}
.heart-switch:active {
--s: .95;
}
.heart-switch input {
-webkit-appearance: none;
-moz-appearance: none;
position: absolute;
outline: none;
border: none;
pointer-events: none;
z-index: 1;
margin: 0;
padding: 0;
left: 1px;
top: 1px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #fff;
box-shadow: 0 1px 3px 0 var(--shadow);
}
.heart-switch input + svg {
width: 36px;
height: 25px;
fill: var(--fill);
stroke: var(--stroke);
stroke-width: 1px;
stroke-linejoin: round;
display: block;
transition: stroke var(--duration), fill var(--duration);
}
.heart-switch input:not(:checked) {
-webkit-animation: uncheck var(--duration) linear forwards;
animation: uncheck var(--duration) linear forwards;
}
.heart-switch input:checked {
-webkit-animation: check var(--duration) linear forwards;
animation: check var(--duration) linear forwards;
}
.heart-switch input:checked + svg {
--fill: var(--fill-active);
--stroke: var(--stroke-active);
}
@-webkit-keyframes uncheck {
0% {
transform: rotate(-30deg) translateX(13.5px) translateY(8px);
}
50% {
transform: rotate(30deg) translateX(9px);
}
75% {
transform: rotate(30deg) translateX(4.5px) scaleX(1.1);
}
100% {
transform: rotate(30deg);
}
}
@keyframes uncheck {
0% {
transform: rotate(-30deg) translateX(13.5px) translateY(8px);
}
50% {
transform: rotate(30deg) translateX(9px);
}
75% {
transform: rotate(30deg) translateX(4.5px) scaleX(1.1);
}
100% {
transform: rotate(30deg);
}
}
@-webkit-keyframes check {
0% {
transform: rotate(30deg);
}
25% {
transform: rotate(30deg) translateX(4.5px) scaleX(1.1);
}
50% {
transform: rotate(30deg) translateX(9px);
}
100% {
transform: rotate(-30deg) translateX(13.5px) translateY(8px);
}
}
@keyframes check {
0% {
transform: rotate(30deg);
}
25% {
transform: rotate(30deg) translateX(4.5px) scaleX(1.1);
}
50% {
transform: rotate(30deg) translateX(9px);
}
100% {
transform: rotate(-30deg) translateX(13.5px) translateY(8px);
}
}
html {
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
}
* {
box-sizing: inherit;
}
*:before, *:after {
box-sizing: inherit;
}
body {
min-height: 100vh;
display: flex;
font-family: "Roboto", Arial;
justify-content: center;
align-items: center;
flex-direction: column;
background: #262433;
}
body .heart-switch {
margin: 12px 0;
}