-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.css
91 lines (79 loc) · 1.35 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
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
/* Font */
@import url('https://fonts.googleapis.com/css2?family=Combo&display=swap');
/* Body styles */
body {
font-family: 'Combo', cursive;
text-align: center;
}
.game {
width: 600px;
height: 200px;
border: 1px solid black;
margin: auto;
}
/* Animating the Trex */
#dino {
width: 50px;
height: 50px;
background-image: url(img/trex.png);
background-size: 50px 50px;
position: relative;
top: 150px;
}
.jump {
animation: jump 0.3s linear;
}
@keyframes jump {
0% {
top: 150px;
}
30% {
top: 130px;
}
50% {
top: 80px;
}
80% {
top: 130px;
}
100% {
top: 150px;
}
}
/* Animating the Cactus */
#cactus {
width: 20px;
height: 40px;
position: relative;
top: 110px;
left: 580px;
background-image: url("img/cactus.png");
background-size: 20px 40px;
}
.cactus-animation {
animation: block 2s infinite linear;
}
@keyframes block {
0% {
left: 580px;
}
100% {
left: -20px;
}
}
/* Controls and buttons div */
.controls {
margin: auto;
align-items: center;
justify-content: center;
text-align: center;
margin-top: 20px;
}
button {
text-align: center;
font-size: 12px;
padding: 8px 15px;
border-radius: 10px;
background-color: rgb(27, 27, 27);
color: aliceblue;
}