Skip to content

Commit 678e5f5

Browse files
authored
📦 Updates
1 parent 3718169 commit 678e5f5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

assets/js/scripts/link-start.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const linkStartBtn = document.getElementById('linkStartBtn');
2+
const linkStartVideo = document.getElementById('linkStartVideo');
3+
const linkStartAudio = new Audio('./assets/videos-audios/link-start.mp3');
4+
5+
function openFullscreen() {
6+
/*
7+
Opens video on FullScreen automatically
8+
*/
9+
10+
/* Chrome, Opera, Vivaldi... */
11+
if (linkStartVideo.requestFullscreen) { linkStartVideo.requestFullscreen(); }
12+
13+
/* Safari */
14+
else if (linkStartVideo.webkitRequestFullscreen) { linkStartVideo.webkitRequestFullscreen(); }
15+
16+
/* IE11 */
17+
else if (linkStartVideo.msRequestFullscreen) { linkStartVideo.msRequestFullscreen(); }
18+
}
19+
20+
linkStartBtn.addEventListener('click', () => {
21+
/*
22+
When 'old version button' is clicked, the video
23+
is open on full screen and played automatically
24+
*/
25+
alert('We are moving to the Old Version. Enjoy yourself! 😊');
26+
linkStartVideo.style.display = 'block';
27+
openFullscreen();
28+
linkStartAudio.play();
29+
});
30+
31+
linkStartVideo.addEventListener('ended', () => {
32+
window.location.href = './old/index.html';
33+
alert('Loading has been successfully completed! ✔️');
34+
});

0 commit comments

Comments
 (0)