-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
51 lines (44 loc) · 1.58 KB
/
script.js
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
window.onload = function () {
document
.querySelector(".video-background")
.classList.add("opacity-100");
};
const player = document.getElementById("youtube-player");
const audio = document.getElementById("audio");
const playButton = document.getElementById("playButton");
const pauseButton = document.getElementById("pauseButton");
const volumeSlider = document.getElementById("volume");
playButton.addEventListener("click", () => {
audio.play();
playButton.classList.add("hidden");
pauseButton.classList.remove("hidden");
});
pauseButton.addEventListener("click", () => {
audio.pause();
pauseButton.classList.add("hidden");
playButton.classList.remove("hidden");
});
volumeSlider.addEventListener("input", (e) => {
audio.volume = e.target.value;
});
function updateDateTime() {
const now = new Date();
const options = {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric",
timeZone: "America/Los_Angeles",
};
document.getElementById("currentDate").textContent =
now.toLocaleDateString("en-US", options);
const timeOptions = {
hour: "2-digit",
minute: "2-digit",
timeZone: "America/Los_Angeles",
};
document.getElementById("currentTime").textContent =
now.toLocaleTimeString("en-US", timeOptions);
}
updateDateTime();
setInterval(updateDateTime, 10000);