-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
65 lines (55 loc) · 1.76 KB
/
main.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
console.log('skibidi toilet')
let skibiditoilet;
var movie = document.getElementById('embed');
var gofullscreen = document.getElementById('gofullscreen');
function fullscreen() {
movie.style.width = '100%';
movie.style.height = '100vh';
movie.style.position = 'fixed';
movie.style.borderRadius = '0';
movie.style.top = '0';
movie.style.left = '0';
gofullscreen.style.display = 'none';
const toast = document.createElement('div');
toast.id = 'fullscreen-toast';
toast.textContent = 'Press escape to exit fullscreen';
document.body.appendChild(toast);
toast.style.position = 'fixed';
toast.style.top = '-75px';
toast.style.left = '50%';
toast.style.transform = 'translateX(-50%)';
toast.style.backgroundColor = '#333';
toast.style.color = '#fff';
toast.style.padding = '20px 30px';
toast.style.borderRadius = '15px';
toast.style.boxShadow = '0px 4px 6px rgba(0, 0, 0, 0.1)';
toast.style.zIndex = '1000';
toast.style.transition = 'top 0.5s ease';
toast.style.fontSize = '18px';
setTimeout(() => {
toast.style.top = '15px';
}, 300);
setTimeout(() => {
toast.style.top = '-100px';
setTimeout(() => {
toast.remove();
}, 500);
}, 4000);
}
function exitFullscreen() {
movie.style.width = '1050px';
movie.style.height = '590px';
movie.style.borderRadius = '20px';
movie.style.position = 'relative';
gofullscreen.style.display = 'block';
}
document.addEventListener('keydown', (event) => {
if (event.key === 'Escape') {
exitFullscreen();
}
});
document.addEventListener('keydown', (event) => {
if (event.key === 'f') {
fullscreen();
}
});