-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
300 lines (268 loc) · 7.77 KB
/
Copy pathindex.html
File metadata and controls
300 lines (268 loc) · 7.77 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
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SimpleCanvas – Snake Game</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: #080c14;
color: #c5cfe8;
font-family: 'Space Grotesk', sans-serif;
min-height: 100vh;
}
header {
padding: 40px 24px 0;
text-align: center;
}
.badge {
display: inline-block;
background: rgba(57,255,20,0.08);
border: 1px solid rgba(57,255,20,0.25);
color: #39ff14;
font-family: 'Share Tech Mono', monospace;
font-size: 11px;
letter-spacing: 2.5px;
padding: 4px 14px;
border-radius: 20px;
text-transform: uppercase;
margin-bottom: 18px;
}
h1.site-title {
font-size: clamp(38px, 6vw, 68px);
font-weight: 700;
color: #fff;
letter-spacing: -1.5px;
line-height: 1.05;
}
h1.site-title span { color: #39ff14; }
.tagline {
margin-top: 10px;
color: #4a5e72;
font-size: 14px;
font-family: 'Share Tech Mono', monospace;
letter-spacing: 0.5px;
}
.header-links {
margin-top: 22px;
display: flex;
gap: 10px;
justify-content: center;
flex-wrap: wrap;
}
.btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 18px;
border-radius: 6px;
font-size: 13px;
font-weight: 600;
font-family: 'Space Grotesk', sans-serif;
text-decoration: none;
transition: 0.2s;
border: 1.5px solid;
}
.btn-primary {
background: rgba(57,255,20,0.1);
border-color: rgba(57,255,20,0.45);
color: #39ff14;
}
.btn-primary:hover {
background: rgba(57,255,20,0.2);
border-color: #39ff14;
}
.btn-secondary {
background: rgba(255,255,255,0.03);
border-color: rgba(255,255,255,0.1);
color: #8899aa;
}
.btn-secondary:hover {
background: rgba(255,255,255,0.07);
border-color: rgba(255,255,255,0.2);
color: #c5cfe8;
}
/* Canvas */
.canvas-section {
margin-top: 36px;
display: flex;
flex-direction: column;
align-items: center;
}
.canvas-wrapper {
position: relative;
display: inline-block;
border-radius: 12px;
padding: 3px;
background: linear-gradient(135deg, rgba(57,255,20,0.35), rgba(0,180,100,0.12), rgba(57,255,20,0.04));
box-shadow: 0 0 40px rgba(57,255,20,0.08), 0 20px 60px rgba(0,0,0,0.5);
}
#stageGame {
display: block;
border-radius: 10px;
max-width: 100%;
}
/* Controls */
.controls {
margin-top: 18px;
display: flex;
gap: 20px;
justify-content: center;
flex-wrap: wrap;
}
.control-key {
display: flex;
align-items: center;
gap: 8px;
font-family: 'Share Tech Mono', monospace;
font-size: 12px;
color: #4a5e72;
}
.key {
display: inline-flex;
align-items: center;
justify-content: center;
background: #0d1525;
border: 1px solid #1c2d45;
border-bottom: 3px solid #1c2d45;
border-radius: 5px;
padding: 3px 10px;
font-family: 'Share Tech Mono', monospace;
font-size: 11px;
color: #39ff14;
min-width: 34px;
}
/* Info */
.info-section {
max-width: 620px;
margin: 56px auto 0;
padding: 0 24px;
}
.section-label {
font-family: 'Share Tech Mono', monospace;
font-size: 10px;
letter-spacing: 3px;
color: #39ff14;
text-transform: uppercase;
margin-bottom: 14px;
opacity: 0.8;
}
p.description {
font-size: 15px;
line-height: 1.85;
color: #637282;
}
.versions {
margin-top: 36px;
overflow-x: auto;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
}
thead th {
font-family: 'Share Tech Mono', monospace;
font-size: 10px;
letter-spacing: 2.5px;
text-transform: uppercase;
color: #39ff14;
padding: 10px 16px;
text-align: left;
border-bottom: 1px solid rgba(57,255,20,0.18);
opacity: 0.8;
}
tbody td {
padding: 14px 16px;
color: #637282;
border-bottom: 1px solid rgba(255,255,255,0.04);
vertical-align: top;
line-height: 1.6;
}
tbody td:first-child {
color: #c5cfe8;
font-family: 'Share Tech Mono', monospace;
white-space: nowrap;
}
tbody tr:hover td { background: rgba(57,255,20,0.025); }
footer {
margin-top: 64px;
padding: 28px 24px;
text-align: center;
border-top: 1px solid rgba(255,255,255,0.04);
}
footer p {
font-size: 12px;
color: #2e3d50;
font-family: 'Share Tech Mono', monospace;
line-height: 1.8;
}
footer a { color: #39ff14; text-decoration: none; opacity: 0.7; }
footer a:hover { opacity: 1; text-decoration: underline; }
</style>
</head>
<body>
<header>
<div class="badge">open source · canvas 2d engine</div>
<h1 class="site-title">Simple<span>Canvas</span></h1>
<p class="tagline">// a lightweight HTML5 Canvas 2D framework</p>
<div class="header-links">
<a href="https://github.com/samuelsantosdev/SimpleCanvas" class="btn btn-primary">⎇ View on GitHub</a>
<a href="https://github.com/samuelsantosdev/SimpleCanvas/zipball/master" class="btn btn-secondary">↓ Download .zip</a>
<a href="https://github.com/samuelsantosdev/SimpleCanvas/tarball/master" class="btn btn-secondary">↓ Download .tar.gz</a>
</div>
</header>
<main>
<section class="canvas-section">
<div class="canvas-wrapper">
<canvas id="stageGame" width="500" height="500"></canvas>
</div>
<div class="controls">
<div class="control-key"><span class="key">↑ ↓ ← →</span> Move</div>
<div class="control-key"><span class="key">Enter</span> Start / Restart</div>
<div class="control-key"><span class="key">Esc</span> Pause</div>
</div>
</section>
<section class="info-section">
<p class="section-label">// about</p>
<p class="description">
SimpleCanvas is a lightweight HTML5 Canvas 2D engine that simplifies creating
games and interactive graphics. The snake game above demonstrates its animation,
entity, and event systems working together.
</p>
<div class="versions">
<table>
<thead>
<tr><th>Version</th><th>Features</th></tr>
</thead>
<tbody>
<tr>
<td>v0.2</td>
<td>New Engine with singleton concept, code comments, prototype on all metadata, color transition effects, multi-coordinate animations, simple animation system</td>
</tr>
<tr>
<td>v0.1</td>
<td>Render shapes and animate objects — example snake game</td>
</tr>
</tbody>
</table>
</div>
</section>
</main>
<footer>
<p>
<a href="https://github.com/samuelsantosdev/SimpleCanvas">SimpleCanvas</a> is maintained by
<a href="https://github.com/samuelsantosdev">samuelsantosdev</a><br>
Generated by <a href="https://pages.github.com">GitHub Pages</a>
</p>
</footer>
<script src="js/simplecanvas.js"></script>
<script>
const canvas = document.querySelector("#stageGame");
canvas.SimpleCanvas().Initialize();
</script>
</body>
</html>