-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (41 loc) · 1.44 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="module" src="src/game.ts"></script>
<style>
@font-face {
font-family: 'squaremodern';
src: url('assets/square-webfont.woff2') format('woff2'),
url('assets/webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
h1 {
font-family: squaremodern;
}
</style>
<script>
function downloadCanvas() {
const canvas = document.querySelector('canvas');
const image = canvas.toDataURL('image/png');
const link = document.createElement('a');
link.href = image;
link.download = 'runner-dev-' + Math.floor(Date.now() / 1000) + '.png';
link.click();
}
function addDownloadButton(){
const button = document.createElement('button');
button.innerText = 'Download Canvas';
button.style = "color: white; background-color: black; border: 0px";
button.addEventListener('click', downloadCanvas);
document.body.appendChild(button);
};
</script>
<title>runner -- a cyberpunk escape roguelike</title>
</head>
<!-- <body onload="addDownloadButton()" style="background-color: black; margin: 0px"> -->
<body onload="" style="background-color: black; margin: 0px">
</body>
</html>