From 8734446907a5309874f107eef5ef50eff9de8618 Mon Sep 17 00:00:00 2001 From: z0x Date: Sat, 19 Apr 2025 20:38:48 -0400 Subject: [PATCH] fix: order of class appearance in motion.dev --- src/js/index.ts | 10 +++++++--- src/js/music.ts | 4 +--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/js/index.ts b/src/js/index.ts index 484e9f1..c08ecf8 100644 --- a/src/js/index.ts +++ b/src/js/index.ts @@ -1,8 +1,12 @@ import { animate, stagger } from "motion"; -const elements = document.querySelectorAll( - ".motion-links, .motion-logo, .motion-text, .motion-music, .motion-footer", -); +const links = document.querySelectorAll(".motion-links"); +const logo = document.querySelectorAll(".motion-logo"); +const text = document.querySelectorAll(".motion-text"); +const footer = document.querySelectorAll(".motion-footer"); +const music = document.querySelectorAll(".motion-music"); + +const elements = [...text, ...logo, ...links, ...footer, ...music]; animate( elements, diff --git a/src/js/music.ts b/src/js/music.ts index 8a0828f..d0c71d5 100644 --- a/src/js/music.ts +++ b/src/js/music.ts @@ -87,7 +87,7 @@ async function fetchAndDisplayLastTrack() { if (albumCover) { imageElement = `Album Cover`; } else { - imageElement = ""; // Do not display anything + imageElement = ""; } container.innerHTML = ` @@ -121,8 +121,6 @@ async function fetchAndDisplayLastTrack() { console.error("Fetch error:", e); container.innerHTML = "

Error loading tracks.

"; } finally { - container.classList.remove("opacity-0"); - container.classList.add("opacity-100"); } }