1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-26 10:05:10 +00:00

add tutorial open and close animation

This commit is contained in:
zumbiepig
2024-09-05 14:32:58 -07:00
parent 44a08b90f6
commit 71a3a812d2
3 changed files with 42 additions and 9 deletions

View File

@@ -155,11 +155,17 @@ const navigate = {
const article = {
open: function (articleId: string) {
const modal = document.querySelector(`#article-${articleId}`) as HTMLElement | null;
if (modal) modal.style.display = 'flex';
if (modal) {
modal.style.animation = 'openArticle 0.5s ease-in-out';
modal.style.display = 'flex';
}
},
close: function () {
const modals = document.querySelectorAll(`.article`);
modals.forEach((modal) => ((modal as HTMLElement).style.display = 'none'));
close: function (articleId: string) {
const modal = document.querySelector(`#article-${articleId}`) as HTMLElement | null;
if (modal) {
modal.style.animation = 'closeArticle 0.5s ease-in-out';
modal.addEventListener('animationend', () => (modal.style.display = 'none'), { once: true });
}
},
};