Deno HTTP + WebSocket server serving three pages: - / desktop with YOU DIED overlay and keyboard controls - /mobile touch-optimized control page - /obs transparent browser source for OBS Count persisted to counter.json, synced in real time across all connected clients. Compiles to a self-contained Windows .exe via deno compile.
1.2 KiB
1.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Overview
A single-file, zero-dependency Elden Ring death counter (Elden Ring Counter.html). Open directly in any browser — no build step, no server needed.
Architecture
Everything lives in one HTML file with three sections:
- CSS (lines 8–339): Elden Ring-themed dark UI using CSS custom properties (
--gold,--bg0, etc.). The "YOU DIED" overlay is CSS-animation-driven via the.showclass. - HTML (lines 342–376): Static markup.
#romanand#arabicare the display targets;#overlayholds the death animation. - JS (lines 378–468): Vanilla JS.
deathsis the single state variable, persisted tolocalStorageunder keyelden_deathcounter_value.render()syncs state → DOM → storage.add(delta)is the only way to mutate count; it triggers the overlay on increment.
Key constraints
- Roman numeral display is capped at 3999 (
clamp(0, 3999)); 0 displays as—. - The overlay animation restarts cleanly via a forced reflow (
void overlay.offsetWidth) before re-adding.show. - UI language is German (
lang="de"); string literals like"Tode:"and"Gespeichert lokal ✓"are in German.