forked from NekshaDeSilva/CodeUniverse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfireshell.js
522 lines (383 loc) · 25.5 KB
/
fireshell.js
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
//fireshell is a trademark of ncloud inc.
//https://www.youtube.com/@nekshav
const settingm = document.querySelector('.setting-opt');
const settingbtn = document.querySelector('.setting');
const mediap = document.querySelector('.media-progress');
const media = document.querySelector('video');
const video = document.querySelector('.mainbtn');
const mainplay = document.querySelector('.fireshell-player');
const fireshelltop = document.querySelector('.fireshell-top');
const fullscreen = document.querySelector('.fullscr');
const durt = document.querySelector('.dur-text');
const vol = document.querySelector('.vol');
const forward = document.querySelector('.forward');
const backward = document.querySelector('.backward');
const vold = document.querySelector('.vol-d');
const float = document.querySelector('.float-plays');
const show = document.querySelector('.show-more');
const panel = document.querySelector('.panel');
const pbs = document.querySelector('.pbs');
const anno = document.querySelector('.wtmks');
const panelopt = document.querySelector('.panel-object');
const wtmksopt = document.querySelector('.wtmks-o');
const wtmks = document.querySelector('.wtmks');
const loadwheel = document.querySelector('.fireshell-load');
const extplay = document.querySelector('.onscr-play');
const sreset = document.querySelector('.reset-o');
const filterm = document.querySelector('.filters');
const allfilter = document.querySelector('.filter-video');
const pip = document.querySelector('.pip');
const vtitle = document.querySelector('.media-title');
const volval = document.querySelector('.sound-lvl');
vol.addEventListener('mousedown', function(){
if(media.volume){
avaIcon.style.opacity= '50%';
media.volume= 0;
vol.style.fill = 'rgb(24,24,24)';
}
else{
avaIcon.style.opacity =''
vol.style.fill = 'rgb(240,240,240)';
media.volume = 1;
}
})
media.playbackRate = 1;
pbs.innerHTML= '1x';
document.querySelector('.fireshell-player').addEventListener("mouseover", function(){
document.querySelector('.fireshell-top').style.visibility = 'visible';
document.querySelector('.dur-text').style.visibility = 'visible';
document.querySelector('.dur-text').style.animation = 'none';
document.querySelector('.dur-text').style.textAlign = 'center';
})
function discur(){
mainplay.style.cursor = 'none';
}
function loading(){
loadwheel.style.visibility = 'visible';
media.style.height = '30rem';
video.style.cursor ='not-allowed';
}
media.addEventListener('canplay', function(){
loadwheel.style.visibility = 'hidden';
vtitle.style.visibility = 'visible';
media.style.height = '';
video.style.cursor ='';
media.play();
})
if(media.paused){
mainplay.style.cursor = 'default';
}
mainplay.addEventListener('mouseover',function(){
setTimeout(discur,1000);
})
mainplay.addEventListener('mousemove', function(){
mainplay.style.cursor = '';
})
document.querySelector('.fireshell-player').addEventListener('mouseout', function(){
document.querySelector('.fireshell-top').style.visibility = 'hidden';
document.querySelector('.dur-text').style.visibility = 'visible';
document.querySelector('.dur-text').style.animation = 'dur-tect 1s 1';
float.style.visibility = 'hidden';
})
media.addEventListener('DOMContentLoaded', function(){
durt.innerHTML = Math.trunc( media.duration)+ '/' + Math.trunc (media.currentTime);
})
media.addEventListener('click', function(){
playm()
})
sreset.addEventListener('click', function(){
media.playbackRate = 1;
})
media.addEventListener('ended', function(){
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
mediap.value = 0;
})
panelopt.addEventListener('mousedown', function(){
panelopt.style.transform = 'scale(.94)'
})
panelopt.addEventListener('mouseup', function(){
panelopt.style.transform = 'scale(1)';
media.pause();
media.playbackRate += .25;
pbs.innerHTML=+media.playbackRate+ 'x';
if(media.playbackRate > 2){
media.playbackRate = 1;
pbs.innerHTML= ' 1x';
}
if(media.playbackRate == 1){
pbs.innerHTML= ' 1x';
}
})
let visi = 1;
wtmksopt.addEventListener('mousedown', function(){
wtmksopt.style.transform = 'scale(.94)'
})
wtmksopt.addEventListener('mouseup', function(){
wtmksopt.style.transform = 'scale(1)';
document.querySelector('.top-q').style.opacity = '0';
visi = 0;
wtmks.innerHTML = 'Off';
if(visi == 1){
document.querySelector('.top-q').style.opacity = '100%';
wtmks.innerHTML = 'On';
}
})
sreset.addEventListener('mousedown', function(){
sreset.style.transform = 'scale(.94)'
})
sreset.addEventListener('mouseup', function(){
sreset.style.transform = 'scale(1)';
})
media.onwaiting = (event) =>{
media.pause();
loadwheel.style.visibility = 'visible';
}
let fullscreenis;
fullscreen.addEventListener('click',function(){
fullscreenis = 1;
if(fullscreenis == 1){
document.querySelector('.fullcls').outerHTML =' <path class= "fullcls" fill-rule="evenodd" d="M.172 15.828a.5.5 0 0 0 .707 0l4.096-4.096V14.5a.5.5 0 1 0 1 0v-3.975a.5.5 0 0 0-.5-.5H1.5a.5.5 0 0 0 0 1h2.768L.172 15.121a.5.5 0 0 0 0 .707zM15.828.172a.5.5 0 0 0-.707 0l-4.096 4.096V1.5a.5.5 0 1 0-1 0v3.975a.5.5 0 0 0 .5.5H14.5a.5.5 0 0 0 0-1h-2.768L15.828.879a.5.5 0 0 0 0-.707z"/>'
}else if(fullscreenis == 0){
document.querySelector('.fullcls').outerHTML ='<path class="fullcls" fill-rule="evenodd" d="M5.828 10.172a.5.5 0 0 0-.707 0l-4.096 4.096V11.5a.5.5 0 0 0-1 0v3.975a.5.5 0 0 0 .5.5H4.5a.5.5 0 0 0 0-1H1.732l4.096-4.096a.5.5 0 0 0 0-.707zm4.344 0a.5.5 0 0 1 .707 0l4.096 4.096V11.5a.5.5 0 1 1 1 0v3.975a.5.5 0 0 1-.5.5H11.5a.5.5 0 0 1 0-1h2.768l-4.096-4.096a.5.5 0 0 1 0-.707zm0-4.344a.5.5 0 0 0 .707 0l4.096-4.096V4.5a.5.5 0 1 0 1 0V.525a.5.5 0 0 0-.5-.5H11.5a.5.5 0 0 0 0 1h2.768l-4.096 4.096a.5.5 0 0 0 0 .707zm-4.344 0a.5.5 0 0 1-.707 0L1.025 1.732V4.5a.5.5 0 0 1-1 0V.525a.5.5 0 0 1 .5-.5H4.5a.5.5 0 0 1 0 1H1.732l4.096 4.096a.5.5 0 0 1 0 .707z"/>' ;
}
fullscreen.style.transform = 'rotate(180deg)';
mainplay.requestFullscreen();
media.style.maxHeight= '90vh';
media.style.width='99%';
document.querySelector('.fireshell-bottom-cen').style.maxWidth = '100%';
})
settingbtn.addEventListener('click', function(){
filterm.style.visibility = 'visible';
filterm.style.animation = 'playbtnhover 500ms 1';
document.querySelector('.filter-video').style.visibility = 'visible';
})
if (
navigator.userAgent.match(/Android/i) ||
navigator.userAgent.match(/iPhone/i)
) {
window.close();
window.open('https://fireshell-m.netlify.app');
}
show.addEventListener('mousedown', function(){
show.style.backgroundColor = 'rgb(240,240,240,.775)';
panel.style.animation = 'fromtop-anim 1s 1';
panel.style.visibility = 'visible';
document.querySelector('.more-kit-p').style.visibility = 'hidden';
document.querySelector('.more-kit').style.visibility = 'hidden';
float.style.paddingLeft = '1rem';
float.style.paddingRight = '1rem';
float.style.visibility = 'visible';
show.style.visibility = 'hidden';
float.style.backgroundColor = 'rgb(240,240,240)';
extplay.style.visibility = 'hidden';
})
show.addEventListener('mouseup', function(){
show.style.backgroundColor = '';
show.style.fill ='';
})
document.querySelector('.close-o').addEventListener('mousedown', function(){
show.style.visibility = '';
panel.style.visibility = 'hidden';
document.querySelector('.more-kit-p').style.visibility = '';
document.querySelector('.more-kit').style.visibility = '';
panel.style.transition = 'none';
float.style.visibility = 'visible';
float.style.backgroundColor = '';
panelopt.style.transition = 'none';
wtmksopt.style.transition = 'none';
document.querySelector('.reset-o').style.transition ='none';
document.querySelector('.close-o').style.transition = 'none';
show.style.backgroundColor = 'rgb(24,24,24)';
show.style.fill ='';
})
document.querySelector('.close-o').addEventListener('mouseup', function(){
})
document.querySelector('.vol-d').addEventListener('click', function(){
extv.style.visibility = 'hidden';
extv.style.maxWidth = '0';
extv.style.position = 'fixed';
vol.style.position = 'relative';
vol.style.visibility = 'visible';
vol.style.transition = '300ms'
extv.style.visibility = 'visible';
extv.style.maxWidth= '3.5rem';
extv.style.position = 'fixed';
extv.style.marginBottom ='4rem';
})
forward.addEventListener('mousedown',function(){
media.currentTime = media.currentTime + 30;
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
forward.style.fill = 'rgb(2,97,217)';
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
})
function forwardgo(){
media.currentTime = media.currentTime + 30;
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
forward.style.fill = 'rgb(228, 228, 228)';
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
}
function forwardgoup(){
forward.style.fill = 'rgb(2,97,217)';
}
function backwardgo(){
media.currentTime = media.currentTime - 10;
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
backward.style.fill = 'rgb(228, 228, 228)';
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
}
function backwardgoup(){
backward.style.fill = 'rgb(2,97,217)';
}
forward.addEventListener('mouseup', function(){
forward.style.fill = 'rgb(228, 228, 228)';
})
backward.addEventListener('mousedown',function(){
media.currentTime = media.currentTime - 10;
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
backward.style.fill = 'rgb(2,97,217)';
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
})
backward.addEventListener('mouseup', function(){
backward.style.fill = 'rgb(228, 228, 228)';
})
const cineMode = document.querySelector('.cinev');
const dramMode = document.querySelector('.dramv');
const underMode = document.querySelector('.underv');
cineMode.addEventListener('click', function(){
filterm.style.visibility = 'hidden';
allfilter.style.visibility = 'visible';
allfilter.style.backgroundImage = ' linear-gradient(65deg,rgba(190, 94, 4, 0.158),rgba(180, 143, 21, 0.144))';
allfilter.style.animation = 'playbtnhover 500ms 1';
allfilter.style.backdropFilter = ' saturate(200%)';
})
underMode.addEventListener('click', function(){
filterm.style.visibility = 'hidden';
allfilter.style.visibility = 'visible';
allfilter.style.backgroundImage = ' linear-gradient(65deg,rgba(4, 117, 161, 0.158),rgba(5, 134, 167, 0.144))';
allfilter.style.animation = 'playbtnhover 500ms 1';
allfilter.style.backdropFilter = ' saturate(200%)';
})
dramMode.addEventListener('click', function(){
filterm.style.visibility = 'hidden';
allfilter.style.visibility = 'visible';
allfilter.style.backgroundImage = 'linear-gradient(65deg,rgba(7, 158, 70, 0.320)50%,rgba(68, 6, 6, 0.308))';
allfilter.style.animation = 'playbtnhover 500ms 1';
allfilter.style.backdropFilter = ' saturate(200%)';
})
pip.addEventListener('click', function(){
media.requestPictureInPicture();
media.pause();
})
media.addEventListener('dblclick', function(){
media.currentTime = media.currentTime + 30;
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
forward.style.animation = 'time-anim 500ms 1';
document.querySelector('.fireshell-player').style.animation = 'fireshell-for 1s 1';
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
})
media.addEventListener('focusin', function(){
media.currentTime = media.currentTime - 10;
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
backward.style.animation = 'time-anim 500ms 1';
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
})
mediap.addEventListener('mousedown', function(event) {
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
});
media.addEventListener('ended', function(){
media.currentTime = 0;
media.play();
video.style.transform = 'scale(.7)';
video.style.stroke = 'rgb(24,24,24)';
video.style.fill = 'rgb(240,240,240)';
document.querySelector('.fireshell-player').style.boxShadow = 'none';
})
media.addEventListener('volumechange', function(){
document.querySelector('.fireshell-top').style.visibility = 'visible';
})
media.addEventListener('playing', function(){
document.title = 'Fireshell • Playing';
media.play();
extplay.style.animation = 'extplay-o 500ms 1';
extplay.style.visibility = 'hidden'
avaIcon.style.visibility = 'visible';
video.style.transform = 'scale(.7)';
video.style.stroke = 'rgb(24,24,24)';
video.style.fill = 'rgb(240,240,240)';
document.querySelector('.fireshell-player').style.boxShadow = 'none';
})
media.addEventListener('pause', function(){
extplay.style.visibility = 'visible';
extplay.style.animation = 'extplay-c 200ms 1';
document.title = 'Fireshell';
avaIcon.style.visibility = 'hidden';
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
})
function javascriptvoid1(){
document.querySelector('.setting-pop').style.visibility = 'hidden';
}
media.addEventListener('timeupdate', function(){
mediap.value =100 / media.duration * media.currentTime ;
durt.innerHTML = Math.trunc(Math.round( media.duration )/60)+ '/ ' + Math.trunc( Math.round(media.currentTime));
localStorage.setItem('lastdur', media.currentTime);
})
mainplay.addEventListener('fullscreenchange', function(){
media.style.maxHeight = '26rem';
fullscreen.style.transform = '';
fullscreenis = 0;
})
function playm(){
if(media.paused){
media.play();
video.style.transform = 'scale(.7)';
video.style.stroke = 'rgb(24,24,24)';
video.style.fill = 'rgb(240,240,240)';
document.querySelector('.fireshell-player').style.boxShadow = 'none';
}
else{
video.style.transform = 'scale(.6)';
video.style.stroke = 'rgb(240,240,240)';
video.style.fill = 'rgb(24,24,24)';
media.pause();
document.querySelector('.fireshell-player').style.boxShadow = 'inset 0 0 100vh rgba(0, 0, 0, 0.829)';
}
}
media.addEventListener('enterpictureinpicture', function(){
document.querySelector('body').requestFullscreen()
})
video.addEventListener('mouseout', function(){
video.style.transform = 'scale(.6)';
})
//referances
//<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-volume-down-fill" viewBox="0 0 16 16"><path d="M9 4a.5.5 0 0 0-.812-.39L5.825 5.5H3.5A.5.5 0 0 0 3 6v4a.5.5 0 0 0 .5.5h2.325l2.363 1.89A.5.5 0 0 0 9 12V4zm3.025 4a4.486 4.486 0 0 1-1.318 3.182L10 10.475A3.489 3.489 0 0 0 11.025 8 3.49 3.49 0 0 0 10 5.525l.707-.707A4.486 4.486 0 0 1 12.025 8z"/></svg>
//<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-volume-off-fill" viewBox="0 0 16 16"><path d="M10.717 3.55A.5.5 0 0 1 11 4v8a.5.5 0 0 1-.812.39L7.825 10.5H5.5A.5.5 0 0 1 5 10V6a.5.5 0 0 1 .5-.5h2.325l2.363-1.89a.5.5 0 0 1 .529-.06z"/></svg>