-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.html
62 lines (57 loc) · 1.48 KB
/
shell.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
<html>
<head>
<title>pntr-font: Examples</title>
<style>
html, body {
width: 100vw;
height: 100vh;
margin: 0;
overflow: hidden;
font-family: null0;
}
body {
background: rgb(20, 20, 20);
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
text-align: center;
}
canvas {
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-crisp-edges;
image-rendering: pixelated;
image-rendering: crisp-edges;
object-fit: contain;
}
canvas.landscape {
height: 100vh;
max-width: 100vw;
}
canvas.portrait {
width: 100vw;
max-height: 100vh;
}
</style>
</head>
<body>
<canvas id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas>
<script type='text/javascript'>
const canvas = document.getElementById('canvas')
const onResize = () => {
window.removeEventListener('resize', onResize)
setTimeout(() => { window.addEventListener('resize', onResize) }, 100)
const { clientWidth, clientHeight } = document.body
canvas.className = clientWidth > clientHeight ? 'landscape' : 'portrait'
}
onResize()
window.Module = {
preRun: [],
postRun: [],
print: console.log,
canvas
}
</script>
{{{ SCRIPT }}}
</body>
</html>