interface.js, style.css: make transitions less intensive

This commit is contained in:
dogeystamp 2023-01-31 14:29:00 -05:00
parent 80082a5b7a
commit 949a0a0951
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 15 additions and 24 deletions

View File

@ -58,10 +58,20 @@ class InterfaceElement {
return this.#hidden;
}
set hidden(x) {
if (this.#hidden === x) return;
this.#hidden = x;
for (const node of this.rootNodes) {
node.hidden = this.hidden;
if (this.hidden) {
node.classList.add("visualhidden");
node.classList.add("hidden");
} else {
node.classList.remove("hidden");
setTimeout(function() {
node.classList.remove("visualhidden");
}, 20);
}
}
if (this.hidden === true) this.clearAlerts();

View File

@ -4,11 +4,7 @@ body {
padding: 0 10px;
color: #444444;
background: #eeeeee;
animation: fadeIn 0.5s;
}
@keyframes fadeIn {
0% {opacity: 0;}
100% {opacity: 1;}
transition: all 0.5s;
}
body, button {
@ -160,24 +156,9 @@ button:active {
}
}
[hidden] {
animation: fadeOut 0.2s, disappear 0.3s;
.visualhidden {
opacity: 0;
visibility: hidden;
max-height: 0 !important;
margin: 0 !important;
padding: 0 !important;
}
@keyframes fadeOut {
0% {opacity: 1; visibility: visible;}
100% {opacity: 0; visibility: hidden;}
}
@keyframes disappear {
0% {
max-height: 100em;
}
100% {
max-height: 0;
margin: 0;
}
.hidden {
display: none;
}