eqya5ruretjsuserjthrtdeharedshywrstgwryewyRyhwrwRYHYWr4

This commit is contained in:
EduardSkibidiEdger 2024-12-01 19:44:45 +02:00
parent bb2eba07ba
commit 20992d8045
3 changed files with 44 additions and 160 deletions

View file

@ -21,6 +21,8 @@
}
</script>
<style>
body {
margin: 0;
padding: 0;
@ -43,13 +45,10 @@
z-index: -1;
transition: background-image 1s ease-in-out;
}
#album-cover img {
max-width: 100%;
height: auto;
box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.7);
opacity: 0;
transition: opacity 1s ease-in-out;
}
#album-cover {
display: none; /* Hide the album cover element */
}
#album-cover img.visible {
opacity: 1;
}
@ -102,7 +101,7 @@
</filter>
</defs>
<path d="M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z" filter="url(#drop-shadow)"/>
</svg><p style="height: 200px;"></p>
</svg><p style="height: 210px;"></p>
<div id="app"></div><p style="height: 170px;"></p>
<div id="lastfm-widget"></div>
<div id="widget">
@ -128,7 +127,7 @@
function updateSongDisplay(track) {
const { name, artist, album, image } = track;
songElement.classList.remove('updated');
songElement.innerHTML = `${name} - ${artist['#text']}<div>${album['#text']}</div>`;
songElement.innerHTML = `${name} <br> ${artist['#text']}<div>${album['#text']}</div>`;
setTimeout(() => songElement.classList.add('updated'), 50);
let albumImage = image[2]['#text'] || placeholderImage;
@ -189,5 +188,40 @@
});
});
</script>
<script>
let currentSong = {
title: '',
artist: ''
};
// Update currentSong with the track details every time the track changes
webamp.onTrackDidChange((trackInfo) => {
if (trackInfo) {
currentSong = {
title: trackInfo.metaData.title || '',
artist: trackInfo.metaData.artist || ''
};
console.log('Currently playing:', currentSong);
} else {
// If no track is playing, set the song to empty values
currentSong = {
title: '',
artist: ''
};
console.log('No track is currently playing');
}
});
// You can check the current song at any time
function getCurrentSong() {
return currentSong;
}
// Example of how you can get the current song manually:
setInterval(() => {
console.log('Current Song:', getCurrentSong());
}, 5000); // Logs the current song every 5 seconds
</script>
</body>
</html>