-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
183 lines (161 loc) · 2.99 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
/* GENERAL STYLING */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
input,
textarea,
button,
select,
a,
a:link,
a:visited,
a:hover,
a:active {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
text-decoration: none;
}
/* BODY */
body {
font-family: 'Press Start 2P', cursive;
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background: linear-gradient(to top, rgb(121, 121, 124), rgb(190, 190, 192));
overflow: hidden;
}
/* TITLE */
.title {
margin-bottom: 50px;
font-size: 2.3rem;
text-transform: uppercase;
color: rgb(158, 6, 69);
animation: blink 1s infinite;
animation-timing-function: steps(2);
}
@keyframes blink {
100% {
color: rgb(8, 1, 4);
}
}
/* GAME CANVAS */
.canvas {
position: relative;
width: 350px;
height: 350px;
background: rgb(130, 197, 6);
border-radius: 10px;
box-shadow: inset -10px -10px 50px rgba(0, 0, 0, 0.205),
inset 10px 10px 50px rgba(255, 255, 255, 0.226),
1px 1px 10px rgba(0, 0, 0, 0.342), -1px -1px 10px rgba(255, 255, 255, 0.548);
animation: shine 15s linear infinite;
overflow: hidden;
}
@keyframes shine {
0% {
background: rgb(130, 197, 6);
}
50% {
background: rgb(109, 165, 4);
}
0% {
background: rgb(130, 197, 6);
}
}
/* PLAYER */
.player {
position: absolute;
background: rgb(57, 87, 1);
width: 20px;
height: 20px;
bottom: 30px;
left: 160px;
animation: player-waiting 0.9s infinite;
}
@keyframes player-waiting {
50% {
transform: translateY(6px);
}
}
/* ENEMY */
.enemy {
position: absolute;
background: rgb(85, 129, 3);
width: 60px;
height: 20px;
left: 0px;
top: -30px;
}
/* PLAY BUTTON */
.play-button {
font-family: 'Press Start 2P', cursive;
text-transform: uppercase;
margin-top: 30px;
font-size: 1rem;
background: rgb(48, 47, 47);
color: #fff;
border: none;
padding: 0.5rem 2rem;
border-radius: 3px;
outline: none;
}
.play-button:hover {
background: rgb(66, 65, 65);
}
.play-button:active {
transform: scale(0.9);
background: rgb(0, 0, 0);
}
/* GAME OVER TEXT */
.game-over-text {
position: absolute;
font-size: 1.25rem;
left: 65px;
top: calc(150px - 1.25rem);
text-transform: uppercase;
color: rgb(54, 80, 1);
background: rgba(255, 255, 255, 0.212);
padding: 0.4rem 0.4rem;
animation: game-over-blink 1s steps(2) infinite;
display: none;
}
.game-over-score-text {
position: absolute;
font-size: 1.25rem;
left: 65px;
top: calc(150px + 2rem);
text-transform: uppercase;
color: rgb(54, 80, 1);
padding: 0.4rem 0.4rem;
display: none;
}
@keyframes game-over-blink {
0% {
visibility: hidden;
}
100% {
visibility: visible;
}
}
/* HOW TO TEXT */
.how-to-text {
position: relative;
padding: 3rem;
}
.how-to-text p {
font-size: 0.875rem;
max-width: 30ch;
line-height: 1.5rem;
color: rgb(48, 75, 1);
}
/* SCORE TEXT */
.score-text {
position: absolute;
color: rgba(0, 0, 0, 0.404);
top: 10px;
left: 8px;
}