fix: order of class appearance in motion.dev
All checks were successful
build dist / build-dist (push) Successful in 31s
All checks were successful
build dist / build-dist (push) Successful in 31s
This commit is contained in:
parent
35ec0ed7db
commit
8734446907
2 changed files with 8 additions and 6 deletions
|
@ -1,8 +1,12 @@
|
||||||
import { animate, stagger } from "motion";
|
import { animate, stagger } from "motion";
|
||||||
|
|
||||||
const elements = document.querySelectorAll(
|
const links = document.querySelectorAll(".motion-links");
|
||||||
".motion-links, .motion-logo, .motion-text, .motion-music, .motion-footer",
|
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(
|
animate(
|
||||||
elements,
|
elements,
|
||||||
|
|
|
@ -87,7 +87,7 @@ async function fetchAndDisplayLastTrack() {
|
||||||
if (albumCover) {
|
if (albumCover) {
|
||||||
imageElement = `<img src="${albumCover}" alt="Album Cover" class="mb-2 rounded shadow-md w-32 h-32 object-cover">`;
|
imageElement = `<img src="${albumCover}" alt="Album Cover" class="mb-2 rounded shadow-md w-32 h-32 object-cover">`;
|
||||||
} else {
|
} else {
|
||||||
imageElement = ""; // Do not display anything
|
imageElement = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
|
@ -121,8 +121,6 @@ async function fetchAndDisplayLastTrack() {
|
||||||
console.error("Fetch error:", e);
|
console.error("Fetch error:", e);
|
||||||
container.innerHTML = "<p>Error loading tracks.</p>";
|
container.innerHTML = "<p>Error loading tracks.</p>";
|
||||||
} finally {
|
} finally {
|
||||||
container.classList.remove("opacity-0");
|
|
||||||
container.classList.add("opacity-100");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue