From 0ba3bf34f89d9d17b4a05ee5efdc6601a4a5d3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Thu, 5 Oct 2023 14:08:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4css,=20=E7=94=B1js=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/weigets.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/public/weigets.js b/public/weigets.js index a2fed08..c7e05d7 100644 --- a/public/weigets.js +++ b/public/weigets.js @@ -55,8 +55,6 @@ export function Dialog(options) { backdrop-filter: blur(5px); duration: 0.5s; transition: all 0.5s; - opacity: 0; - animation: fadeIn 0.75s forwards; ` content.classList.add('dialog') content.style.cssText = ` @@ -90,6 +88,7 @@ export function Dialog(options) { for (const mutation of mutationsList) { if (mutation.type === 'childList' && mutation.addedNodes.length > 0) { element.focus() + element.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 100 }).finished return } } @@ -99,18 +98,3 @@ export function Dialog(options) { element.onremove = () => observer.disconnect() return element } - -const fadeIn = ` - @keyframes fadeIn { - from { - opacity: 0; - } - to { - opacity: 1; - } - } -` -// Add the CSS3 animation to the document's head -const style = document.createElement('style') -style.innerHTML = fadeIn -document.head.appendChild(style) \ No newline at end of file