-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPagesHome.html
95 lines (88 loc) · 2.89 KB
/
PagesHome.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page Home ke 1</title>
<link rel="stylesheet" href="pages.css" />
</head>
<body>
<!-- HOME PAGE -->
<!-- Video latar belakang -->
<video id="backgroundVideo" autoplay loop muted>
<source src="video/hompageVid2.mp4" type="video/mp4" />
Your browser does not support the video element.
</video>
<!-- Ikon Foto Card -->
<div class="window">
<div class="profile-card">
<img
src="ImageAsetNatal/logo panitia.jpg"
alt="Foto Profil"
class="profile-photo"
/>
<h4>NATAL IPMAP SE-JAWA DAN BALI</h4>
<h5 style="color: whitesmoke">
<!-- Opening: Typing Effect -->
<div id="opening"></div>
</h5>
</div>
<div class="button-container" id="button-container" style="display: none">
<button onclick="openPage('invinition.html')">Buka Undangan</button>
</div>
</div>
<!-- Audio Section -->
<audio id="backgroundAudio" autoplay loop>
<source src="audio/holy Night.Mp3" type="audio/mp3" />
Your browser does not support the audio element.
</audio>
<!-- Script -->
<script>
// Teks untuk efek mengetik
const texts = [
"Yth: Kepada 9 BPKW IPMAP Se-Jawa dan Bali,",
"Dengan Penuh sukacita kami,",
" panitia Natal,",
"mengundang saudara",
"/i untuk, bergabung bersama kami dalam Ibadah Perayaan Natal bersama IPMAP!",
"Merry Christmas!",
];
const openingElement = document.getElementById("opening");
const buttonContainer = document.getElementById("button-container");
let textIndex = 0;
let charIndex = 0;
function typeEffect() {
if (textIndex < texts.length) {
if (charIndex < texts[textIndex].length) {
openingElement.textContent += texts[textIndex][charIndex];
charIndex++;
setTimeout(typeEffect, 200);
} else {
textIndex++;
charIndex = 0;
openingElement.innerHTML += "<br>";
setTimeout(typeEffect, 500);
}
} else {
setTimeout(() => {
buttonContainer.style.display = "block";
}, 500);
}
}
// Mulai efek mengetik saat halaman dimuat
window.onload = function () {
typeEffect();
const audioElement = document.getElementById("backgroundAudio");
// Cegah audio berhenti saat berpindah halaman
if (sessionStorage.getItem("isAudioPlaying") !== "true") {
audioElement.play();
sessionStorage.setItem("isAudioPlaying", "true");
}
};
function openPage(url) {
window.location.href = url;
}
</script>
<script src="Pages.js"></script>
</body>
</html>