create bug.tools

This commit is contained in:
4DBug
2026-02-28 21:33:31 -06:00
commit 91cee9a33a
63 changed files with 2019 additions and 0 deletions

21
js/counter.js Normal file
View File

@@ -0,0 +1,21 @@
(function () {
const COUNTER_DURATION = 2000;
fetch("https://counter.bug-dev-mail.workers.dev")
.then(r => r.text())
.then(count => {
const target = parseInt(count, 10);
const el = document.getElementById("counter");
const start = performance.now();
function tick(now) {
const t = Math.min((now - start) / COUNTER_DURATION, 1);
const eased = 1 - Math.pow(1 - t, 3);
const current = Math.round(eased * target);
el.textContent = String(current).padStart(7, '0');
if (t < 1) requestAnimationFrame(tick);
}
requestAnimationFrame(tick);
});
})();