-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsdos.html
More file actions
361 lines (320 loc) · 11.9 KB
/
Copy pathjsdos.html
File metadata and controls
361 lines (320 loc) · 11.9 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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Beautiful Boot for PC - js-dos Edition</title>
<!-- Load js-dos CSS and JS -->
<link rel="stylesheet" href="https://v8.js-dos.com/latest/js-dos.css">
<script src="https://v8.js-dos.com/latest/js-dos.js"></script>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: #0d0d1b;
color: #e0e0e0;
font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
overflow-x: hidden;
}
header {
width: 100%;
padding: 16px 32px;
background: rgba(13, 13, 27, 0.85);
backdrop-filter: blur(10px);
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2px solid #1f1f3e;
z-index: 10;
}
header h1 {
font-size: 22px;
font-weight: 600;
letter-spacing: 1px;
background: linear-gradient(45deg, #00f2fe, #4facfe);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
#game-wrap {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 24px;
width: 100%;
max-width: 960px;
z-index: 5;
}
#toolbar {
width: 100%;
padding: 10px 32px;
background: rgba(31, 31, 62, 0.6);
border-bottom: 2px solid #1f1f3e;
display: flex;
gap: 12px;
justify-content: flex-start;
flex-wrap: wrap;
z-index: 10;
}
.tool-btn {
padding: 6px 14px;
font-size: 13px;
font-weight: 600;
color: #e0e0e0;
background: #16213e;
border: 1px solid #4facfe;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s ease;
white-space: nowrap;
}
.tool-btn:hover {
background: #4facfe;
color: #0d0d1b;
box-shadow: 0 0 10px rgba(79, 172, 254, 0.3);
}
#dos-container {
width: 640px;
height: 480px;
max-width: 100%;
border: 3px solid #1f1f3e;
border-radius: 12px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(79, 172, 254, 0.15);
background: #000;
overflow: hidden;
margin-bottom: 24px;
}
#dos {
width: 100%;
height: 100%;
}
.info-panel {
width: 100%;
max-width: 640px;
background: rgba(31, 31, 62, 0.4);
border: 1px solid #1f1f3e;
border-radius: 8px;
padding: 16px 20px;
margin-bottom: 20px;
}
.info-panel h2 {
font-size: 16px;
color: #4facfe;
margin-bottom: 8px;
letter-spacing: 0.5px;
}
.info-panel p {
font-size: 13.5px;
line-height: 1.6;
color: #a0a0c0;
}
/* Starfield Background Canvas */
#space-bg {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 1;
pointer-events: none;
}
</style>
</head>
<body>
<!-- Background Animated Starfield -->
<canvas id="space-bg"></canvas>
<header>
<div style="display: flex; align-items: center; gap: 12px;">
<h1>Beautiful Boot PC - js-dos Edition</h1>
<a href="https://github.com/anomixer/beautifulboot-pc" target="_blank" aria-label="GitHub" style="display: flex; align-items: center;">
<svg width="22" height="22" viewBox="0 0 24 24" fill="#e0e0e0">
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.3 3.438 9.8 8.205 11.387.6.113.82-.258.82-.577
0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.757-1.333-1.757
-1.09-.745.083-.729.083-.729 1.205.084 1.84 1.237 1.84 1.237 1.07 1.834 2.807 1.304
3.492.997.108-.775.418-1.305.762-1.605-2.665-.3-5.467-1.332-5.467-5.93
0-1.31.468-2.38 1.235-3.22-.124-.303-.535-1.523.117-3.176 0 0 1.008-.322
3.3 1.23a11.52 11.52 0 0 1 3-.404c1.02.005 2.045.138 3 .404 2.29-1.552
3.297-1.23 3.297-1.23.653 1.653.242 2.873.12 3.176.77.84 1.232 1.91
1.232 3.22 0 4.61-2.807 5.625-5.48 5.92.43.37.814 1.102.814 2.222
0 1.606-.015 2.898-.015 3.293 0 .32.216.694.825.576C20.565 21.796 24 17.298
24 12c0-6.63-5.37-12-12-12z"/>
</svg>
</a>
</div>
<a href="index.html" style="color: #00f2fe; text-decoration: none; border: 2px solid #00f2fe; padding: 6px 16px; border-radius: 20px; font-size: 14px; font-weight: 500; transition: background 0.2s;" onmouseover="this.style.background='#00f2fe'; this.style.color='#0d0d1b';" onmouseout="this.style.background='transparent'; this.style.color='#00f2fe';">← v86 Edition</a>
</header>
<!-- Toolbar for Emulator Control -->
<div id="toolbar">
<button id="btn_pause" class="tool-btn">⏸ Pause</button>
<button id="btn_reset" class="tool-btn">⟳ Reset</button>
<button id="btn_cad" class="tool-btn">Ctrl-Alt-Del</button>
<button id="btn_fullscreen" class="tool-btn">⛶ Fullscreen</button>
<button id="btn_screenshot" class="tool-btn">📷 Screenshot</button>
<button id="btn_mute" class="tool-btn">🔊 Mute</button>
<select id="speed-select" class="tool-btn" style="text-align: center; text-align-last: center;">
<option value="slow">Speed: XT (800)</option>
<option value="fast">Speed: Full Speed</option>
</select>
</div>
<main id="game-wrap">
<div id="dos-container">
<div id="dos"></div>
</div>
<div class="info-panel">
<h2>🎵 Full AdLib & Sound Blaster Support</h2>
<p>
This edition runs inside <strong>js-dos (DOSBox-X WebAssembly)</strong>. Unlike pure browser CPU emulators, js-dos features full AdLib (OPL3 FM Synthesis) and Sound Blaster 16 hardware emulation out-of-the-box. Boot into games like <em>Jumpman Lives!</em> or <em>Friends Software MSX-recompiled games</em> to experience their authentic retro soundscapes!
</p>
</div>
</main>
<script>
let ciInstance = null;
let paused = false;
let muted = false;
function initPlayer() {
const speedMode = localStorage.getItem("bb-speed-mode") || "slow";
document.getElementById("speed-select").value = speedMode;
const jsdosFile = speedMode === "fast" ? "beautiful.jsdos" : "beautiful-xt.jsdos";
Dos(document.getElementById("dos"), {
url: jsdosFile + "?v=" + Date.now(),
kiosk: true,
onEvent: (event, ci) => {
if (event === "ci-ready") {
ciInstance = ci;
paused = false;
muted = false;
document.getElementById("btn_pause").innerHTML = "⏸ Pause";
document.getElementById("btn_mute").innerHTML = "🔊 Mute";
}
}
});
}
// Initialize on load
initPlayer();
// Speed Selector change listener
document.getElementById("speed-select").addEventListener("change", function() {
localStorage.setItem("bb-speed-mode", this.value);
window.location.reload();
});
// Pause/Resume
document.getElementById("btn_pause").addEventListener("click", function() {
if (!ciInstance) return;
if (paused) {
ciInstance.resume();
paused = false;
this.innerHTML = "⏸ Pause";
} else {
ciInstance.pause();
paused = true;
this.innerHTML = "▶ Resume";
}
});
// Reset / Restart (Refreshes the page to prevent Wasm memory leaks/crashes)
document.getElementById("btn_reset").addEventListener("click", function() {
if (!ciInstance) return;
if (confirm("Are you sure you want to reset the emulator?")) {
window.location.reload();
}
});
// Ctrl-Alt-Del (Simulates Ctrl+Alt+Del key combination inside the guest OS, then reloads)
document.getElementById("btn_cad").addEventListener("click", function() {
if (!ciInstance) return;
ciInstance.simulateKeyPress(17, 18, 46);
setTimeout(() => {
window.location.reload();
}, 100);
});
// Fullscreen
document.getElementById("btn_fullscreen").addEventListener("click", function() {
const el = document.getElementById("dos-container");
if (el.requestFullscreen) el.requestFullscreen();
else if (el.webkitRequestFullscreen) el.webkitRequestFullscreen();
});
// Screenshot
document.getElementById("btn_screenshot").addEventListener("click", async function() {
if (!ciInstance) return;
try {
const imgData = await ciInstance.screenshot();
const canvas = document.createElement("canvas");
canvas.width = imgData.width;
canvas.height = imgData.height;
const ctx = canvas.getContext("2d");
ctx.putImageData(imgData, 0, 0);
const link = document.createElement("a");
link.download = "screenshot.png";
link.href = canvas.toDataURL("image/png");
link.click();
} catch (e) {
console.error("Screenshot failed:", e);
}
});
// Mute / Unmute
document.getElementById("btn_mute").addEventListener("click", function() {
if (!ciInstance) return;
if (muted) {
ciInstance.unmute();
muted = false;
this.innerHTML = "🔊 Mute";
} else {
ciInstance.mute();
muted = true;
this.innerHTML = "🔋 Unmute";
}
});
// Starfield Background Animation
const canvas = document.getElementById("space-bg");
const ctx = canvas.getContext("2d");
let width = canvas.width = window.innerWidth;
let height = canvas.height = window.innerHeight;
window.addEventListener("resize", () => {
width = canvas.width = window.innerWidth;
height = canvas.height = window.innerHeight;
});
const stars = [];
for (let i = 0; i < 80; i++) {
stars.push({
x: Math.random() * width,
y: Math.random() * height,
size: Math.random() * 1.5 + 0.5,
speed: Math.random() * 0.5 + 0.1
});
}
function animate() {
ctx.fillStyle = "rgba(13, 13, 27, 0.2)";
ctx.fillRect(0, 0, width, height);
ctx.fillStyle = "#ffffff";
stars.forEach(star => {
ctx.fillRect(star.x, star.y, star.size, star.size);
star.y += star.speed;
if (star.y > height) {
star.y = 0;
star.x = Math.random() * width;
}
});
requestAnimationFrame(animate);
}
animate();
</script>
<footer style="width:100%; padding:10px 24px; background:#0d0d1b; display:flex; align-items:center; gap:10px; border-top:2px solid #1f1f3e; color:#aaa; font-size:14px; z-index:10;">
<span>Powered by <a href="https://js-dos.com/" target="_blank" style="color:#7ecae3; text-decoration:none;">js-dos (DOSBox-X)</a></span>
<a href="https://github.com/caiiiycuk/js-dos" target="_blank" aria-label="GitHub" style="display:flex; align-items:center;">
<svg width="20" height="20" viewBox="0 0 24 24" fill="#aaa">
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.3 3.438 9.8 8.205 11.387.6.113.82-.258.82-.577
0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.757-1.333-1.757
-1.09-.745.083-.729.083-.729 1.205.084 1.84 1.237 1.84 1.237 1.07 1.834 2.807 1.304
3.492.997.108-.775.418-1.305.762-1.605-2.665-.3-5.467-1.332-5.467-5.93
0-1.31.468-2.38 1.235-3.22-.124-.303-.535-1.523.117-3.176 0 0 1.008-.322
3.3 1.23a11.52 11.52 0 0 1 3-.404c1.02.005 2.045.138 3 .404 2.29-1.552
3.297-1.23 3.297-1.23.653 1.653.242 2.873.12 3.176.77.84 1.232 1.91
1.232 3.22 0 4.61-2.807 5.625-5.48 5.92.43.37.814 1.102.814 2.222
0 1.606-.015 2.898-.015 3.293 0 .32.216.694.825.576C20.565 21.796 24 17.298
24 12c0-6.63-5.37-12-12-12z"/>
</svg>
</a>
</footer>
</body>
</html>