-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const scores = [ | ||
{ date: "2024-01-06", score: 80 }, | ||
{ date: "2024-01-05", score: 75 }, | ||
// Add more scores as needed | ||
]; | ||
|
||
// Function to display score history | ||
function displayScoreHistory() { | ||
const scoreList = document.getElementById("score-list"); | ||
scoreList.innerHTML = ""; // Clear existing list | ||
|
||
scores.forEach((entry) => { | ||
const listItem = document.createElement("li"); | ||
listItem.textContent = `Date: ${entry.date}, Score: ${entry.score}%`; | ||
scoreList.appendChild(listItem); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
let index = Math.floor(Math.random() * 5) + 1; | ||
let bgMusic = new Audio(`/assets/bg_music/${index}.mp3`); | ||
|
||
function changeMusic() { | ||
bgMusic.src = `/assets/bg_music${index}.mp3`; | ||
if (index <= 5) { | ||
index += 1; | ||
} else { | ||
index = 1; | ||
} | ||
} | ||
|
||
window.addEventListener("load", () => { | ||
bgMusic.play(); | ||
}); | ||
|
||
bgMusic.addEventListener("ended", () => { | ||
changeMusic(); | ||
}); |