diff --git a/assets/css/style.css b/assets/css/style.css index 48d8e7f..64f4d11 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -624,7 +624,11 @@ div[class="cards sitemap shadow"] > h4 { } #artist { - cursor: pointer; + transition: color 0.1s; +} + +#artist:hover { + color: #c099ff; } #song-cover { diff --git a/assets/js/index.js b/assets/js/index.js index 21e2f5c..a9a39df 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -211,6 +211,7 @@ function fetchSong() { fetch(url) .then(response => response.json()) .then(data => { + console.log(data); const track = data?.recenttracks?.track?.[0]; if (!track) return; const artist = track.artist["#text"]; @@ -218,6 +219,7 @@ function fetchSong() { const image = track.image.find(img => img.size === "extralarge")?.["#text"] || ""; document.getElementById("artist").innerText = artist; + document.getElementById("artist").href = `https://duckduckgo.com/?q=${artist}`; 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-url").href = track.url; diff --git a/index.html b/index.html index ac2e1a7..0566f4a 100644 --- a/index.html +++ b/index.html @@ -114,7 +114,7 @@