mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added auto scroll when text is too long
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
const mainWrapper = document.getElementById('main-wrapper');
|
||||
const albumArtContainer = document.getElementById('album-art-container');
|
||||
const songInfoContainer = document.getElementById('song-info-container');
|
||||
const songInfoWrapper = document.getElementById('song-info-wrapper');
|
||||
const albumArtLayer = document.getElementById('album-art-layer');
|
||||
const albumArtTransition = document.getElementById('album-art-transition-layer');
|
||||
const backgroundLayer = document.getElementById('background-layer');
|
||||
@@ -48,6 +49,10 @@ switch (themeVariant) {
|
||||
break;
|
||||
}
|
||||
|
||||
// If text alignment is 'right', swap the album art to the right hand side too
|
||||
if (textAlignment == 'right') {
|
||||
songInfoContainer.style.flexDirection = 'row-reverse';
|
||||
}
|
||||
|
||||
|
||||
////////////////////
|
||||
@@ -65,8 +70,8 @@ async function ChangeTrack(mediaProps, accentColorPalette) {
|
||||
|
||||
// Wait for fade (0.5s), then swap the real text and hide overlay
|
||||
setTimeout(async () => {
|
||||
trackLabel.innerText = swapArtistTrack ? mediaProps.Artist : mediaProps.Title;
|
||||
artistLabel.innerText = swapArtistTrack ? mediaProps.Title : mediaProps.Artist;
|
||||
SetLabelText('track-label', swapArtistTrack ? mediaProps.Artist : mediaProps.Title);
|
||||
SetLabelText('artist-label', swapArtistTrack ? mediaProps.Title : mediaProps.Artist);
|
||||
|
||||
switch (themeVariant) {
|
||||
case "matte":
|
||||
@@ -100,6 +105,8 @@ async function ChangeTrack(mediaProps, accentColorPalette) {
|
||||
backgroundLayer.style.opacity = "";
|
||||
albumArtLayer.style.opacity = "";
|
||||
|
||||
console.log(songInfoWrapper.clientWidth);
|
||||
|
||||
setTimeout(() => {
|
||||
// Set the image
|
||||
backgroundTransitionLayer.style.backgroundImage = `url('${newArtUrl}')`;
|
||||
|
||||
Reference in New Issue
Block a user