From 694d5a8bf8529d7a3720a6f5948051b4b8951319 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 26 Mar 2022 16:33:15 -0700 Subject: [PATCH] Remove sunglasses anim after it has completed. Previously, when switching fullscreen on and off, the sunglasses would reveal over and over, because the animation would trigger anew after the element was unhidden. Now the animation plays once and then it is set statically to those properties. --- voussoir.net/index.html | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/voussoir.net/index.html b/voussoir.net/index.html index 8259810..8ec6acd 100644 --- a/voussoir.net/index.html +++ b/voussoir.net/index.html @@ -364,7 +364,7 @@ body.start_eating_that_trashcan .cvitem_details position: fixed; right: 32px; } -#sunglasses.revealed +#sunglasses.reveal_anim { display: block; animation-name: sunglasses_reveal; @@ -373,6 +373,13 @@ body.start_eating_that_trashcan .cvitem_details animation-fill-mode: forwards; animation-iteration-count: 1; } +#sunglasses.revealed +{ + display: block; + transform: rotate(380deg); + right: 64px; + bottom: 64px; +} @@ -1244,8 +1251,14 @@ function random_choice(list) function reveal_sunglasses() { + function finish() + { + sunglasses.classList.remove("reveal_anim"); + sunglasses.classList.add("revealed"); + } const sunglasses = document.getElementById("sunglasses"); - sunglasses.classList.add("revealed"); + sunglasses.classList.add("reveal_anim"); + setTimeout(finish, 1000); } function start_eating_that_trashcan()