From c146fc70c18842dad681b1737c169f4c2243c7f3 Mon Sep 17 00:00:00 2001 From: zumbiepig <121742281+zumbiepig@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:16:42 -0700 Subject: [PATCH] combine article animations into one --- public/resources/styles/themes/default.css | 16 +--------------- src/resources/scripts/main.ts | 4 ++-- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/public/resources/styles/themes/default.css b/public/resources/styles/themes/default.css index 1be39b8..3ae2747 100644 --- a/public/resources/styles/themes/default.css +++ b/public/resources/styles/themes/default.css @@ -803,7 +803,7 @@ body { } } -@keyframes article-open { +@keyframes article { 0% { opacity: 0; scale: 0; @@ -816,17 +816,3 @@ body { scale: 1; } } - -@keyframes article-close { - 0% { - opacity: 1; - scale: 1; - } - 20% { - scale: 1.1; - } - 100% { - opacity: 0; - scale: 0; - } -} \ No newline at end of file diff --git a/src/resources/scripts/main.ts b/src/resources/scripts/main.ts index 7b4526c..a6b931a 100644 --- a/src/resources/scripts/main.ts +++ b/src/resources/scripts/main.ts @@ -159,7 +159,7 @@ const article = { const modalContent = document.querySelector(`#article-${articleId} .article-content`) as HTMLElement | null; if (modal && modalContent) { articleAnimationLock = true; - modal.style.animation = 'article-open 0.5s ease-in-out'; + modal.style.animation = 'article 0.5s ease-in-out normal'; modal.style.display = 'flex'; modalContent.scroll({ top: 0, left: 0, behavior: 'instant' }); modal.addEventListener( @@ -183,7 +183,7 @@ const article = { articleAnimationLock = true; const modal = document.querySelector(`#article-${articleId}`) as HTMLElement | null; if (modal) { - modal.style.animation = 'article-close 0.5s ease-in-out'; + modal.style.animation = 'article 0.5s ease-in-out reverse'; modal.addEventListener( 'animationend', () => {