Mirror API is a behavioral feedback system that surfaces subtle reflections based on how users move through a page. It tracks scroll tempo, hover linger, and input hesitation, then displays ambient signals through floating overlay bubbles. The system is modular, privacy-conscious, and designed to read behavior without analytics.
- Lightweight scroll tracking using delta thresholds
- Hover detection with debounce logic to capture intent
- Input hesitation recognition tied to focus and typing delay
- Ghost View mode for tone-shifting visual feedback
- Semantic CSS token support for thematic styling
- Modular scripts and clean separation of logic
mirror-api/ ├── index.html ├── style.css ├── tokens.css ├── logic.js ├── state.js ├── overlays.js ├── canvas.js
- JavaScript (vanilla)
- Semantic CSS
- Local DOM event listeners
- Computed styles and tokens
- No external dependencies
logic.js: Tracks scroll velocity, hover duration, and input pausestate.js: Handles mode state (Ghost View toggle, reflection timing)overlays.js: Renders floating feedback bubbles tied to eventscanvas.js: Optional heatmap layer for interpreting movement densitytokens.css: Centralized semantic values for theming behaviors
Clone the repo and serve locally:
git clone https://github.com/mwh-max/mirrorapi.git
cd mirrorapi
python3 -m http.server