added music correctly

This commit is contained in:
fatmeatwsl 2025-04-22 19:27:48 +02:00
parent c0887f5e71
commit 6c3380709d
2 changed files with 19 additions and 4 deletions

View File

@ -64,12 +64,15 @@ body {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 9999;
cursor: pointer;
}
.loading-text {
color: #00ffff; color: #00ffff;
font-family: 'Orbitron', sans-serif; font-family: 'Orbitron', sans-serif;
font-size: 2rem; font-size: 2rem;
text-shadow: 0 0 10px #00ffff; text-shadow: 0 0 10px #00ffff;
z-index: 9999;
cursor: pointer;
animation: pulse 1.5s infinite; animation: pulse 1.5s infinite;
} }

View File

@ -47,8 +47,8 @@ const playlist = [
let currentTrack = 0; let currentTrack = 0;
const audio = new Audio(); const audio = new Audio();
audio.loop = false; audio.loop = true;
audio.volume = 0.5; audio.volume = 0.2;
const nowPlaying = document.getElementById('now-playing'); const nowPlaying = document.getElementById('now-playing');
const playPauseBtn = document.getElementById('play-pause-btn'); const playPauseBtn = document.getElementById('play-pause-btn');
@ -89,3 +89,15 @@ audio.addEventListener('ended', () => {
document.getElementById('loading-screen')?.addEventListener('click', () => { document.getElementById('loading-screen')?.addEventListener('click', () => {
loadTrack(0); loadTrack(0);
}); });
window.addEventListener('DOMContentLoaded', () => {
const loadingScreen = document.getElementById('loading-screen');
const music = new Audio(); // your audio logic might be handled elsewhere now
if (loadingScreen) {
loadingScreen.addEventListener('click', () => {
loadingScreen.style.display = 'none'; // hides the full screen
loadTrack(0); // start the music playlist
});
}
});