From c9324ee0b06d8929587e337d9035b875d12a0b32 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Sat, 25 Apr 2026 19:33:14 -0400 Subject: [PATCH] Fix catalog-price-check.js served from wrong wwwroot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit File was written to repo-root wwwroot/ instead of src/PowderCoating.Web/wwwroot/ — causing a 404 and MIME type refusal. Moved to the correct location. Co-Authored-By: Claude Sonnet 4.6 --- .../wwwroot}/js/catalog-price-check.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {wwwroot => src/PowderCoating.Web/wwwroot}/js/catalog-price-check.js (91%) diff --git a/wwwroot/js/catalog-price-check.js b/src/PowderCoating.Web/wwwroot/js/catalog-price-check.js similarity index 91% rename from wwwroot/js/catalog-price-check.js rename to src/PowderCoating.Web/wwwroot/js/catalog-price-check.js index de62a8b..af9bcb9 100644 --- a/wwwroot/js/catalog-price-check.js +++ b/src/PowderCoating.Web/wwwroot/js/catalog-price-check.js @@ -53,7 +53,7 @@ // Animate progress: fast to ~85%, then slow crawl toward 99%. // Uses two easing phases so it never "finishes" before the server responds. var start = Date.now(); - var phase1End = totalSecs * 0.80 * 1000; // 80% of time → 85% progress + var phase1End = totalSecs * 0.80 * 1000; // 80% of time -> 85% progress var raf; function tick() { @@ -61,11 +61,11 @@ var pct; if (elapsed < phase1End) { - // Phase 1: ease-out from 0 → 85 + // Phase 1: ease-out from 0 -> 85 var t = elapsed / phase1End; pct = 85 * (1 - Math.pow(1 - t, 2)); } else { - // Phase 2: slow crawl 85 → 99 (never quite reaches 99) + // Phase 2: slow crawl 85 -> 99 (never quite reaches 99) var t2 = (elapsed - phase1End) / (totalSecs * 1000); pct = 85 + 14 * (1 - Math.exp(-t2 * 1.5)); } @@ -76,8 +76,8 @@ raf = requestAnimationFrame(tick); - // Safety: if the server takes much longer than estimated, keep the overlay up. - // The page navigation itself will tear it down. + // The page navigation itself tears down the overlay; cancel the RAF to avoid + // running after the page is gone. window.addEventListener('pagehide', function () { cancelAnimationFrame(raf); });