fix(Dribbblish): playlist icon fallback (#806)

This commit is contained in:
Nam Anh 2022-07-21 20:30:07 +07:00 committed by GitHub
parent 86f72355ff
commit d7a399bf29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 2 deletions

View File

@ -34,6 +34,13 @@ function waitForElement(els, func, timeout = 100) {
} }
} }
// Avoid clipping playlists at the bottom of scroll node
waitForElement([".main-rootlist-wrapper"], () => {
const mainRootlist = document.querySelector(".main-rootlist-wrapper");
const playListItems = document.getElementsByClassName("main-rootlist-rootlistItemLink")
mainRootlist.style.height = `${playListItems.length * 56}px`;
});
waitForElement([ waitForElement([
`ul[tabindex="0"]`, `ul[tabindex="0"]`,
`ul[tabindex="0"] .GlueDropTarget--playlists.GlueDropTarget--folders` `ul[tabindex="0"] .GlueDropTarget--playlists.GlueDropTarget--folders`
@ -59,7 +66,7 @@ waitForElement([
img.classList.add("playlist-picture"); img.classList.add("playlist-picture");
link.prepend(img); link.prepend(img);
} }
img.src = base64 || "/images/tracklist-row-song-fallback.svg"; img.src = base64 || "https://cdn.jsdelivr.net/gh/spicetify/spicetify-themes@master/Dribbblish/images/tracklist-row-song-fallback.svg";
continue; continue;
} }
@ -74,7 +81,7 @@ waitForElement([
img.classList.add("playlist-picture"); img.classList.add("playlist-picture");
link.prepend(img); link.prepend(img);
} }
img.src = meta.picture || "/images/tracklist-row-song-fallback.svg"; img.src = meta.picture || "https://cdn.jsdelivr.net/gh/spicetify/spicetify-themes@master/Dribbblish/images/tracklist-row-song-fallback.svg";
}); });
} }
} }

View File

@ -0,0 +1 @@
<svg width="80" height="81" viewBox="0 0 80 81" xmlns="http://www.w3.org/2000/svg"><title>Playlist Icon</title><path d="M25.6 11.565v45.38c-2.643-3.27-6.68-5.37-11.2-5.37-7.94 0-14.4 6.46-14.4 14.4s6.46 14.4 14.4 14.4 14.4-6.46 14.4-14.4v-51.82l48-10.205V47.2c-2.642-3.27-6.678-5.37-11.2-5.37-7.94 0-14.4 6.46-14.4 14.4s6.46 14.4 14.4 14.4S80 64.17 80 56.23V0L25.6 11.565zm-11.2 65.61c-6.176 0-11.2-5.025-11.2-11.2 0-6.177 5.024-11.2 11.2-11.2 6.176 0 11.2 5.023 11.2 11.2 0 6.174-5.026 11.2-11.2 11.2zm51.2-9.745c-6.176 0-11.2-5.024-11.2-11.2 0-6.174 5.024-11.2 11.2-11.2 6.176 0 11.2 5.026 11.2 11.2 0 6.178-5.026 11.2-11.2 11.2z" fill="currentColor" fill-rule="evenodd"></path></svg>

After

Width:  |  Height:  |  Size: 686 B

View File

@ -503,6 +503,12 @@ img.playlist-picture {
border-radius: 50%; border-radius: 50%;
} }
img.playlist-picture[src$=".svg"] {
width: 24px;
height: 24px;
border-radius: 0;
}
.main-rootlist-rootlistItem a span { .main-rootlist-rootlistItem a span {
margin-left: 24px; margin-left: 24px;
} }