Skip to content

Commit

Permalink
fix: sometime animation card not triggering
Browse files Browse the repository at this point in the history
  • Loading branch information
KawaiiZapic committed Sep 5, 2024
1 parent e291f20 commit abed0cc
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/pages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ export function init() {
parent.classList.add("matecho-article-card__animating");
document.body.appendChild(parent);
document.body.style.overflow = "hidden";
Object.assign(listMain.style, {
opacity: "0",
pointerEvents: "none"
});
document.body.classList.add("matecho-article-animation__running");
requestAnimationFrame(() => {
Object.assign(listMain.style, {
opacity: "0",
pointerEvents: "none"
});
document.body.classList.add("matecho-article-animation__running");
Object.assign((parent as HTMLElement).style, {
height: "",
width: "",
left: "",
top: ""
requestAnimationFrame(() => {
Object.assign((parent as HTMLElement).style, {
height: "",
width: "",
left: "",
top: ""
});
});
});
document.addEventListener(
Expand Down

0 comments on commit abed0cc

Please sign in to comment.