Skip to main content
RETURN TO SELECTED WORK
CASE STUDY // 01Interactive Canvas & Physics

Kinesis Engine

Real-time gravitational force fields, interactive wells, and browser-native particle motion.

An interactive HTML5 Canvas physics sandbox running multi-body attraction/repulsion vectors, user-placed gravity wells, configurable fluid damping, and viewport-aware rendering pause logic.

ROLE
Full-Stack & Canvas Builder
TIMELINE
2025 — Present
SCOPE
Interactive Web Demo
ACCENT
#b5341c
Interactive Browser DemoCLIENT SANDBOX
DAMPING:
240 PARTICLES
HOVER TO GUIDE • CLICK TO SPAWN GRAVITY WELL (MAX 4)
CONFIGURATION & SCOPE

Demo Parameters & Baseline

240
Active Demo Bodies
4 FIFO
Max Gravity Wells
0.90–0.99
Damping Range
Interactive
Render Mode
QUALITY & VERIFICATION

Invariants & Edge Cases Checked

playwright test tests/showcase-kinesis.spec.ts
Interactive in-browser canvas demo. Frame timing depends on client display refresh rate and hardware.

System Invariants

Distance denominator clamped (>= 15px / 20px) so overlapping particles never produce NaN or Infinity vectors.
Well array bounded to 4 items to prevent unbounded per-frame complexity growth.
Viewport visibility check suspends requestAnimationFrame offscreen to conserve battery.

Edge Cases Covered

Pointer exit resets cursor attractor back to canvas centre without leaving stale coordinates.
Rapid pause/resume toggles clean up previous animation frame IDs without duplicate loops.
Canvas resize re-measures parent bounds cleanly across mobile and desktop breakpoints.
THE CHALLENGE

Problem Statement

Naive browser particle demos frequently blow up numerically when particles approach zero distance from an attractor, leak animation loops on resize/unmount, or drain mobile batteries offscreen.

THE ARCHITECTURE

Design Solution

Implemented bounded gravity-well queues, minimum-radius force clamping, modular boundary wrapping, and IntersectionObserver lifecycle hooks inside a clean React canvas component.

ENGINEERING TRADEOFFS

Critical Technical Decisions

DECISION 01

Minimum-Radius Distance Clamping

Clamping effective distance to >= 15px prevents inverse-distance singularities and runaway particle ejection.

DECISION 02

Offscreen Loop Suspension via IntersectionObserver

Suspending requestAnimationFrame outside the viewport keeps idle CPU and mobile battery overhead low.

DECISION 03

Bounded Gravity Well Queue

Evicting the oldest attractor above 4 wells guarantees predictable O(N) per-frame cost during rapid user clicks.

IMPLEMENTATION DETAILS

Capabilities & Behaviour

Cursor-guided attraction and repulsion vector fields with real-time damping sliders.

Click-to-place gravity wells capped cleanly at 4 active attractors via FIFO eviction.

Minimum-distance clamping (20px / 15px guards) to prevent division-by-zero velocity spikes.

IntersectionObserver loop gating to halt animation frames when scrolled offscreen.

Zero external physics runtime dependencies—pure TypeScript vector integration.

IMPLEMENTED TECHNOLOGIES

Technology Stack

TypeScriptHTML5 Canvas2D Vector MathsIntersectionObserverReact

Explore Source Code & QA Playbook

Inspect repositories on GitHub or review my QA automation and test design approach.