mirror of
https://github.com/zyqunix/tools.git
synced 2025-07-05 22:10:31 +02:00
fixes
This commit is contained in:
parent
13de9931b0
commit
75a96b576c
3 changed files with 8 additions and 2 deletions
|
@ -624,7 +624,11 @@ div[class="cards sitemap shadow"] > h4 {
|
|||
}
|
||||
|
||||
#artist {
|
||||
cursor: pointer;
|
||||
transition: color 0.1s;
|
||||
}
|
||||
|
||||
#artist:hover {
|
||||
color: #c099ff;
|
||||
}
|
||||
|
||||
#song-cover {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
<div class="music">
|
||||
<img src="assets/img/dancing-banan.gif" class="banan" id="banan">
|
||||
<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>
|
||||
<div class="song">
|
||||
<div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue