-
Notifications
You must be signed in to change notification settings - Fork 0
/
loader.css
201 lines (183 loc) · 4.37 KB
/
loader.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
:root{
--color-bg: #AD8FFF;
--animation-duration: 2000ms;
--animation-stagger: 80ms;
--hue: 360;
--delay: 0;
--hex: #F46A6C;
--size: 6vw;
}
*{
box-sizing:border-box;
}
body{
background: var(--color-bg);
padding:1rem;
height:100vh;
overflow:hidden;
display:flex;
align-items:center;
justify-content:center;
}
.loader{
display:flex;
align-content:center;
justify-content:center;
/* max-width:50vw; */
width: 100dvw;
height: 100dvh;
background-color: aquamarine;
z-index: 10;
padding: 15vh 0;
.text{
z-index: 13;
position: absolute;
bottom: 10vh;
font-family: sutonnyOMJban, "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
color: cadetblue;
}
}
/* fun (to me) fact: there was a promotional mr freeze pop for batman & robin in 1997 [https://assets.codepen.io/233661/mr-freeze-promotion-box.jpg] */
.mr-freeze{
margin:0 2.5%;
position:relative;
width: var(--size);
max-height:50vh;
aspect-ratio: 1 / 8;
animation: infinite syrup-displacement var(--animation-duration) ease;
animation-delay: var(--delay);
transform-origin:bottom center;
z-index:3;
border:1px solid rgba(255,255,255,.5) ;
border-width: 0 2px;
/* make the pop liquid with a background gradient */
background:
no-repeat bottom 1rem center / 100% 30%
linear-gradient(
hsla( var(--hue), 100%, 50%, 50%),
hsla( var(--hue), 100%, 60%, 50%)
);
}
/* vars for each pop */
.mr-freeze:nth-child(1){
--hue:360;
--hex: #F46A6C;
--delay: calc( var(--animation-stagger) * 1);
}
.mr-freeze:nth-child(2){
--hue:38;
--hex: #FBAD21;
--delay: calc( var(--animation-stagger) * 2);
}
.mr-freeze:nth-child(3){
--hue:48;
--hex: #F7D445;
--delay: calc( var(--animation-stagger) * 3);
}
.mr-freeze:nth-child(4){
--hue:84;
--hex: #9BCC50;
--delay: calc( var(--animation-stagger) * 4);
}
.mr-freeze:nth-child(5){
--hue:194;
--hex:#3AB9DE;
--delay: calc( var(--animation-stagger) * 5);
}
.mr-freeze:nth-child(6){
--hue:290;
--hex:#AC51C0;
--delay: calc( var(--animation-stagger) * 6);
}
/* ice pop pseduo element */
.mr-freeze:before{
--inset: 10%;
content:'';
display:block;
position:absolute;
top: var(--inset);
right: var(--inset);
bottom: 1.5rem;
left: var(--inset);
border: 2px solid var(--hex);
background: var(--hex);
border-radius: 20% / 2%;
pointer-events:none;
opacity:.9;
animation: infinite pop-da-pop var(--animation-duration) ease;
animation-delay: var(--delay);
box-shadow:
inset .25rem .25rem .5rem hsla(40, 100%, 50%, 0.3),
inset -.25rem -.25rem .5rem hsla(200, 100%, 50%, 0.15);
}
/* sleeve pseudo element*/
.mr-freeze:after{
content:'';
display:block;
position:absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background:
no-repeat top center / 100% calc(100% - 1rem)
linear-gradient(
to right,
rgba(255,255,255,.3) ,
rgba(255,255,255,.1) 30%,
rgba(255,255,255,.4) 30%,
rgba(255,255,255,.0)
),
no-repeat bottom 1rem center / 100% 2px
linear-gradient(
to bottom,
rgba(255,255,255,.5),
rgba(255,255,255,.5)
),
no-repeat bottom center / 100% 1rem
linear-gradient(
to bottom,
rgba(255,255,255,.6),
rgba(255,255,255,.4)
);
clip-path:
polygon(
0 0,
100% 0,
100% 100%,
87.5% 99%,
75.0% 100%,
62.5% 99%,
50.0% 100%,
37.5% 99%,
25.0% 100%,
12.5% 99%,
0 100%
);
}
/* keyframes are all magic numbers tweaked by eye */
@keyframes pop-da-pop{
0%, 5%, 95%, 100%{
transform: translateY(0);
}
40%, 60%{
transform: translateY(-50%);
}
50%{
transform: translateY(-48%);
}
}
@keyframes syrup-displacement{
0%, 100%{
background-size: 100% 30%;
}
15%, 85%{
background-size: 100% 32%;
}
30%, 70%{
background-size: 100% 18%;
}
50%{
background-size: 100% 16%;
}
}