From 8289f2cb3c55def2c9f914a7d0b90e760a5b0491 Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Sun, 10 Oct 2021 10:51:14 -0400 Subject: [PATCH] Updated fade to use more generic rest time equasion --- fade.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fade.html b/fade.html index 44345d9..a759d35 100644 --- a/fade.html +++ b/fade.html @@ -8,8 +8,10 @@ let fadeDiv = document.createElement("div"); fadeDiv.id = "fadeDiv"; document.getElementsByTagName("body")[0].prepend(fadeDiv); - let duration = 2 * 1000; - let restTime = duration / 1000; + let duration = 2 * 1000; //Duration = ms + let restTime = duration / 100; //restTime = ms/increment + //TODO: Account for time it takes loop to execute + //?Could possible use timer class or something of that nature to compute remaining time for(let alpha = 0.01;alpha <= 1;alpha += 0.01){ let fadeString = "rgba(0, 0, 0, " + alpha + ")"; console.log("fading = " + fadeString);