-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbadgerhome.js
More file actions
22 lines (18 loc) · 762 Bytes
/
Copy pathbadgerhome.js
File metadata and controls
22 lines (18 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const logo = document.getElementById('logo');
const audio = document.getElementById('audio');
const backgroundImg = document.getElementById('background-img');
const backgroundVideo = document.getElementById('background-video');
logo.addEventListener('click', () => {
if(backgroundImg.style.display == 'none'){
backgroundImg.style.display = 'block';
backgroundVideo.style.display = 'none';
audio.pause();
audio.currentTime = 0;
backgroundImg.src = './pics/fondopic.png';
}else{
audio.play();
backgroundImg.style.display = 'none'; // Hides the background image
backgroundVideo.style.display = 'block'; // Shows the video as background
backgroundVideo.src = './videos/badgers.mp4';
}
});