/
styles.css
58 lines (50 loc) 路 1.01 KB
/
styles.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
/*
quite a decent usage of :after pseude elements in this file
reason: usage of 'content' css property, which only work
in :before/:after pseude elements
*/
.grid {
display: flex;
width: 300px;
height: 300px;
flex-wrap: wrap;
border: 1px solid black;
}
.grid div {
width: 20px;
height: 20px;
}
.shooter:after {
content: "馃";
display: block;
transform: scale(1.5) rotate(40deg);
transition: transform 1s ease-out;
}
body.you-win .shooter:after {
transform: scale(4) rotate(360deg) translateY(-20px);
}
.invader:after {
content: url(covid.png);
display: block;
transform: scale(1);
}
.boom:after {
display: block;
content: "馃挜";
animation: boom .250s ease-out;
}
.laser:after {
content: "馃Щ";
display: block; /* required to make transform work on pseude elements like before or after */
transform: scale(1.3) rotate(-30deg);
}
@keyframes boom {
0% {
transform: scale(0) rotate(0deg) translateY(0);
opacity: 1;
}
100% {
transform: scale(3) rotate(80deg) translateY(2px);
opacity: .8;
}
}