From 679655c199fd08f757f227c7e7f9767580aebd52 Mon Sep 17 00:00:00 2001 From: steve1337 <22643375+steve1337@users.noreply.github.com> Date: Wed, 28 Apr 2021 18:05:33 +0800 Subject: [PATCH] Added automatic message removal To prevent the DOM tree from getting to big messages are automatically removed after the fade out animation has finished --- ChatboxBot.html | 64 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 10 deletions(-) diff --git a/ChatboxBot.html b/ChatboxBot.html index a985a81..b212f26 100644 --- a/ChatboxBot.html +++ b/ChatboxBot.html @@ -31,6 +31,17 @@ color: white; } + /***************************************************** + * * + * Change this to make the animation faster or slower * + * * + ******************************************************/ + :root { + --fade-in-duration: .3s; + --fade-out-delay: 15s; + --fade-out-duration: .5s; + } + @keyframes fadeInRight { 0% { opacity: 0; @@ -54,12 +65,7 @@ } #chatlog>div { - /***************************************************** - * * - * Change this to make the animation faster or slower * - * * - ******************************************************/ - animation: fadeInRight .3s ease forwards, fadeOut 0.5s ease 15s forwards; + animation: fadeInRight var(--fade-in-duration) ease forwards, fadeOut var(--fade-out-duration) ease var(--fade-out-delay) forwards; } .colon { @@ -139,16 +145,14 @@
- -