generated from kirbysayshi/game-bucket
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
159 lines (144 loc) · 3.9 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Signal Decay, a JS13K 2020 Game</title>
<meta
name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta
name="apple-mobile-web-app-status-bar-style"
content="black-translucent"
/>
<style>
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
overflow: hidden;
/* background-color:#000; */
background-color: var(--blackRGBA);
position: relative;
height: 100%;
font-family: "Courier New", Courier, monospace;
color: white;
}
canvas,
img {
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-crisp-edges;
image-rendering: pixelated;
image-rendering: crisp-edges;
-webkit-touch-callout: none !important;
-webkit-user-select: none !important;
-o-user-select: none;
user-select: none;
display: block;
}
#r {
position: relative;
margin: 0 auto;
/* border: 1px solid rgba(40, 40, 40, 1); */
}
#u {
position: absolute;
top: 0;
width: 100%;
/* bottom: 0; */
}
:root {
/* Will all be set by JS */
--yellowRGBA: black;
--blackRGBA: black;
--bodyFontSize: 0;
--ctrlPanelHeight: 0;
--ctrlPanelTop: 0;
--ctrlDisplay: none;
--thanksDisplay: none;
}
#ctrl {
position: absolute;
top: var(--ctrlPanelTop);
height: var(--ctrlPanelHeight);
width: 100%;
display: var(--ctrlDisplay);
justify-content: space-around;
}
.ui-stick {
flex: 1 0 0px;
border: 1px solid var(--yellowRGBA);
border-radius: 200%;
margin: 10%;
position: relative;
}
/* https://stackoverflow.com/a/29308459 */
.ui-stick:before {
content: "";
display: block;
padding-top: 100%;
float: left;
}
.ui-nub {
border-radius: 200%;
background-color: var(--yellowRGBA);
--width: 50%;
--height: 50%;
--leftPct: 50%;
--topPct: 50%;
position: absolute;
top: var(--topPct);
left: var(--leftPct);
width: var(--width);
height: var(--height);
margin-left: calc(var(--width) / 2 * -1);
margin-top: calc(var(--height) / 2 * -1);
text-align: center;
color: var(--blackRGBA);
font-size: var(--bodyFontSize);
padding-top: 18%;
}
.ui-btn {
position: absolute;
border: 0;
background-color: var(--yellowRGBA);
color: var(--blackRGBA);
font-size: var(--bodyFontSize);
text-transform: uppercase;
}
#thanks {
position: absolute;
top: var(--ctrlPanelTop);
height: var(--ctrlPanelHeight);
width: 100%;
display: var(--thanksDisplay, none);
text-align: center;
}
#thanks a {
position: static;
}
</style>
</head>
<body>
<div id="r">
<canvas id="c"></canvas>
<div id="u"></div>
<div id="ctrl">
<div id="stick-move" class="ui-stick"><div class="ui-nub">WASD</div></div>
<button id="btn-boost" class="ui-btn" style="top: 10%; padding: 1%;">Boost (Shift)</button>
<button id="btn-reset" class="ui-btn" style="bottom: 0px">
Reset Signal (Enter)
</button>
<div id="stick-rotate" class="ui-stick"><div class="ui-nub">← →</div></div>
</div>
<div id="thanks">
<p><a id="btn-tweet" href="" target="_blank" class="ui-btn">Tweet Your Score</a></p>
</div>
</div>
<script src="bundle.js"></script>
</body>
</html>