-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
280 lines (272 loc) · 11.2 KB
/
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
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
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Y42F6Q2CDF"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-Y42F6Q2CDF');
</script>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nintendo World!</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
<script type='text/javascript' src='https://js-dos.com/cdn/js-dos-api.js'></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<nav class="navbar navbar-dark custom-navbar">
<div class="container-fluid">
<span class="navbar-brand h1" style="margin-left: auto; margin-right: auto;">
<h1 class="display-1"><strong>Nintendo World!</strong></h1>
</span>
</div>
</nav>
<nav class="navbar navbar-expand-lg bg-dark">
<div class="container-fluid">
<button class="navbar-toggler" type="button">
<span class="navbar-toggler-icon flex-row "></span>
</button>
<ul class="navbar-nav flex-row ">
<li class="nav-item">
<a class="nav-link active display-7" aria-current="page" href="#nesCardContainer">Nes Games </a>
</li>
<li class="nav-item">
<a class="nav-link display-7" href="#snesCardContainer">SNES Games </a>
</li>
<li class="nav-item">
<a class="nav-link display-7" href="#n64CardContainer">N64 Games </a>
</li>
<li class="nav-item">
<a class="nav-link display-7" href="#sega">SEGA Games </a>
</li>
<li class="nav-item">
<a class="nav-link display-7" href="#psx">Playstation Games </a>
</li>
<li class="nav-item">
<a class="nav-link display-7" href="#dosbox">DOS Games </a>
</li>
</ul>
</div>
</div>
</nav>
<br><br>
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<p class="quote">~ "For young players, classic games are brand new. For older players, they bring back memories
and make you feel good."</p>
</div>
</div>
</div>
<br><br>
<div id="nesCardContainer" class="card-container" style="margin: 0 auto">
<nav class="navbar navbar-dark bg-secondary" style="display: flex; justify-content: center; align-items: center;">
<h2 class="display-5"><strong>Nes Games</strong></h2>
</nav>
</div>
<br><br>
<div id="snesCardContainer" class="card-container" style="margin: 0 auto">
<nav class="navbar navbar-dark bg-secondary" style="display: flex; justify-content: center; align-items: center;">
<h2 class="display-5"><strong>SNES Games</strong></h2>
</nav>
</div>
<br><br>
<div id="n64CardContainer" class="card-container" style="margin: 0 auto">
<nav class="navbar navbar-dark bg-secondary" style="display: flex; justify-content: center; align-items: center;">
<h2 class="display-5"><strong>N64 Games</strong></h2>
</nav>
</div>
<br><br>
<div id="sega" class="card-container" style="margin: 0 auto">
<nav class="navbar navbar-dark bg-secondary" style="display: flex; justify-content: center; align-items: center;">
<h2 class="display-5"><strong>SEGA Games</strong></h2>
</nav>
</div>
<br><br>
<div id="psx" class="card-container" style="margin: 0 auto">
<nav class="navbar navbar-dark bg-secondary" style="display: flex; justify-content: center; align-items: center;">
<h2 class="display-5"><strong>Playstation Games</strong></h2>
</nav>
</div>
<br><br>
<div id="dosbox" class="card-container" style="margin: 0 auto">
<nav class="navbar navbar-dark bg-secondary" style="display: flex; justify-content: center; align-items: center;">
<h2 class="display-5"><strong>DOS Games</strong></h2>
</nav>
</div>
<br><br>
<script>
function createClickableCard(imageName, link, containerId) {
const cardContainer = document.getElementById(containerId);
const cardLink = document.createElement('a');
cardLink.href = '#';
cardLink.className = 'card';
cardLink.onclick = function () {
myfunction(link);
return false;
};
const image = document.createElement('img');
image.src = `images/${imageName}`;
image.className = 'card-img-top';
const cardBody = document.createElement('div');
cardBody.className = 'card-body';
const cardTitle = document.createElement('h5');
cardTitle.className = 'card-title';
cardTitle.textContent = imageName.split('.')[0];
cardBody.appendChild(cardTitle);
cardLink.appendChild(image);
cardLink.appendChild(cardBody);
cardContainer.appendChild(cardLink);
}
async function readCSV(file, containerId) {
const response = await fetch(file);
const text = await response.text();
const rows = text.split('\n');
for (const row of rows) {
const [imageName, link] = row.split(', ');
createClickableCard(imageName, link, containerId);
}
}
readCSV('gameslist/nes.csv', 'nesCardContainer');
readCSV('gameslist/snes.csv', 'snesCardContainer');
readCSV('gameslist/n64.csv', 'n64CardContainer');
readCSV('gameslist/sega.csv', 'sega');
readCSV('gameslist/psx.csv', 'psx');
readCSV('gameslist/dos.csv', 'dosbox');
</script>
<script>
var gameUrl;
function myfunction(id1) {
console.log('App in 1');
var gameUrl = id1;
var extension = id1.split('.').pop();
var core, biosUrl, dosbox;
console.log(extension);
if (['fds', 'nes', 'unif', 'unf'].includes(extension)) {
core = 'nes';
} else if (['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'].includes(extension)) {
core = 'snes';
} else if (['z64', 'n64'].includes(extension)) {
core = 'n64';
} else if (['nds', 'gba', 'gb'].includes(extension)) {
core = 'gba';
} else if (extension === 'md') {
core = 'segaCD';
biosUrl = 'games/SegaCDbios.bin';
} else if (extension === '7z') {
core = 'psx';
biosUrl = 'games/psxbios.7z';
} else if (extension === 'zip') {
document.body.innerHTML = '';
var a = document.createElement('div');
// Get the width and height of the screen
var screenWidth =
window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var screenHeight =
window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
a.style =
"width:" + screenWidth + "px;height:" + screenHeight + "px;max-width:100%;margin: auto;";
var b = document.createElement('div');
b.id = 'dosbox';
a.appendChild(b);
// Create a button to request full screen
var btn = document.createElement('button');
btn.innerHTML = 'Full Screen';
btn.onclick = function () {
dosbox.requestFullScreen();
};
btn.style.marginTop = '10px';
a.appendChild(btn);
document.body.appendChild(a);
dosbox = new Dosbox({
id: 'dosbox',
onload: function (dosbox) {
dosbox.run(gameUrl.split('_')[1], './' + gameUrl.split('_')[0]);
dosbox.requestFullScreen();
},
onrun: function (dosbox, app) {
console.log('App ' + app + ' is runned');
}
});
return;
}
else {
core = prompt('Input core (examples: nes, snes, n64, gb, gba, psx)');
}
document.body.innerHTML = '';
var a = document.createElement('div');
var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var screenHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
a.style = "width:" + screenWidth + "px;height:" + screenHeight + "px;max-width:100%;margin: auto;";
var b = document.createElement('div');
b.id = 'game';
a.appendChild(b);
document.body.appendChild(a);
var script = document.createElement('script');
script.innerHTML = "EJS_player = '#game'; EJS_biosUrl = '" + (biosUrl || '') + "'; EJS_gameUrl = '" + gameUrl + "'; EJS_core = '" + core + "'; EJS_pathtodata = 'data/'; ";
document.body.appendChild(script);
var script = document.createElement('script');
script.src = 'data/loader.js';
document.body.appendChild(script);
}
</script>
<br><br><br>
<div class="d-flex bd-highlight justify-content-center">
<div class="card text-bg-secondary mb-3 custom-card">
<div class="card-header text-center">
<h3>Contact</h3>
</div>
<div class="card-body custom-card-body">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<form action="https://formspree.io/f/mknkakjd" role="form" method="POST" autocomplete="on">
<div class="control-group">
<div class="form-group floating-label-form-group controls">
<input type="text" class="form-control" name="name" placeholder="Name" required>
</div>
</div>
<div class="control-group">
<div class="form-group floating-label-form-group controls">
<input type="email" name="_replyto" id="email-address" placeholder="email@domain.tld" required="">
</div>
<div class="control-group">
<div class="form-group floating-label-form-group controls">
<textarea class="form-control" id="message" name="message" rows="5"
placeholder="Tell me about your query" required></textarea>
</div>
</div>
<br>
<div>
<input type="text" name="_gotcha" style="display:none">
</div>
<div>
<input type="submit" class="btn btn-primary custom-button" value="Send">
<input type="hidden" name="_subject" value="New submission from Nintendo Website!">
</div>
<br>
</form>
</div>
</div>
</div>
</div>
<div class="card-footer text-muted"></div>
</div>
</div>
<script type="text/javascript" src="https://www.freevisitorcounters.com/en/home/counter/1019854/t/1"></script>
<footer class="footer">
<div class="container">
<span class="text-muted"> Copyright @ Anshuman Abhishek - 2021 </span>
<span class="text-muted made-with-love"> Made with ❤️ </span>
</div>
</footer>
</body>
</html>