-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.css
185 lines (147 loc) · 2.73 KB
/
main.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
/* ==== STRUCTURE ==== */
body {
font-family: 'Roboto Mono', monospace;
font-weight: 600;
text-transform: uppercase;
height: 100vh;
background: #A3A3A3;
}
.title {
display: flex;
justify-content: center;
align-items: center;
font-family: 'Press Start 2P', sans-serif;
margin: 0;
padding: 15px 10px;
text-shadow: 4px 4px #fff;
}
.game-container {
padding: 0 10%;
position: relative;
}
.console-container {
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-around;
margin: 0 auto;
padding: 15px 10px;
max-width: 420px;
}
.console-info {
display: flex;
flex-flow: column nowrap;
}
.score {
margin: 0;
padding: 10px 15px;
background: #9BC702;
border: 3px solid #000;
border-bottom: none;
box-shadow: 4px 4px #000;
}
.console-btns {
display: flex;
flex-flow: row nowrap;
justify-content: center;
align-items: center;
}
.console-btns-center {
display: flex;
flex-flow: column nowrap;
}
.btn {
padding: 10px 15px;
background: #fff;
border: 3px solid #000;
box-shadow: 4px 4px #000;
font-weight: 600;
text-transform: uppercase;
}
.btn:active {
transform: translateY(2px);
box-shadow: 2px 2px #000;
}
.btn-up {
margin-bottom: 10px;
}
.btn-left {
margin-right: 10px;
}
.btn-right {
margin-left: 10px;
}
.btn-arrow {
font-size: 1.5em;
margin: 0;
}
.btn-arrow-left {
transform: rotate(-90deg);
}
.btn-arrow-right {
transform: rotate(90deg);
}
/* ==== SNAKE GAME ==== */
.grid {
display: flex;
flex-flow: row wrap;
margin: auto;
max-width: 420px;
max-height: 420px;
background: #9BC702;
border: 3px solid #000;
box-shadow: 4px 4px #000;
}
.square {
/* 20 per row // matches var 'width' in main.js */
width: 5%;
height: 0;
padding-bottom: 5%;
}
.snake {
background: #000;
box-shadow: 2px 2px #7A9B02;
}
.apple {
background: red;
box-shadow: 2px 2px #7A9B02;
}
.game-over {
font-family: 'Press Start 2P', sans-serif;
position: absolute;
top: 50%;
left: 50%;
transform:translate(-50%, -50%);
z-index: 1;
text-shadow: 2px 2px #7A9B02;
}
.game-over-text {
font-size: 2em;
text-transform: uppercase;
color: #fff;
}
.game-over-hidden {
display: none;
}
footer {
max-width: 420px;
margin: 0 auto;
text-align: center;
}
.instructions {
display: none;
}
.sign-off {
font-size: 0.5rem;
text-transform: lowercase;
color: #ffffff80;
}
/* ==== DESKTOP MEDIA QUERY ==== */
@media screen and (min-height: 676px) {
footer {
margin: 50px auto 0;
}
.instructions {
display: block;
}
}