-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainmen.html
322 lines (281 loc) · 13 KB
/
mainmen.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
<!DOCTYPE html>
<html lang="en" style="width: 1000px;">
<style>
@font-face { font-family: PixelifySans; src: url('./Addons/PixelifySans.ttf');}
</style>
<head>
<meta name="viewport" content="width=1000px, initial-scale=1.0,user-scalable=no">
<meta charset="UTF-8" />
<link rel="stylesheet" href="./styles/mainstyles.css">
<title>OVERFATE</title>
</head>
<body style="width: 1015px; height: 565px;">
<audio src="./Addons/hover.mp3" id="hoveraudio"></audio>
<div style="height: 100%; display: flex; position: relative; width: 100%; margin: 0; background-color: gray; top: 0; left: 0;" id="main">
<img src="./Addons/Background/gradient.png" alt="" style="width: 100%;">
<div class="title">
<h1 style="display: block;">OVERFATE</h1>
</div>
<div class="selection">
<a onclick="redirect(1)" onmouseover="PlaySound()">Versus</a>
<a onclick="redirect(2)" onmouseover="PlaySound()">Test your OVERFATE</a>
<a onclick="redirect(3)" onmouseover="PlaySound()">Options</a>
<a onclick="redirect(4)" onmouseover="PlaySound()">Credits</a>
<a onclick="redirect(5)" onmouseover="PlaySound()">Quit the Game</a>
</div>
<div class="param" id="options" style="display: none; position: absolute; width: 100%; height: 100%; background-color: rgb(46, 34, 34); align-items: center; justify-content: center; ">
<h1 style="display: block; top: 0; text-align: center;">OPTIONS</h1>
<button style="display: flex; position: absolute; float: left; justify-self: start; top: 5%; left: 4%; background-color: transparent; border-width: 0; justify-content: center; align-items: center;">
<img src="./Addons/Back-arrow.png" alt="" style="height: 50px; vertical-align: middle;" onclick="redirect(6)">
</button>
<div class="optselect">
<a onclick="parameters(1)">Show FPS: <span style="color: #8c8308;" id="fps-box">no</span></a>
<a onclick="parameters(2)">Timer: <span style="color: #8c8308;" id="time-choice">100</span> <span style="color: #8c0808;" id="time-choice"> sec</span></a>
<a onclick="parameters(3)">Fullscreen mode: <span style="color: #8c8308;" id="fs-toggle">no</span></a>
<a onclick="parameters(4)">Number of rounds: <span style="color: #8c8308;" id="round-choice">1</span></a>
<a onclick="parameters(5)" style="color:#8c0808;">Clear LocalStorage</a>
</div>
</div>
<div class="sp-thanks" id="sp-thanks" style="display: none; position: absolute; width: 100%; height: 100%; background-color: rgb(46, 34, 34); top: 0;">
<button style="display: flex; position: absolute; float: left; justify-self: start; top: 5%; left: 4%; background-color: transparent; border-width: 0; justify-content: center; align-items: center;">
<img src="./Addons/Back-arrow.png" alt="" style="height: 50px; vertical-align: middle;" onclick="redirect(6)">
</button>
<div>
<h1 style="left: 8%; top: 8%;">Credits</h1><br>
<div style="display: block; position: absolute; top: 35%; left: 15%;" class="sp" id="sp">
<h2>Special thanks to:</h2>
<h4 id="sp-txt">
Design Ideas: CharlieDelta45
</h4>
<h4 id="sp-txt">
Coding: ニッケルドン
</h4>
<h4 id="sp-txt">
Design: ニッケルドン
</h4>
</div>
</div>
</div>
<div class="notification" id="notification" style="display: none; width: 250px; height: 60px; position: absolute; bottom: 0; right: 0; border-radius: 5px; border-width: 3px; border-style: solid; border-color: rgb(97, 19, 19); background-color: rgb(46, 34, 34); transition: all 1s ease-out; animation: notification 1.5s ease-out;">
<h3 style="color: #8c8308; vertical-align: middle; text-align: center; font-family: PixelifySans, sans-serif;">
Sucess
</h3>
</div>
<div id="transition" class="tr" style="display: none; position: absolute; top: 0; width: 100%; height: 100%; background-color: transparent;"></div>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script>
var metadata = new URLSearchParams(window.location.search);
try{
var optmeta = JSON.parse(metadata.get('options'))
if(optmeta.Fullscreen === 'yes'){
document.getElementById('main').classList.add('zoom')
}}catch(e){
}
$("#selection a") // loop each menu item
.each(function(i) {
if (i != 0) { // only clone if more than one needed
$("#selectaudio")
.clone()
.attr("id", "beep-" + i)
.appendTo($(this).parent());
}
$(this).data("beeper", i); // save reference
})
.mouseenter(function() {
$("#selectaudio-" + $(this).data("beeper"))[0].play();
});
$("#selectaudio").attr("id", "beep-0"); // get first one into naming convention
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.1/howler.min.js"></script>
<script>
options = JSON.parse(localStorage.getItem("options"))
if(JSON.parse(localStorage.getItem("options")).Fullscreen === 'yes'){
document.getElementById('main').classList.add('zoom');
document.getElementById('fs-toggle').innerText = 'yes'
}
document.getElementById('fps-box').innerHTML = options.showFPS
document.getElementById('time-choice').innerText = options.Timer
document.getElementById('fs-toggle').innerText = options.Fullscreen
document.getElementById("round-choice").innerText = options.Rounds
document.querySelector('h4').style.color = '#8c8308'
setInterval(() => {
if(document.getElementById('sp-thanks').style.display !== 'none'){
var color = document.getElementById('sp-txt').style.color;
if(color === 'rgb(140, 131, 8)')document.getElementById('sp-txt').style.color = '#136377'
else if(color === 'rgb(19, 99, 119)') document.getElementById('sp-txt').style.color = '#8c8308'
}
}, 500)
var json = fetch('./JS/Options.json')
.then((res) => res.json())
.then((json) => {return json})
json = json.then((value) => {
return (value)
})
//HOVER SOUNDS
function PlaySound(soundobj) {
var thissound = document.getElementById('hoveraudio');
var hover = new Howl({
src: ['./Addons/hover.mp3'],
volume: 0.1,
onend: function () {
}
});
hover.play();
}
function StopSound(soundobj) {
var thissound = document.getElementById('hoveraudio');
thissound.pause();
thissound.currentTime = 0;
}
function parameters(num){
if(num === 1){
var fpschoice = document.getElementById('fps-box').innerText
if(fpschoice === 'no'){
document.getElementById('fps-box').innerHTML = 'yes'
}else{
document.getElementById('fps-box').innerText = 'no'
}
}
else if(num === 2){
var timein = document.getElementById('time-choice').innerText
switch(timein){
case '100': {
document.getElementById('time-choice').innerText = '150'
}break;
case '150': {
document.getElementById('time-choice').innerText = '300'
}break;
case '300': {
document.getElementById('time-choice').innerText = 'unlimited'
}break;
case 'unlimited': {
document.getElementById('time-choice').innerText = '100'
}break;
}
}
else if(num === 3){
var el = document.getElementById("main");
var Fullscreen = document.getElementById('fs-toggle').innerText
switch(Fullscreen){
case 'yes': {
document.getElementById('fs-toggle').innerText = 'no'
/*if (document.fullscreenElement) {
// exitFullscreen is only available on the Document object.
document.exitFullscreen();
}*/
document.getElementById('main').classList.add('unzoom')
try{
document.getElementById('main').classList.remove('zoom')
}catch(e){
}
}break;
case 'no': {
document.getElementById('fs-toggle').innerText = 'yes'
/*if (!document.fullscreenElement) {
el.requestFullscreen();
} else {
}*/
try{
document.getElementById('main').classList.remove('unzoom')
}catch(e){
}
document.getElementById('main').classList.add('zoom')
el.dispatchEvent(new Event('keypress', {keyCode: 'F11'}))
$(() => {
var e = $.Event('keypress');
e.which = 27; // Character 'A'
$('item').trigger(e);
});
}break;
}
}
else if(num === 4){
var choice = document.getElementById("round-choice").innerText
switch(choice){
case '1': {
document.getElementById("round-choice").innerText = '2'
}break;
case '2': {
document.getElementById("round-choice").innerText = '3'
}break;
case '3': {
document.getElementById("round-choice").innerText = '1'
}break;
}
}
else if(num === 5){
localStorage.clear()
document.getElementById('fps-box').innerHTML = options.showFPS = 'no'
document.getElementById('time-choice').innerText = options.Timer = 100
document.getElementById("round-choice").innerText = options.Rounds = 1
localStorage.setItem("wins", JSON.stringify({PL1: 0, PL2: 0}))
/*localStorage.setItem("options", JSON.stringify({
FS: null,
Rounds: null,
showFPS: null,
Timer: 100
}))*/
document.getElementById('notification').style.display = 'block'
setTimeout(() => {
document.getElementById('notification').style.opacity = '0%'
setTimeout(() => {
document.getElementById('notification').style.display = 'none'
document.getElementById('notification').style.opacity = '100%'
},1000)
}, 2500)
}
}
function redirect(num){
var sound = new Howl({
src: ['./Addons/select.mp3'],
volume: 0.1,
onend: function () {
console.log("continue", num)
if(num === 1){
document.getElementById('transition').style.backgroundColor = 'black'
var Options = {
showFPS: document.getElementById('fps-box').innerHTML,
Timer: document.getElementById('time-choice').innerText,
Fullscreen: document.getElementById('fs-toggle').innerText,
Rounds: document.getElementById("round-choice").innerText
}
Options = JSON.stringify(Options)
localStorage.setItem("options", Options)
setTimeout(() => {
window.location.href = './charsel.html'
},1000)
}
else if(num === 3){
document.getElementById('transition').style.display = 'none'
document.getElementById('options').style.display = 'flex'
}
else if(num === 4){
document.getElementById('transition').style.display = 'none'
document.getElementById('sp-thanks').style.display = 'flex'
}
else if(num === 5){
document.getElementById('transition').style.backgroundColor = 'black'
setTimeout(() => {
window.close()
}, 1000)
}
}
});
if(num < 6){
sound.play();
document.getElementById('transition').style.display = 'flex'
}
else{
if(num === 6){
document.getElementById('sp-thanks').style.display = 'none'
document.getElementById('options').style.display = 'none'
}
}
}
window.addEventListener('keypress', (event) => {
console.log(event)
})
</script>
</html>