From 010612de350481c8b7e0d6a62c55281cd9009727 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Thu, 7 Sep 2023 20:30:06 -0700 Subject: [PATCH] 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. --- index.html | 1 + 1 file changed, 1 insertion(+) 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]; -- 2.47.3