Skip to content

Commit

Permalink
Update hazy.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Astromations authored Jun 19, 2023
1 parent 58c325c commit 2519deb
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions hazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,22 @@
windowControls();
galaxyFade();

function scrollToElement() {
const elementToScroll = document.querySelector('.contentSpacing');
const scrollOptions = {
behavior: 'smooth',
block: 'start'
};

elementToScroll.scrollIntoView(scrollOptions);
}

waitForElement(['span.main-entityHeader-topbarTitle'], () => {
const spanElement = document.querySelector('.main-entityHeader-topbarTitle');
spanElement.addEventListener('click', scrollToElement);
scrollToElement();
});

(function sidebar() {
// Sidebar settings
const item = localStorage.getItem("spicetify-exp-features");
Expand Down Expand Up @@ -154,21 +170,6 @@
}
}

waitForElement(['span.main-entityHeader-topbarTitle'], (scrollToElement) => {
const spanElement = document.querySelector('span.main-entityHeader-topbarTitle');
const elementToScroll = document.querySelector('.contentSpacing');
const scrollOptions = {
behavior: 'smooth',
block: 'start'
};

function scrollToElement() {
elementToScroll.scrollIntoView(scrollOptions);
}

spanElement.addEventListener('click', scrollToElement);
});

waitForElement(['.Root__lyrics-cinema'], () => {
const lyricsCinema = document.getElementsByClassName('Root__lyrics-cinema')[0];
const lyricsCinemaObserver = new MutationObserver(updateLyricsPageProperties);
Expand Down

0 comments on commit 2519deb

Please sign in to comment.