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.
This commit is contained in:
voussoir 2022-03-26 16:33:15 -07:00
parent 2c15686a66
commit 694d5a8bf8
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -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;
}
</style>
</head>
@ -1244,9 +1251,15 @@ function random_choice(list)
function reveal_sunglasses()
{
const sunglasses = document.getElementById("sunglasses");
function finish()
{
sunglasses.classList.remove("reveal_anim");
sunglasses.classList.add("revealed");
}
const sunglasses = document.getElementById("sunglasses");
sunglasses.classList.add("reveal_anim");
setTimeout(finish, 1000);
}
function start_eating_that_trashcan()
{