-
Notifications
You must be signed in to change notification settings - Fork 7
/
settings.html
executable file
·621 lines (621 loc) · 33.2 KB
/
settings.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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit settings</title>
<style>
@font-face {
font-family: "Roboto";
src: url(fonts/Roboto.ttf);
}
@font-face {
font-family: "Game";
src: url(fonts/Game.ttf);
}
html, body {
font-family: "Roboto", Arial;
user-select: none !important;
}
.body {
width: 98%;
height: 97%;
margin: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), 0 1px 8px rgba(0, 0, 0, 0.3);
padding: 0 !important;
border: 5px solid #333;
border-image: linear-gradient(to top, #333, #fff) 1 / 20px;
background: #fefefe;
}
.card {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: box-shadow .3s;
width: 162px !important;
border-radius: 5px;
margin: 10px;
display: inline-block;
cursor: pointer;
}
.card.hot {
border: 2px solid #333;
border-image: linear-gradient(to right, #333, #fff) 1 / 2px;
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}
img {
border-radius: 5px 5px 0 0;
pointer-events: none;
}
.container {
padding: 2px 16px;
}
.light {
font-size: italic;
color: #999;
}
.wrapper {
display: inline-flex;
align-items: left;
justify-content: left;
position: absolute;
top: 50%;
left: 5% !important;
transform: translate(0, -50%);
flex-wrap: wrap;
width: 70%;
}
.credit {
vertical-align: baseline;
width: 6%;
}
.price {
color: #333;
vertical-align: baseline;
}
.strike {
text-decoration: line-through;
filter: brightness(0%);
}
.sale {
width: 15%;
vertical-align: middle;
}
.user-points {
border-bottom: 2px solid #333;
}
h1.title, p.description {
text-shadow: 2.5px 2.5px 10px rgba(0, 0, 0, 0.25);
}
button {
padding: 2px;
border: 1px solid #333;
background: #fff;
margin: 5px;
border-radius: 2px;
cursor: pointer;
}
button:hover {
background: #eee;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes spin-reverse {
0% {
transform: rotate(360deg);
}
100% {
transform: rotate(0deg);
}
}
.spin {
border: 2px solid #f3f3f3;
display: inline-block;
border-top: 2px solid #333;
border-radius: 50%;
width: 10px;
height: 10px;
margin-left: 15px;
animation: spin 2s linear infinite;
}
.spin-reverse {
animation: spin-reverse 2s linear infinite;
}
.spin.spin-large {
width: 100px;
height: 100px;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.loader {
background: #fff;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: 0;
z-index: 999999999;
}
.center-origin {
display: inline-flex;
text-align: center;
align-items: center;
justify-content: center;
}
video {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
object-fit: contain;
z-index: 999999;
margin: 0 !important;
border: none;
}
#clearfix {
outline: none;
border: none;
background: #fff;
color: #333;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.24) !important;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.24) !important;
font-size: 18px;
padding: 6px;
border-radius: 3px;
cursor: pointer;
}
canvas {
position: absolute;
left : 0;
top: 0;
right: 0;
bottom: 0;
pointer-events: none;
}
.item {
position: relative;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.24) !important;
border: 2px solid #333;
border-image: linear-gradient(to right, #333, #fff) 1 / 2px;
width: 200px;
left: 50%;
margin-left: -100px;
margin-bottom: 10px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
cursor: pointer;
}
.item:hover {
background: #fafafa;
}
.info {
position: relative;
border-radius: 100%;
background-image: linear-gradient(#ccc, #eee);
border: 2px solid #ddd;
width: 25px;
height: 25px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
color: #fff;
}
.notiflix-confirm-overlay {
backdrop-filter: blur(5px);
}
.notiflix-confirm-head * {
color: #333 !important;
}
.notiflix-confirm-buttons a {
background: #333 !important;
border-radius: 2px !important;
}
.notiflix-confirm-content {
border-radius: 5px !important;
}
.swal-overlay {
z-index: 999 !important;
}
[class^="swal"] {
animation: none !important;
transition: none !important;
}
.swal-button {
background: #333 !important;
color: #fff;
border-radius: 2px;
box-shadow: none !important;
}
.swal-modal {
border-radius: 1px;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.24) !important;
}
.swal-overlay {
background: rgba(10, 10, 10, .3);
}
.selected {
outline: 5px solid #ddd;
}
.snowflake{z-index:999999;position:absolute;pointer-events:none!important}.snowflake{--size:1vw;width:var(--size);height:var(--size);background:#eee;box-shadow:0 0 5px 5px #eee;border-radius:50%;top:-5vh}@keyframes snowfall{0%{transform:translate3d(var(--left-ini),0,0)}100%{transform:translate3d(var(--left-end),110vh,0)}}.snowflake:first-child{--size:0.8vw;--left-ini:-8vw;--left-end:1vw;left:41vw;animation:13s linear -1s infinite snowfall}.snowflake:nth-child(2){--size:0.6vw;--left-ini:6vw;--left-end:1vw;left:72vw;animation:6s linear -2s infinite snowfall}.snowflake:nth-child(3){--size:1vw;--left-ini:5vw;--left-end:-9vw;left:57vw;animation:14s linear -4s infinite snowfall}.snowflake:nth-child(4){--size:0.2vw;--left-ini:2vw;--left-end:4vw;left:66vw;animation:10s linear -8s infinite snowfall}.snowflake:nth-child(5){--size:0.2vw;--left-ini:5vw;--left-end:-3vw;left:40vw;animation:6s linear -2s infinite snowfall}.snowflake:nth-child(6){--size:0.4vw;--left-ini:0vw;--left-end:-4vw;left:12vw;animation:11s linear -4s infinite snowfall}.snowflake:nth-child(7){--size:0.8vw;--left-ini:1vw;--left-end:-7vw;left:15vw;animation:7s linear -5s infinite snowfall}.snowflake:nth-child(8){--size:1vw;--left-ini:9vw;--left-end:-4vw;left:16vw;animation:13s linear -2s infinite snowfall}.snowflake:nth-child(9){--size:0.4vw;--left-ini:0vw;--left-end:-6vw;left:81vw;animation:7s linear -6s infinite snowfall}.snowflake:nth-child(10){--size:1vw;--left-ini:-7vw;--left-end:-5vw;left:14vw;animation:14s linear -1s infinite snowfall}.snowflake:nth-child(11){--size:1vw;--left-ini:-3vw;--left-end:3vw;left:69vw;animation:7s linear -1s infinite snowfall}.snowflake:nth-child(12){--size:0.8vw;--left-ini:-3vw;--left-end:4vw;left:52vw;animation:11s linear -6s infinite snowfall}.snowflake:nth-child(13){--size:0.8vw;--left-ini:4vw;--left-end:5vw;left:14vw;animation:13s linear -3s infinite snowfall}.snowflake:nth-child(14){--size:1vw;--left-ini:2vw;--left-end:-7vw;left:97vw;animation:8s linear -6s infinite snowfall}.snowflake:nth-child(15){--size:0.4vw;--left-ini:-4vw;--left-end:-9vw;left:77vw;animation:6s linear -10s infinite snowfall}.snowflake:nth-child(16){--size:0.8vw;--left-ini:-4vw;--left-end:6vw;left:27vw;animation:7s linear -8s infinite snowfall}.snowflake:nth-child(17){--size:0.8vw;--left-ini:6vw;--left-end:-6vw;left:74vw;animation:15s linear -8s infinite snowfall}.snowflake:nth-child(18){--size:0.4vw;--left-ini:-7vw;--left-end:-5vw;left:9vw;animation:10s linear -7s infinite snowfall}.snowflake:nth-child(19){--size:0.8vw;--left-ini:6vw;--left-end:-1vw;left:1vw;animation:9s linear -7s infinite snowfall}.snowflake:nth-child(20){--size:0.2vw;--left-ini:9vw;--left-end:0vw;left:22vw;animation:13s linear -10s infinite snowfall}.snowflake:nth-child(21){--size:1vw;--left-ini:-4vw;--left-end:5vw;left:96vw;animation:14s linear -8s infinite snowfall}.snowflake:nth-child(22){--size:0.2vw;--left-ini:7vw;--left-end:-8vw;left:15vw;animation:10s linear -6s infinite snowfall}.snowflake:nth-child(23){--size:1vw;--left-ini:0vw;--left-end:2vw;left:26vw;animation:13s linear -10s infinite snowfall}.snowflake:nth-child(24){--size:0.2vw;--left-ini:-4vw;--left-end:7vw;left:60vw;animation:14s linear -4s infinite snowfall}.snowflake:nth-child(25){--size:0.4vw;--left-ini:4vw;--left-end:4vw;left:17vw;animation:13s linear -6s infinite snowfall}.snowflake:nth-child(26){--size:1vw;--left-ini:2vw;--left-end:7vw;left:9vw;animation:10s linear -9s infinite snowfall}.snowflake:nth-child(27){--size:0.8vw;--left-ini:-4vw;--left-end:2vw;left:68vw;animation:10s linear -1s infinite snowfall}.snowflake:nth-child(28){--size:1vw;--left-ini:-8vw;--left-end:2vw;left:86vw;animation:6s linear -5s infinite snowfall}.snowflake:nth-child(29){--size:0.8vw;--left-ini:-4vw;--left-end:-5vw;left:6vw;animation:9s linear -9s infinite snowfall}.snowflake:nth-child(30){--size:1vw;--left-ini:-1vw;--left-end:5vw;left:80vw;animation:7s linear -1s infinite snowfall}.snowflake:nth-child(31){--size:0.6vw;--left-ini:4vw;--left-end:-3vw;left:100vw;animation:9s linear -10s infinite snowfall}.snowflake:nth-child(32){--size:0.2vw;--left-ini:9vw;--left-end:-5vw;left:71vw;animation:11s linear -1s infinite snowfall}.snowflake:nth-child(33){--size:0.4vw;--left-ini:-4vw;--left-end:-6vw;left:30vw;animation:9s linear -5s infinite snowfall}.snowflake:nth-child(34){--size:1vw;--left-ini:-2vw;--left-end:1vw;left:81vw;animation:13s linear -10s infinite snowfall}.snowflake:nth-child(35){--size:0.4vw;--left-ini:-4vw;--left-end:-1vw;left:22vw;animation:12s linear -6s infinite snowfall}.snowflake:nth-child(36){--size:0.4vw;--left-ini:-7vw;--left-end:1vw;left:33vw;animation:14s linear -3s infinite snowfall}.snowflake:nth-child(37){--size:0.8vw;--left-ini:6vw;--left-end:8vw;left:44vw;animation:9s linear -4s infinite snowfall}.snowflake:nth-child(38){--size:0.4vw;--left-ini:4vw;--left-end:-1vw;left:17vw;animation:10s linear -6s infinite snowfall}.snowflake:nth-child(39){--size:0.2vw;--left-ini:2vw;--left-end:-4vw;left:77vw;animation:11s linear -9s infinite snowfall}.snowflake:nth-child(40){--size:1vw;--left-ini:-6vw;--left-end:2vw;left:48vw;animation:8s linear -6s infinite snowfall}.snowflake:nth-child(41){--size:0.8vw;--left-ini:8vw;--left-end:3vw;left:93vw;animation:6s linear -9s infinite snowfall}.snowflake:nth-child(42){--size:1vw;--left-ini:-7vw;--left-end:-9vw;left:80vw;animation:12s linear -3s infinite snowfall}.snowflake:nth-child(43){--size:0.8vw;--left-ini:-3vw;--left-end:-6vw;left:30vw;animation:14s linear -9s infinite snowfall}.snowflake:nth-child(44){--size:1vw;--left-ini:-7vw;--left-end:-9vw;left:70vw;animation:12s linear -8s infinite snowfall}.snowflake:nth-child(45){--size:0.2vw;--left-ini:-4vw;--left-end:2vw;left:17vw;animation:6s linear -6s infinite snowfall}.snowflake:nth-child(46){--size:0.4vw;--left-ini:-8vw;--left-end:3vw;left:4vw;animation:13s linear -2s infinite snowfall}.snowflake:nth-child(47){--size:0.2vw;--left-ini:-6vw;--left-end:-3vw;left:53vw;animation:14s linear -3s infinite snowfall}.snowflake:nth-child(48){--size:0.8vw;--left-ini:8vw;--left-end:-7vw;left:91vw;animation:13s linear -3s infinite snowfall}.snowflake:nth-child(49){--size:0.6vw;--left-ini:2vw;--left-end:9vw;left:95vw;animation:11s linear -6s infinite snowfall}.snowflake:nth-child(50){--size:1vw;--left-ini:-6vw;--left-end:4vw;left:85vw;animation:6s linear -1s infinite snowfall}.snowflake:nth-child(6n){filter:blur(1px)}
</style>
<script src="js/user/user.js"></script>
<script src="https://cdn.jsdelivr.net/gh/notiflix/Notiflix@latest/dist/notiflix-aio-3.2.7.min.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
</head>
<body>
<audio id="walking" src="sounds/walking.mp3" loop></audio>
<script src="https://parking-master.github.io/FPS3/js/three.min.js"></script>
<script src="js/GLTFLoader.min.js"></script>
<script src="js/fflate.min.js"></script>
<script src="js/analytics.js"></script>
<div class="loader">
<div class="spin spin-large center-origin" style="position: absolute; left: 50%; top: 50%; margin-left: -50px; margin-top: -50px; padding: 0 !important">
<p class="spin-reverse" style="display: inline-block"><img src="images/html/settings.png" style="width: 50%"></p>
</div>
</div>
<div class="body">
<h1 style="text-align: center; font-size: 3em" class="title"><img class="credit" src="images/html/settings.png" style="width: 2%; vertical-align: baseline"> Settings</h1>
<p style="text-align: center" class="description">You currently own <span class="user-items">0</span> items, with <span class="user-points">0</span> available credit(s)</h1>
<div class="wrapper">
<div class="card" data-item="Loadout" data-price="300">
<img src="images/store/loadouts/Assault_Rifle-Glock_19.png" style="width:100%">
<div class="container">
<h4><b>Basic</b></h4>
<p>My loadout</p>
</div>
</div>
<div class="card" data-item="Theme" data-price="9000">
<img src="images/store/themes/default.png" style="width:100%">
<div class="container">
<h4><b>Default</b></h4>
<p>My theme</p>
</div>
</div>
<div class="card" data-item="Character" data-price="550">
<img src="images/store/characters/Steve.png" style="width:100%">
<div class="container">
<h4><b>Steve</b></h4>
<p>Character</p>
</div>
</div>
<div class="card" data-item="Bots" data-price="550">
<img src="images/store/bots.png" style="width:100%">
<div class="container">
<h4><b>Auto set</b></h4>
<p>Bots</p>
</div>
</div>
</div>
</div>
<div class="bypass" style="display: none; z-index: 999999999999999999999999; position: fixed; left: 0; top: 0; bottom: 0; right: 0; width: 100%; height: 100%; padding: 0; margin: 0; background: rgba(0, 0, 0, .435)">
<div style="z-index: 9999999999999999; color: #fff; display: inline-block; font-size: 35px; position: fixed; left: 50%; width: 60%; margin-left: -30%; top: 50%; height: 60%; margin-top: -10%; text-align: center; justify-content: center; align-items: center">You must have an account to change settings.
<br>
<br>
<button id="clearfix" onclick="location.replace('login.html?return=settings.html')">Log in</button>
</div>
</div>
<button onclick="location.assign('./profile.html')" style="position: absolute; left: 3%; bottom: 4%; z-index: 99999999999">Profile settings</button>
<script>
const renderer = new THREE.WebGLRenderer({ antialias: true });
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.1, 1000);
renderer.setPixelRatio(1.1);
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.VSMShadowMap;
renderer.shadowMap.autoUpdate = false;
renderer.outputEncoding = THREE.sRGBEncoding;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
document.body.appendChild(renderer.domElement);
let mixers = [];
let clock = new THREE.Clock();
function animate() {
requestAnimationFrame(animate);
let delta = clock.getDelta();
mixers.forEach(x => x.update(delta));
renderer.render(scene, camera);
}
animate();
renderer.setClearAlpha();
renderer.setClearColor(0x000000, 0);
THREE.Sound = function Sound(source = null, object = new THREE.Object3D, callback = function(sound) {}, preserve3d = true, volume = 5, loop) {
if (!preserve3d) {
let sound = document.createElement("audio");
sound.src = source;
sound.play();
loop && (sound.loop = loop);
return;
}
typeof camera.getObjectByProperty("type", "AudioListener") == "undefined" && camera.add(new THREE.AudioListener());
let sound = new THREE.PositionalAudio(camera.getObjectByProperty("type", "AudioListener"));
new THREE.AudioLoader().load(source, (buffer) => {
sound.setBuffer(buffer);
sound.setRefDistance(5);
sound.setVolume(volume);
callback(sound);
sound.play();
});
object.add(sound);
}
const light = new THREE.DirectionalLight(0xffffff, 2);
const ambientLight = new THREE.AmbientLight(0xeeeeee, .5);
light.position.set(-10, 10, 0);
light.castShadow = true;
scene.add(ambientLight);
scene.add(light);
function info(type) {
if (type.includes("Loadout.Assault_Rifle-Glock_19")) {
return "A basic loadout that includes a full auto AK-47, and a mid-range Glock 19 pistol.";
}
if (type.includes("Loadout.Sniper_Rifle-Shotgun")) {
return "The sniper loadout includes a long range Sniper Rifle, with a 12 guage shotgun.";
}
if (type.includes("Loadout.Light_Machine_Gun-Auto_Pistol")) {
return "A full auto loadout including a full auto LMG and a Machine Pistol.";
}
if (type.includes("Loadout.Tactical_Pistol-Glock_19")) {
return "Includes the all-mighty Tactical Shotgun pistol, along with a handy Glock 19.";
}
if (type.includes("Loadout.Grenade_Launcher-Rocket_Pistol")) {
return "The heavy loadout includes an explosive Grenade Launcher along with the tactical Rocket Pistol.";
}
if (type.includes("Theme.Default")) {
return "Default theme with hex color code #333333 and #FFFFFF";
}
if (type.includes("Theme.Contrast")) {
return "High contrast theme that helps you focus more";
}
if (type.includes("Theme.Dark")) {
return "Dark theme with base hex color code #333333";
}
if (type.includes("Theme.Light")) {
return "Light theme with base hex color code #FFFFFF";
}
if (type.includes("Theme.Auto")) {
return "Auto theme will adjust to what time of day it is.";
}
if (type.includes("Character.Steve")) {
return "Steve is the basic soldier that every account comes with for free.";
}
if (type.includes("Character.Max")) {
return "Max is a warrior who has a legendary armor set (and likes big weapons).";
}
if (type.includes("Character.Gary")) {
return "Gary is a very rare soldier with the lengendary armor set and a free heavy loadout.";
}
if (type.includes("Bot.Default")) {
return "The default bot configuration. Will act like your average AI.";
}
if (type.includes("Bot.Random")) {
return "The random bot configuration will select a variety of sets randomly.";
}
if (type.includes("Bot.Difficult")) {
return "The difficult bot configuration is built for pros who are up for a challenge.";
}
}
window.addEventListener("load", function() {
new THREE.GLTFLoader().load("models/characters/" + userMan.get("metadata").preferences.character + "/scene.gltf", (e) => {
character = e.scene;
let mixer = new THREE.AnimationMixer(character);
mixers.push(mixer);
character.walking = false;
character.walk = function() {
if (character.walking) return (mixer.clipAction(e.animations[0]).stop(), mixer.clipAction(e.animations[0]).reset(), renderer.shadowMap.autoUpdate = false, character.walking = false, renderer.shadowMap.needsUpdate = true, document.querySelector("#walking").pause(), document.querySelector("#walking").currentTime = 0);
document.querySelector("#walking").play();
character.walking = true;
renderer.shadowMap.autoUpdate = true;
mixer.clipAction(e.animations[0]).play();
};
scene.add(character);
character.position.copy(camera.position);
character.rotation.copy(camera.rotation);
character.translateZ(-2);
character.rotateY(-1);
character.position.y += -.8;
character.position.x += 2;
character.scale.set(1, 1.1, 1);
new THREE.GLTFLoader().load("models/assets/floor.glb", (floor) => {
floor = floor.scene;
document.addEventListener("mousemove", (e) => {
let raycaster = new THREE.Raycaster();
let mouse = new THREE.Vector2();
mouse.x = (e.clientX / renderer.domElement.clientWidth) * 2 - 1;
mouse.y = -(e.clientY / renderer.domElement.clientHeight) * 2 + 1;
raycaster.setFromCamera(mouse, camera);
let intersects = raycaster.intersectObjects([floor.getObjectByName("Walk_Button"), floor.getObjectByName("Shoot_Button")]);
let intersection = null;
intersects[0] && (intersection = intersects[0]);
if (intersection) {
document.body.style.cursor = "pointer";
document.body.onmousedown = () => intersection.object == floor.getObjectByName("Walk_Button") ? (floor.getObjectByName("Walk_Button").translateY(-.01), character.walk()) : (floor.getObjectByName("Shoot_Button").translateY(-.01), character.shoot());
document.body.onmouseup = () => intersection.object == floor.getObjectByName("Walk_Button") ? (floor.getObjectByName("Walk_Button").translateY(.01)) : (floor.getObjectByName("Shoot_Button").translateY(.01));
} else {
document.body.style.cursor = "";
document.body.onmousedown = null;
document.body.onmouseup = null;
}
});
floor.position.copy(character.position);
scene.add(floor);
floor.position.y += -.25;
character.traverse(x => (x.frustumCulled = false, x.receiveShadow = true, x.castShadow = true, renderer.shadowMap.needsUpdate = true));
floor.traverse(x => x.receiveShadow = true);
new THREE.GLTFLoader().load("models/weapons/dropped/Assault_Rifle.glb", (gun) => {
gun = gun.scene;
character.shoot = function() {
new THREE.GLTFLoader().load("models/assets/muzzle_flash.glb", (flash) => {
flash = flash.scene;
new THREE.Sound("sounds/guns/Assault_Rifle/fire.mp3", gun, () => {}, false);
scene.add(flash);
flash.position.copy(character.position);
flash.rotation.copy(character.rotation);
flash.scale.set(.2, .2, .2);
flash.translateY(1.3);
flash.rotateY(Math.PI);
flash.translateZ(-1.1);
flash.translateX(.05);
flash.translateY(.1);
gun.translateZ(1);
gun.translateX(1);
let light = new THREE.PointLight(0xf99c00, 1, 4, 3);
scene.add(light);
light.position.copy(flash.position);
character.getObjectByName("mixamorigNeck").rotateX(-.1);
character.getObjectByName("mixamorigRightHand").rotateZ(-.1);
character.getObjectByName("mixamorigLeftHand").translateX(-5);
setTimeout(() => (scene.remove(light), scene.remove(flash), character.getObjectByName("mixamorigNeck").rotateX(.1), character.getObjectByName("mixamorigLeftHand").translateX(5), character.getObjectByName("mixamorigRightHand").rotateZ(.1), gunHolder.translateZ(-1), gunHolder.translateX(-1)), 50);
});
};
gunHolder = new THREE.Group();
gun.rotation.set(0, 0, 0);
gun.position.set(0, 0, 0);
gun.scale.set(10, 10, 10);
gunHolder.add(gun);
character.getObjectByName("mixamorigRightHand").add(gunHolder);
gunHolder.rotation.set(1.5, .5, 2.9);
gunHolder.position.set(2.4475877079089363, 22.013294147805205, 1.5569827148359332);
gunHolder.rotateZ(.4);
gunHolder.rotateX(-.1);
});
});
});
});
window.addEventListener("resize", onWindowResize);
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
}
onWindowResize();
window.addEventListener("load", () => {
if (!userMan.isLoggedIn) return document.querySelector(".bypass").style.display = "block";
userMan.update(["tuser", "tpass"], function(key, value) {
if (key == "metadata") {
document.querySelectorAll(".user-points").forEach(x => x.textContent = (value.points - 0).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
document.querySelectorAll(".user-items").forEach(x => x.textContent = value.preferences.items.length);
setTimeout(() => document.querySelector(".loader").remove(), 1000);
}
});
definitions = {
"Theme.Default": "Default theme",
"Theme.Contrast": "Contrast theme",
"Theme.Dark": "Dark theme",
"Theme.Light": "Light theme",
"Theme.Auto": "Auto theme",
"Loadout.Assault_Rifle-Glock_19": "Basic loadout",
"Loadout.Sniper_Rifle-Shotgun": "Sniper loadout",
"Loadout.Light_Machine_Gun-Auto_Pistol": "Auto loadout",
"Loadout.Tactical_Shotgun-Glock_19": "Pistol loadout",
"Loadout.Grenade_Launcher-Rocket_Pistol": "Heavy loadout",
"Character.Steve": "Steve soldier",
"Character.Max": "Max soldier",
"Character.Gary": "Gary soldier",
"Bot.Default": "Default CONFIG",
"Bot.Random": "Random CONFIG",
"Bot.Difficult": "Difficult CONFIG"
};
document.querySelectorAll(".card").forEach(x => {
if (x.dataset.item != "Bots") {
x.querySelector("img").src = `images/store/${x.dataset.item.toLowerCase().trim() + "s/" + userMan.get("metadata").preferences[x.dataset.item.toLowerCase().trim()] + ".png"}`;
x.querySelector("h4").querySelector("b").textContent = definitions[x.dataset.item + "." + userMan.get("metadata").preferences[x.dataset.item.toLowerCase().trim()]].split(" ")[0];
x.querySelector("img").addEventListener("error", function() { x.querySelector("img").src = "images/store/failed.png" });
}
x.addEventListener("click", function(event) {
let content = document.createElement("div");
let items = userMan.get("metadata").preferences.items;
items.forEach(o => {
if (x.dataset.item.trim() != o.split(".")[0].trim()) return;
content.innerHTML += `
<div class="item${userMan.get("metadata").preferences[x.dataset.item.toLowerCase().trim()] == o.split(".")[1].trim() ? " selected" : ""}" data-item="${o}"><img src="images/store/${o.split(".")[0].toLowerCase().trim() + "s/" + o.split(".").splice(1).join(".") + ".png"}" style="width: 30px"> ${definitions[o]} <button class="info" onclick="Notiflix.Confirm.show('Item information', info('${o}'), 'Close')">i</button></div>
`;
content.querySelectorAll("div.item").forEach(i => i.addEventListener("click", function() {
i.textContent.trim().split(/\bi\b$/)[0].trim() != definitions[x.dataset.item + "." + userMan.get("metadata").preferences[x.dataset.item.toLowerCase()]] ? (document.querySelector(".swal-button--confirm").disabled = "") : (document.querySelector(".swal-button--confirm").disabled = "disabled");
content.querySelectorAll("div.item").forEach(x => (x == this ? x.classList.add("selected") : x.classList.remove("selected")));
}));
});
if (x.dataset.item == "Bots") {
content.innerHTML = `
<div class="item${userMan.get("metadata").preferences.bot == "Default" ? " selected" : ""}" data-item="Bot.Default"><img src="images/store/bots/Default.png" style="width: 30px"> ${definitions["Bot.Default"]} <button class="info" onclick="Notiflix.Confirm.show('Item information', info('Bot.Default'), 'Close')">i</button></div>
<div class="item${userMan.get("metadata").preferences.bot == "Random" ? " selected" : ""}" data-item="Bot.Random"><img src="images/store/bots/Random.png" style="width: 30px"> ${definitions["Bot.Random"]} <button class="info" onclick="Notiflix.Confirm.show('Item information', info('Bot.Random'), 'Close')">i</button></div>
<div class="item${userMan.get("metadata").preferences.bot == "Difficult" ? " selected" : ""}" data-item="Bot.Difficult"><img src="images/store/bots/Difficult.png" style="width: 30px"> ${definitions["Bot.Difficult"]} <button class="info" onclick="Notiflix.Confirm.show('Item information', info('Bot.Difficult'), 'Close')">i</button></div>
`;
content.querySelectorAll("div.item").forEach(i => i.addEventListener("click", function() {
i.textContent.trim().split(/\bi\b$/)[0].trim() != definitions["Bot." + userMan.get("metadata").preferences.bot] ? (document.querySelector(".swal-button--confirm").disabled = "") : (document.querySelector(".swal-button--confirm").disabled = "disabled");
content.querySelectorAll("div.item").forEach(x => (x == this ? x.classList.add("selected") : x.classList.remove("selected")));
}));
}
swal({
text: "Change " + x.dataset.item.toLowerCase(),
content: content,
buttons: ["Cancel", "Change"]
}).then((e) => {
if (e) {
let metadata = userMan.get("metadata");
let preferences = metadata.preferences;
preferences[x.dataset.item == "Bots" ? "bot" : x.dataset.item.toLowerCase().trim()] = ((e) => { let u = null; Object.keys(definitions).forEach(x => definitions[x] == e ? u = x : void(0)); return u })(content.querySelector(".item.selected").textContent.trim().split(/\bi\b$/)[0].trim()).split(".")[1];
let t = true;
userMan.set("metadata", metadata, () => {
swal.close();
t && (t = false, Notiflix.Notify.success("Preferences updated successfully"));
setTimeout(() => location.reload(), 1500);
});
}
});
document.querySelector(".swal-button--confirm").disabled = "disabled";
});
let items1 = userMan.get("metadata").preferences.items;
items1.forEach(x => items1[items1.indexOf(x)] = x.split(".")[0]);
if (!(items1.indexOf(x.dataset.item) > -1) && x.dataset.item != "Bots") {
x.querySelector("img").src = "images/store/failed.png";
x.addEventListener("click", function(e) {
e.preventDefault();
swal("Error: No selections available for this category.");
})
}
});
document.querySelectorAll(".user-points").forEach(x => x.textContent = userMan.get("metadata").points.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
document.querySelectorAll(".user-items").forEach(x => x.textContent = userMan.get("metadata").preferences.items.length);
if (new URLSearchParams(location.search).get("equip")) {
let equip = decodeURIComponent(new URLSearchParams(location.search).get("equip"));
let item = equip.split(".")[0].trim();
let data = equip.split(".").splice(1).join(".").trim();
document.querySelectorAll(".card").forEach(x => {
if (x.dataset.item == item) {
x.click();
Object.values(document.querySelector(".swal-content").querySelector("div").children).forEach(m => {
if (m.dataset.item == equip) {
m.click();
}
});
}
});
}
});
</script>
<div class="snowflake"></div><div class="snowflake"></div><div class="snowflake"></div><div class="snowflake"></div><div class="snowflake"></div><div class="snowflake"></div>
</body>
</html>