-
Notifications
You must be signed in to change notification settings - Fork 0
/
hi-mia.html
70 lines (60 loc) · 2.52 KB
/
hi-mia.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hi Mia Mac</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap">
<link href="./resources/CSS/Mia.css" rel="stylesheet">
</head>
<body>
<audio id="bg-music" autoplay loop>
<source src="./resources/music/MoiChamMoi.mp3" type="audio/mp3">
Your browser does not support the audio tag.
</audio>
<div class="top-right">
<button class="play-pause-btn" onclick="togglePlayPause()">
<span id="play-icon" class="icon">▶</span> <!-- Play icon -->
<span id="pause-icon" class="icon" style="display: none;">▌▌</span> <!-- Pause icon -->
</button>
</div>
<svg class="arrow-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" onclick="goToMeeting()">
<path d="M20 12H4" stroke="#464646" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10 18L4 12L10 6" stroke="#464646" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<div id="section1" class="main1">
<h1>Hi Mia, you have a new message!</h1>
<div class="message-container">
<p>Shall we play some music before reading this message? Nevermind you don't a choice!</p>
<p>If you are ready to read the message</p>
<button class="button" onclick="openMessage()">Click Here</button>
</div>
</div>
<script src="Mia.js"></script>
<script>
function goToMeeting() {
window.location.href = 'index.html'; // Redirect to the "Meeting" page
}
function openMessage() {
window.location.href = 'hi-mia1.html'; // Scroll to section 2 where the message is
}
// Function to toggle play/pause
function togglePlayPause() {
var bgMusic = document.getElementById('bg-music');
var playIcon = document.getElementById('play-icon');
var pauseIcon = document.getElementById('pause-icon');
if (bgMusic.paused) {
bgMusic.play();
playIcon.style.display = 'none';
pauseIcon.style.display = 'inline';
localStorage.setItem('musicState', 'playing');
} else {
bgMusic.pause();
playIcon.style.display = 'inline';
pauseIcon.style.display = 'none';
localStorage.setItem('musicState', 'paused');
}
}
</script>
</body>
</html>