-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
80 lines (69 loc) · 3.12 KB
/
index.html
File metadata and controls
80 lines (69 loc) · 3.12 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@600">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<style type="text/css">
iframe {
width: 70vw;
height: 70vh;
margin: auto;
}
.w-fit {
width: fit-content;
}
:root:has(iframe[style*='display: none;']) #fullscreen {
display: none !important;
}
</style>
</head>
<body>
<div class="my-4 d-block mx-auto w-fit">
<div id="game-selection" class="d-inline-block">
<select class="form-select">
<option selected value="none">No Game</option>
<option value="soul-stealer">Soul Stealer</option>
<option value="losing-steam">Losing Steam</option>
<option value="golferbot">GolferBot</option>
<option value="trees-attack">Trees: Attack!</option>
<option value="train-smasher">Train Smasher</option>
<option value="bunbun">BunBun</option>
<option value="ultimate-cat-game">Ultimate Cat Game</option>
<option value="fork-in-the-road">Fork in the Road</option>
<option value="hack-and-smash">Hack and Smash</option>
</select>
</div>
<button class="btn btn-primary ml-3 align-top" style="display: inline-block;" id="fullscreen">Fullscreen</button>
</div>
<iframe src="" credentialless style="display: none;"></iframe>
</body>
</html>
<script>
let select = document.querySelector('select')
select.selectedIndex = 0;
select.addEventListener('change', () => {
if (select.value != 'none') {
document.querySelector('iframe').style.display = 'block';
document.querySelector('iframe').src = `/games/${select.value}/html/index.html`;
}
else {
document.querySelector('iframe').style.display = 'none';
document.querySelector('iframe').src = '';
}
})
document.querySelector('#fullscreen').addEventListener('click', () => {
if (document.querySelector('iframe').display != 'none') {
if (document.fullscreenElement) {
document.exitFullscreen()
}
else {
document.querySelector('iframe').requestFullscreen()
}
}
})
</script>