-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
61 lines (55 loc) · 1.79 KB
/
style.css
File metadata and controls
61 lines (55 loc) · 1.79 KB
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
/* these css variables hold the main colors so we dont have to retype them everywhere */
:root {
--page-bg: #0e0f18;
--frame-bg: #171a26;
--frame-border: #f3c94a;
}
/* box-sizing border-box means padding wont mess up the width math */
* {
box-sizing: border-box;
}
/* this sets the page background and makes it fill the whole screen */
html,
body {
width: 100%;
min-height: 100%;
margin: 0;
/* the radial gradient gives a soft glow at the top of the page */
background: radial-gradient(circle at 50% 10%, #28324a 0, var(--page-bg) 62%);
color: #f4f1e8;
/* monospace font fits the pixel game look */
font-family: Monaco, Consolas, "Courier New", monospace;
}
/* display grid plus place-items center is the easiest way to center stuff */
body {
display: grid;
place-items: center;
/* overflow hidden stops scroll bars from showing up on the sides */
overflow: hidden;
}
/* game-shell is the gold bordered frame that wraps around the canvas */
/* it keeps the 16 by 9 aspect ratio no matter the window size */
#game-shell {
width: min(100vw, calc(100vh * 16 / 9), 1280px);
aspect-ratio: 16 / 9;
display: grid;
place-items: center;
padding: clamp(6px, 1.2vw, 14px);
background: var(--frame-bg);
/* the yellow border and the inset blue glow make it look like an aracde cabnet */
border: 4px solid var(--frame-border);
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 4px #2e5fd6;
}
/* the important flag forces the canvas to stretch to the shell size */
#game-root,
#game-root canvas {
width: 100% !important;
height: 100% !important;
}
/* pixelated rendering keeps the art sharp and not blury when scaled up */
#game-root canvas {
display: block;
image-rendering: pixelated;
/* crisp-edges is the firefox version of the same thing */
image-rendering: crisp-edges;
}