-
Notifications
You must be signed in to change notification settings - Fork 22
/
index.html
450 lines (406 loc) · 17.8 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
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Home Menu | Onliine</title>
<link rel="manifest" href="manifest.json">
<link rel="shortcut icon" href="assets/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="css/style.css" />
<script src="js/script.js"></script>
<script src="js/jquery.js"></script>
<script src="js/howler.min.js"></script>
<script src="js/homemenu.js"></script>
<script src="js/audio.js"></script>
<script src="js/config.js"></script>
<script src="js/channels.js"></script>
<meta property="og:site_name" content="Onliine" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Onliine Web" />
<meta property="og:description" content="Wii System simulator based on the latest version released by Nintendo" />
<meta id="meta-image" property="og:image" itemprop="image" content="" />
<link rel="apple-touch-icon" href="" />
<meta name="author" content="JerosGamer89" />
<meta name="description" content="Wii System simulator based on the latest version released by Nintendo">
<meta name="keywords" content="riimake,onliine,wii,homebrew,wii simulator,wii menu,wii web" />
<meta name="theme-color" content="#222222" />
<meta name="apple-mobile-web-app-status-bar" content="#222222" />
<script>
// Add channels that user has in their channel storage.
window.addEventListener('load', () => {
// For each user channel
// (userChannels is defined in 'config.js')
for (const channel of userChannels) {
// Send info to makeChannel
makeChannel(channel);
}
mainchannelsset = true;
});
// Start the clock
startDateTime();
// Vars
var currentMenuPage = 1;
var info,
mainchannelsset;
</script>
</head>
<body>
<div class="splash">
<div class="warning">
<div class="warning-container">
<div class="text">
<h2><div class="warn-icon">⚠ </div>WARNING-HEALTH AND SAFETY</h3>
<p class="desc">
BEFORE PLAYING, READ YOUR OPERATIONS MANUAL
FOR IMPORTANT INFORMATION ABOUT YOUR HEALTH
AND SAFETY.
</p>
<p class="bottom">
Also online at<br>
<a href="">www.nintendo.com/healthsafety</a>
</p>
</div>
<span>Press left click to continue.</span>
</div>
</div>
<script>
// If location includes the "skipwarn" thingy, then skip the warning screen
if (document.location.search.includes('skipwarn')) {
startup('skipwarn');
// Else, show the regular warning scene
} else {
// Wait for the "Press left click" thingy to appear 'cuz that's how the Wii menu works (i think)
setTimeout(() => {
document.querySelector('.splash .warning').addEventListener('click', startup, true);
}, 3000);
}
</script>
<div class="welcomeback disabled">
<img src="assets/return.gif" class="channels" />
<span class="tip"><strong>PRO TIP:</strong> Right-click to open the Wii pause menu</span>
</div>
</div>
<div class="main-menu disabled">
<div class="grid">
<div class="prev">
<img src="assets/prev-default.png" class="def" />
<img src="assets/prev-hover.png" class="hover" />
</div>
<div class="ch-c">
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
</div>
<div class="ch-c">
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
<div class="ch blank"></div>
</div>
<div class="next">
<img src="assets/next-hover.png" class="hover" />
<img src="assets/next-default.png" class="def" />
</div>
</div>
<!-- show special electron download channel -->
<script>
if (info == undefined && ifPWA() == false) {
let tempinterval = setInterval(() => {
if (mainchannelsset) {
makeChannel({
assets: "assets/channels/",
channelart: "channelart/",
id: "electron",
title: "Onliine Desktop",
target: "https://github.com/ktg5/onliine-electron/releases/latest"
});
document.querySelector('[data-id="electron"]').setAttribute('data-special', true)
clearInterval(tempinterval);
} else {
return;
}
}, 100);
}
</script>
<div class="bottom-bar">
<div class="lateral left">
<img src="assets/left-button.png" class="left-btn" />
<img src="assets/wii-button.png" class="wii-btn buttonlike" onclick="playSFX('button-select-big.mp3', userConfig.sfxVol)" />
<span class="tag">Wii Settings</span>
</div>
<div class="info">
<span class="jg">Onliine</span>
<span id="hour"></span>
<span id="date"></span>
</div>
<div class="lateral right">
<img src="assets/right-button.png" class="right-btn" />
<img src="assets/mail-button.png" class="diary-btn buttonlike" onclick="playSFX('button-select-big.mp3', userConfig.sfxVol)" />
<span class="tag">Wii Message Board</span>
</div>
</div>
</div>
<div class="msgboard">
<div class="bg"></div>
<div class="card buttonlike" onclick="playSFX('letter-in.mp3', userConfig.sfxVol)">
<img src="assets/petermiiffin-head.png" class="mii" /><br>
<span>Hello Lois</span>
</div>
<div class="opened">
<div class="memo">
<span class="title">Memo</span>
<img src="assets/petermiiffin-head.png" class="mii" title="Peter Miiffin lol" />
<div class="lines">
<span>This is a nice sample letter,</span>
<span>with multiple lines.</span>
</div>
</div>
<a class="alt-btn back" onmouseover="playSFX('button-hover.mp3', userConfig.sfxVol)">Back</a>
</div>
<div class="bottom">
<span id="date2"></span>
<div class="lateral">
<img src="assets/right-button.png" class="right-btn" />
<img src="assets/backtomenu.png" class="back-btn backtowiimenu buttonlike" onclick="playSFX('button-select-big.mp3', userConfig.sfxVol)" />
<span class="tag">Wii Menu</span>
</div>
</div>
</div>
<div class="ch-selection">
<div class="thecontent">
<div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div>
<img id="videoSpec" src="" />
<div class="buttons">
<a class="buttonlike" onmouseover="playSFX('button-hover.mp3', userConfig.sfxVol)" onclick="menuReturn()">Wii Menu</a>
<a class="buttonlike letsago" onmouseover="playSFX('button-hover.mp3', userConfig.sfxVol)" onclick="start()">Start</a>
</div>
</div>
</div>
<div class="settings">
<div class="settings-content">
<div class="topbar">
<img src="assets/wii-logo.svg" />
</div>
<div class="cells">
<a class="info buttonlike" href="/credits" onmouseover="playSFX('button-hover.mp3', userConfig.sfxVol)" target="_blank"></a>
<a class="stngs buttonlike" href="/settings" onmouseover="playSFX('button-hover.mp3', userConfig.sfxVol)"></a>
</div>
<div class="bottombar">
<a class="alt-btn close" onmouseover="playSFX('button-hover.mp3', userConfig.sfxVol)">Back</a>
</div>
</div>
</div>
<div class="ui-sfx">
<audio id="chSpec" src=""></audio>
</div>
<script>
// ## This is done in 'channels.js' now
// CHANNEL ART LOAD
// $(document).ready(function() {
// $('.ch.occupied').each(function() {
// var artsrc = 'channelart/' + $(this).data('id') + '/channel.html';
// $(this).find('iframe').attr('src', artsrc);
// });
// });
// CLICKS ON CHANNEL
// Transition
$(".main-menu").on("click", ".occupied .onhover", function() {
var centerX = $(this).offset().left + $(this).width() / 2;
var centerY = $(this).offset().top + $(this).height() / 2;
$(".main-menu").css({"transform-origin" : centerX + "px " + centerY + "px 0" });
$(".ch-selection").css({"transform-origin" : centerX + "px " + centerY + "px 0" });
$(".main-menu").addClass('ch-trans-on');
});
// Add music
$(document).on("click", ".occupied", function() {
console.log(`current channel:`, $(this).data('id'));
// Get channel from channel confg to find assets folder
var targetChannel = null;
for (let i = 0; i < userChannels.length; i++) {
const element = userChannels[i];
if (element.id == $(this).data('id')) {
targetChannel = element;
}
}
// If somehow the directory isn't found
if (targetChannel == null) {
// This part is mainly for the "electron" channel that isn't in the channel config.
if ($(this).data('special')) {
// Check what special channel this is
switch ($(this).data('id')) {
// These (as of currently) only need assets [and videoformat if not gif].
case "electron":
targetChannel = {
assets: "assets/channels/",
videoformat: "webp"
}
break;
default:
alert(`The '${$(this).data('id')}' channel couldn't be found in the channel config!`);
break;
}
console.log($(this).data('special'));
// This is what should really happen.
} else {
alert(`The '${$(this).data('id')}' channel couldn't be found in the channel config!`);
}
}
// Audio
var audiosrc = targetChannel.assets + $(this).data('id') + '/audio.mp3';
$("#chSpec").attr('src', audiosrc);
// Video
// If this channel has a "videoformat"
var vformat = 'gif';
if (targetChannel.videoformat) {
vformat = targetChannel.videoformat
}
var videosrc = targetChannel.assets + $(this).data('id') + `/video.${vformat}`;
$("#videoSpec").attr('src', videosrc);
// Start channel music
$("#chSpec")[0].currentTime = 0;
var currentaudio = document.getElementById("chSpec");
currentaudio.play();
// Move into channel
$(".letsago").attr('data-start', $(this).data('href'));
if ($(this).attr("data-href")) {
$(".letsago").attr('data-start', $(this).data('href'));
}
else {
$(".letsago").addClass("disabled-btn");
}
});
// CHANNEL START
function start() {
playSFX('button-select-big.mp3', userConfig.sfxVol);
if ($(".letsago").attr("data-start")) {
setTimeout(() => {document.body.classList.add("fadeOut");}, 1000);
setTimeout(() => {window.location.href = $(".letsago").data("start");}, 2000);
}
else {
alert("ERROR: No endpoint has been defined for this channel.");
}
var chaudio = $('#chSpec');
var duration = 1000;
var steps = 10;
function decreaseVolume() {
var initialVolume = chaudio[0].volume;
var step = initialVolume / steps;
var delay = duration / steps;
for (var i = 0; i < steps; i++) {
setTimeout(function() {
chaudio[0].volume -= step;
}, i * delay);
}
} decreaseVolume();
}
// RETURNS TO THE MENU
function menuReturn() {
var currentaudio = document.getElementById("chSpec");
currentaudio.pause();
$("#videoSpec").attr('src', '');
$(".letsago").removeClass("disabled-btn");
$(".main-menu").removeClass('ch-trans-on');
$(".main-menu").addClass('chsout-anim');
setTimeout(() => {$(".main-menu").removeClass('chsout-anim');}, 1000);
playSFXMulti(0.2, ['button-select.mp3', 'channel-back.mp3']);
bgMusicToggle();
}
//PAGE PREV/NEXT
$('.prev').on('click', function() {
playSFX('nextprev.mp3', userConfig.sfxVol);
$('.grid').animate({ scrollLeft: '-=' + $('.grid').width() }, 0);
currentMenuPage--;
$(".next").css("display", "flex");
// If current page is at the end
if (currentMenuPage == 1) {
$(".prev").css("display", "none");
}
});
$('.next').on('click', function() {
playSFX('nextprev.mp3', userConfig.sfxVol);
$('.grid').animate({ scrollLeft: '+=' + $('.grid').width() }, 0);
currentMenuPage++;
$(".prev").css("display", "flex");
// If current page is at the end
if (currentMenuPage == document.querySelectorAll('.ch-c').length) {
$(".next").css("display", "none");
}
});
// HOME/PAUSE MENU
// moved to homemenu.js
// INSERT DISC FUNCTIONS (SNEAKY)
function homebrew() {
$("#discTag").text("Homebrew Channel");
$(".spinnin").addClass("disc-insert-anim");
var discCh= $('.ch.occupied[data-id="disc"]');
discCh.find('iframe').attr('src', 'channelart/homebrew/channel.html');
discCh.attr('data-id', 'homebrew');
return("Homebrew Channel unlocked (in the works)");
}
function bottomgear() {
$("#discTag").text("BOTTOM GEAR™");
$(".spinnin").addClass("disc-insert-anim");
var discCh = $('.ch.occupied[data-id="disc"]');
discCh.find('iframe').attr('src', 'channelart/bottomgear/channel.html');
discCh.attr('data-id', 'bottomgear');
return("WELCOME TO BO'OM GEAR MATES (in the works)");
}
function eject() {
$("#discTag").text("Disc Channel");
$(".spinnin").removeClass("disc-insert-anim");
var discCh = $('.ch.occupied[data-id="homebrew"]');
discCh.find('iframe').attr('src', 'channelart/disc/channel.html');
discCh.attr('data-id', 'disc');
var discCh = $('.ch.occupied[data-id="bottomgear"]');
discCh.find('iframe').attr('src', 'channelart/disc/channel.html');
discCh.attr('data-id', 'disc');
return("Disc ejected");
}
// SETTINGS
$(document).ready(() => {
$(".wii-btn").click(() => {
$(".settings").css("display", "block");
setTimeout(() => {$(".settings-content").fadeIn();}, 1000);
$(".grid").fadeOut();
});
$(".close").click(() => {
$(".grid").fadeIn();
$(".settings-content").fadeOut();
setTimeout(() => {$(".settings").fadeOut();}, 3500);
});
});
// MESSAGE BOARD
$(".card.buttonlike").click(event => {
$(".opened").css("display", "flex");
$(".bg").css("display", "block");
});
$(".alt-btn.back").click(event => {
$(".opened").css("display", "none");
$(".bg").css("display", "none");
});
$(".backtowiimenu").click(event => {
$(".msgboard").fadeOut();
});
$(".diary-btn").click(event => {
$(".msgboard").css("display", "flex");
});
</script>
</body>
</html>