From 82a120ef5d3266fb434abc2a5c9490e65d4e1a59 Mon Sep 17 00:00:00 2001 From: xoy Date: Mon, 4 Dec 2023 21:58:53 +0100 Subject: [PATCH] [Adding better animation timing] --- script.js | 1 + style.css | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/script.js b/script.js index 66be793..3d10b12 100644 --- a/script.js +++ b/script.js @@ -5,6 +5,7 @@ const label = "XOY"; const display = document.getElementsByClassName("display")[0]; function iterate_characters() { + display.style.transform = (display.style.transform == "scale(2)") ? "scale(1)" : "scale(2)"; display.innerHTML = label.charAt(index); index = (index == label.length - 1) ? 0 : index + 1; } diff --git a/style.css b/style.css index a0ea9f2..77a1d47 100644 --- a/style.css +++ b/style.css @@ -3,12 +3,6 @@ src: url(Novem.ttf); } -@keyframes loading { - from {transform: scale(1);} - 50% {transform: scale(2);} - to {transform: scale(1);} -} - html, body { width: 100vw; height: 100vh; @@ -27,5 +21,6 @@ div.display { margin: auto; text-align: center; font-size: 100px; - animation: loading 2s infinite; + transform: scale(1); + transition: transform 500ms; } \ No newline at end of file