๐ Live site: nitrocode.github.io/token-deathclock
Every AI prompt has a cost. This site makes it visceral. ๐ฅ
Watch the global AI token counter tick in real time, track environmental milestones as they fall, and discover what humanity could have done instead with those same resources.
Created by RB.
| Feature | Details |
|---|---|
| โฑ๏ธ Live counter | Estimated global AI tokens consumed since Jan 2020, ticking in real-time |
| ๐ Session counter | Tokens consumed globally since you opened the page |
| ๐ฟ Environmental milestones | 7 thresholds (trees โ bees โ water โ coral โ glaciers โ ocean โ extinction) with progress bars and consequence descriptions |
| ๐ Growth chart | Historical data + 18-month projection on a log scale (Chart.js) |
| ๐๏ธ Predictions table | Predicted calendar dates for each upcoming milestone |
| ๐ Doom achievements | Unlock badges as global consumption hits new levels |
| ๐ฎ Accelerate the Doom | A satirical mini-game โ click to burn tokens faster |
| ๐งฎ Personal footprint calculator | Estimate your own AI token footprint |
| ๐ Dark / Light mode | Toggle button; dark mode is the default |
# Clone the repo
git clone https://github.com/nitrocode/token-deathclock.git
cd token-deathclock
# Serve with any static server, e.g.:
npx serve .
# Then open http://localhost:3000No build step required โ it's a fully static site. ๐
npm install
npm test # runs Jest with coverage (interactive)
npm run test:ci # CI mode โ fails if coverage drops
npm run test:e2e # Playwright end-to-end testsUnit tests live in tests/death-clock.test.js and cover all pure functions in death-clock-core.js.
Unit-test coverage is tracked by Codecov. Every pull request receives an automated comment showing per-file coverage deltas; the PR check fails if coverage decreases.
| Unit test coverage | Coverage breakdown |
|---|---|
E2E tests run in CI via Playwright (Chromium). Their pass/fail status is shown by the E2E Tests badge above.
The site deploys automatically on every push to main via the deploy.yml workflow, pushing to the gh-pages branch.
๐ Live URL: https://nitrocode.github.io/token-deathclock/
Pull requests each get an isolated preview URL:
https://nitrocode.github.io/token-deathclock/previews/pr-{number}/
flowchart TD
subgraph Source["๐ Source Files (edit these)"]
core["death-clock-core.js\nโ๏ธ Pure functions\n(no DOM, fully testable)"]
srcjs["src/js/\n00-state โฆ 21-boot\n(feature modules)"]
styleSrc["styles/\nvariables, base,\nfeatures, etc."]
html["index.html\n๐ Static HTML shell"]
yaml["milestones.yaml\nproject-stats.yaml\nCHANGELOG.md"]
end
subgraph Generated["โ๏ธ Auto-Generated (do not edit)"]
scriptjs["script.js\n(built from src/js/)"]
stylescss["styles.css\n(built from styles/)"]
datajs["*-data.js\n(built from YAML / MD)"]
end
subgraph Tests["๐งช Tests"]
unit["tests/death-clock.test.js\nJest unit tests"]
e2e["tests/e2e/\nPlaywright E2E tests"]
end
subgraph CI["๐ค GitHub Actions"]
deploy["deploy.yml\nGH Pages deploy"]
unitCI["unit-tests.yml\nJest + Codecov"]
e2eCI["e2e-tests.yml\nPlaywright"]
preview["preview.yml\nPR preview deploy"]
release["release-please.yml\nSemVer + changelog"]
end
subgraph Live["๐ GitHub Pages"]
site["nitrocode.github.io\n/token-deathclock/"]
end
core -->|imported by| srcjs
srcjs -->|npm run build:js| scriptjs
styleSrc -->|npm run build:css| stylescss
yaml -->|npm run build:*| datajs
html --> Live
scriptjs --> Live
stylescss --> Live
datajs --> Live
core --> unit
html --> e2e
scriptjs --> e2e
unit --> unitCI
e2e --> e2eCI
Live -->|push to main| deploy
deploy --> site
| File | Role |
|---|---|
death-clock-core.js |
๐ง Pure calculation functions โ no DOM, fully unit-testable |
src/js/ |
๐ฅ๏ธ Feature modules compiled into script.js |
styles/ |
๐จ CSS source files compiled into styles.css |
index.html |
๐ Static HTML shell loaded by GitHub Pages |
milestones.yaml |
๐ Source of truth for environmental milestone data |
project-stats.yaml |
๐ฆ Tracks PR count + tokens consumed building this project |
โ ๏ธ Never editscript.js,styles.css, or*-data.jsdirectly โ they are auto-generated. Edit the source files and run the relevantnpm run build:*command.
| Metric | Source |
|---|---|
| Energy per token (~0.0003 kWh / 1K tokens) | Google/DeepMind inference benchmarks, MLPerf |
| COโ per kWh (0.4 kg) | IEA global average grid intensity 2024 |
| Water per token (~0.5 L / 1K tokens) | Microsoft sustainability report 2023 |
| COโ per tree (~21 kg/year) | US Forest Service estimates |
| Historical token growth | OpenAI usage blog, Epoch AI, AI Index 2024 |
๐ All figures are illustrative estimates intended to communicate scale, not precise measurements.