Better display of the large album cover in the friends list

This commit is contained in:
Lukas Kleybolte 2021-02-28 12:24:06 +01:00
parent aa9b532e82
commit 23d8cc71f0
2 changed files with 20 additions and 0 deletions

View File

@ -178,6 +178,20 @@ waitForElement([".LeftSidebar"], (queries) => {
queries[0].append(fade);
});
var big_album_cover = document.querySelector('#now-playing-image-small');
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.type == "attributes") {
if(big_album_cover.getAttribute("data-log-context") === "cover-large"){
document.documentElement.style.setProperty('--move_buddy_list', "250px");
}else{
document.documentElement.style.setProperty('--move_buddy_list', "0px");
}
}
});
});
function getAlbumInfo(uri) {
return new Promise((resolve) => { Spicetify.CosmosAPI.resolver.get(`hm://album/v1/album-app/album/${uri}/desktop`, (err, raw) => {
resolve(!err && raw.getJSONBody())

View File

@ -11,6 +11,7 @@
--os-windows-icon-dodge: 1;
--image_url: '';
--is_light: 0;
--move_buddy_list: 0px;
}
div#popover-container::before {
@ -975,6 +976,11 @@ select {
/* Friend list */
.body-container--windows .buddy-list-iframe {
margin-top: 48px;
margin-bottom: var(--move_buddy_list);
}
.buddy-list-title h3 {
font-weight: 500;
color: var(--modspotify_secondary_fg);