-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgamewatch.html
More file actions
151 lines (129 loc) · 4.92 KB
/
gamewatch.html
File metadata and controls
151 lines (129 loc) · 4.92 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<script src="./scripts/global.js"></script>
<link rel="stylesheet" href="index-css.css">
<link rel="stylesheet" href="color.css">
<title>Game & Watch Emulator</title>
</head>
<body>
<nav>
<div class="nav-brand">WebEmu</div>
<a href="index.html">Home</a>
<a href="raw.html" class="active">Consoles - Game & Watch Emulator </a>
<a href="collection.html">Collection</a>
<a href="faq.html">FAQ</a>
<div class="nav-right">
<button class="dark-toggle" id="themeToggle">T</button>
</div>
</nav>
<div class="wrap">
<div class="card">
<div class="left">
<div class="brand">
<div class="logo">.mgw</div>
<div class="brand-title">
<span class="title">Game & Watch Emulator</span>
<span class="sub">Whising's Nostalgist.js Build - Game & Watch</span>
</div>
</div>
<div class="cover-wrap" id="coverWrap">
<img class="cover-img" id="coverImg" src="" alt=""/>
<div class="cover-title" id="coverTitle"></div>
</div>
<div class="kbd" id="kbdGrid">
<div class="key"><span>D-Pad</span><span class="char highlight">↑↓←→</span></div>
<div class="key"><span>A</span><span class="char highlight">Z</span></div>
<div class="key"><span>B</span><span class="char highlight">X</span></div>
<div class="key"><span>Time</span><span class="char highlight">A</span></div>
<div class="key"><span>Start</span><span class="char highlight">Enter</span></div>
<div class="key"><span>Fast Forward</span><span class="char highlight">Space</span></div>
<div class="key"><span>Rewind</span><span class="char highlight">R</span></div>
</div>
</div>
<aside>
<div>
<span class="field">ROM File</span>
<div class="file-drop" id="dropZone">
<input type="file" id="romFile" accept=".mgw"/>
<div class="file-drop-inner">
<span>Drop or click to browse</span>
<span>.mgw</span>
</div>
<div class="file-name" id="fileName"></div>
</div>
</div>
<div>
<span class="field">Or URL</span>
<input type="text" id="romUrl" placeholder="https://example.com/game.mgw"/>
</div>
<div class="progress-bar" id="progressBar"><div class="progress-fill"></div></div>
<div id="status-msg"></div>
<button class="btn primary" id="launchBtn">Launch</button>
</aside>
</div>
</div>
<div id="game-topbar">
<div class="topbar-title">
<div class="topbar-dot"></div>
<span id="gameTitle">Game & watch</span>
</div>
<div style="display:flex;gap:8px;align-items:center;">
<button class="close-btn" id="fsBtn" title="Fullscreen (F11)">⛶</button>
<button class="close-btn" id="closeBtn" title="Close (Esc)">✕</button>
</div>
</div>
<div id="controls-overlay">
<div class="overlay-actions">
<div class="vol-group">
<span>Vol</span>
<input type="range" id="volSlider" min="0" max="100" value="80"/>
<span id="volLabel">80%</span>
</div>
<div class="ov-sep"></div>
<button class="ov-btn" id="saveStateBtn">Save State</button>
<button class="ov-btn" id="loadStateBtn">
Load State
<input type="file" id="stateFileInput" accept=".state,.sav,.bin,*"/>
</button>
</div>
<div class="overlay-keys">
<div class="ctrl-item"><kbd class="ctrl-key">↑↓←→</kbd><span>D-Pad</span></div>
<div class="ctrl-sep"></div>
<div class="ctrsl-item"><kbd class="ctrl-key">Z</kbd><span>A</span></div>
<div class="ctrl-item"><kbd class="ctrl-key">X</kbd><span>B</span></div>
<div class="ctrl-item"><kbd class="ctrl-key">A</kbd><span>Time</span></div>
<div class="ctrl-sep"></div>
<div class="ctrl-item"><kbd class="ctrl-key">Enter</kbd><span>Start</span></div>
<div class="ctrl-sep"></div>
<div class="ctrl-item"><kbd class="ctrl-key">Space</kbd><span>Fast Forward</span></div>
<div class="ctrl-item"><kbd class="ctrl-key">R</kbd><span>Rewind</span></div>
</div>
</div>
<script src="https://unpkg.com/nostalgist"></script>
<script src="./scripts/gamewatch-script.js"></script>
<script>
(function () {
const OrigAC = window.AudioContext || window.webkitAudioContext;
if (!OrigAC) return;
const origConnect = AudioNode.prototype.connect;
window.AudioContext = window.webkitAudioContext = function (...args) {
const ctx = new OrigAC(...args);
const gain = ctx.createGain();
origConnect.call(gain, ctx.destination);
window._masterGain = gain;
window._audioCtx = ctx;
AudioNode.prototype.connect = function (dest, ...rest) {
if (dest instanceof AudioDestinationNode) {
return origConnect.call(this, window._masterGain, ...rest);
}
return origConnect.call(this, dest, ...rest);
};
return ctx;
};
})();
</script>
</body>
</html>