From: Ardis Lu Date: Fri, 8 Sep 2023 03:30:06 +0000 (-0700) Subject: Set final frame when RAF step exceeds final frame X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=010612de350481c8b7e0d6a62c55281cd9009727;p=ard.is Set final frame when RAF step exceeds final frame RAF will pause if the tab is inactive, so this is needed to set the final frame if the user tabs away through the end of the animation. --- diff --git a/index.html b/index.html index 4c32624..06cb260 100644 --- a/index.html +++ b/index.html @@ -114,6 +114,7 @@ } const currentFrame = Math.floor((timestamp - start) / msPerFrame); if (currentFrame >= frames.length) { + asciiContainer.textContent = ascii; return; } asciiContainer.textContent = frames[currentFrame];