This commit is contained in:
zyqunix 2025-05-11 15:02:58 +02:00
parent 13de9931b0
commit 75a96b576c
No known key found for this signature in database
GPG key ID: 134A8DEEA83B80E6
3 changed files with 8 additions and 2 deletions

View file

@ -624,7 +624,11 @@ div[class="cards sitemap shadow"] > h4 {
} }
#artist { #artist {
cursor: pointer; transition: color 0.1s;
}
#artist:hover {
color: #c099ff;
} }
#song-cover { #song-cover {

View file

@ -211,6 +211,7 @@ function fetchSong() {
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
console.log(data);
const track = data?.recenttracks?.track?.[0]; const track = data?.recenttracks?.track?.[0];
if (!track) return; if (!track) return;
const artist = track.artist["#text"]; const artist = track.artist["#text"];
@ -218,6 +219,7 @@ function fetchSong() {
const image = track.image.find(img => img.size === "extralarge")?.["#text"] || ""; const image = track.image.find(img => img.size === "extralarge")?.["#text"] || "";
document.getElementById("artist").innerText = artist; document.getElementById("artist").innerText = artist;
document.getElementById("artist").href = `https://duckduckgo.com/?q=${artist}`;
document.getElementById("song-name").innerText = title; document.getElementById("song-name").innerText = title;
document.getElementById("song-cover").src = !image ? "https://lastfm.freetls.fastly.net/i/u/64s/4128a6eb29f94943c9d206c08e625904.jpg" : image; document.getElementById("song-cover").src = !image ? "https://lastfm.freetls.fastly.net/i/u/64s/4128a6eb29f94943c9d206c08e625904.jpg" : image;
document.getElementById("song-url").href = track.url; document.getElementById("song-url").href = track.url;

View file

@ -114,7 +114,7 @@
<div class="music"> <div class="music">
<img src="assets/img/dancing-banan.gif" class="banan" id="banan"> <img src="assets/img/dancing-banan.gif" class="banan" id="banan">
<div class="music-pop shadow" id="music-pop"> <div class="music-pop shadow" id="music-pop">
<div class="top"><h3>Listening To <a id="artist">No one</a></h3> <div class="top"><h3>Listening To <a id="artist" target="_blank">No one</a></h3>
<button id="close"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g id="Menu / Close_MD"> <path id="Vector" d="M18 18L12 12M12 12L6 6M12 12L18 6M12 12L6 18" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="--darkreader-inline-stroke: var(--darkreader-text-ffffff, #e8e6e3);" data-darkreader-inline-stroke=""></path> </g> </g></svg></button></div> <button id="close"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g id="Menu / Close_MD"> <path id="Vector" d="M18 18L12 12M12 12L6 6M12 12L18 6M12 12L6 18" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="--darkreader-inline-stroke: var(--darkreader-text-ffffff, #e8e6e3);" data-darkreader-inline-stroke=""></path> </g> </g></svg></button></div>
<div class="song"> <div class="song">
<div> <div>