-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.html
37 lines (32 loc) · 1.09 KB
/
start.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Start Page</title>
<link rel="stylesheet" href="./Startstyle.css">
</head>
<body>
<div class="start-container">
<button id="start-button">
<span>Start</span>
</button>
</div>
<audio id="background-music" loop>
<source src="./assets/retro-groove-202425.mp3" type="audio/mpeg">
</audio>
<script>
document.getElementById('start-button').addEventListener('click', function() {
const audio = document.getElementById('background-music');
//Play the audio
audio.play().then(() => {
sessionStorage.setItem('playMusic', 'true');
}).catch(error => {
console.error('Auto-play failed:', error);
sessionStorage.setItem('playMusic', 'false');
});
window.location.href = 'index.html';
});
</script>
</body>
</html>