-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathold.index.html
73 lines (64 loc) · 2.28 KB
/
old.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Pokit3 Handheld Game Console</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="/css/main.css">
</head>
<body>
<canvas id="gamescreen" height="320" width="320"></canvas>
<div id="controls"></div>
<div id="debug_point"></div>
<div id="cart_slot"></div>
<div id='controls'></div>
<script src="/js/lib/screenful/min.js"></script>
<!-- <script type="module" src="/js/main.mjs"></script> -->
<!-- <script type="module" src="/js/init.mjs"></script> -->
<script type="module">
import main from './js/init.mjs';
import { html, render } from 'https://unpkg.com/lit-html/lit-html.js?module'
let powercase_state = 'active';
function controls() {
return html`
<div id="dpad" class="buttongroup">
<button id="pad-left" name="left"></button>
<button id="pad-up" name="up"></button>
<button id="pad-down" name="down"></button>
<button id="pad-right" name="right"></button>
</div>
</div>
<div id="startselect" class="buttongroup">
<button id="startbutton" name="start">START</button>
<button id="selectbutton" name="select" @dblclick='${() => toggle_debug()}'>SELECT</button>
</div>
<div id="rightbuttons" class="buttongroup">
<button id="ybutton" name="y">Y</button>
<button id="xbutton" name="x">X</button>
<button id="bbutton" name="b">B</button>
<button id="abutton" name="a">A</button>
</div>
<div id="metabuttons" class="buttongroup">
<button id="fullscreen" @click='${() => screenfull.toggle()}'>
Fullscreen
</button>
</div>
<div id="powercase_right" class="${powercase_state}"></div>
<div id="powercase_left" class="${powercase_state}">
<button @click='${open_console}'></button>
</div>
`
}
function open_console() {
powercase_state = 'hidden';
let can = document.querySelector('#gamescreen')
render_controls();
}
export default function render_controls() {
render(controls(), document.querySelector('#controls'))
}
render_controls()
main();
</script>
</body>
</html>