Weave
Move your cursor. Tie a knot. Build the web.
Created on 19th July 2026
•
Weave
Move your cursor. Tie a knot. Build the web.
The problem Weave solves
The problem it solves
Interactive web experiences that use physics-like motion, generative art, or canvas animation usually require pulling in a library (Three.js, GSAP, p5.js) just to get smooth, natural-feeling movement. That adds load time, dependency overhead, and a learning curve for anyone who wants to study or reuse the technique.
Weave solves this by proving the same effect is achievable with zero libraries — just native Canvas 2D, Pointer Events, and requestAnimationFrame.
What people can use it for:
- As a live coding reference — developers can open the single HTML file, read the vanilla JS, and see exactly how spring-chain motion, speed-based color, and proximity detection are done without a framework.
- As a drop-in ambient screensaver or idle-state animation — the auto-weave behavior when left untouched makes it usable as-is on a kiosk display, a loading screen, or a break-room monitor.
- As a fidget/focus tool — a low-stakes, screen-based way to occupy your hands for a minute, similar to a digital stress toy.
- As a teaching example for accessibility-in-motion — it supports keyboard-only control (arrow keys) and respects
prefers-reduced-motion, so it doubles as a reference for building animated interfaces that don't exclude anyone.
How it makes things easier/safer:
- Easier: No install, no build step, no dependency to configure — copy one HTML file and it runs.
- Safer (accessibility): Reduced-motion users get a calmer version automatically; keyboard-only users aren't locked out of the interaction.
- Safer (performance): Zero external scripts means no third-party code running on the page, no supply-chain risk from an npm package, and a minimal attack surface.
Challenges I ran into
Getting natural-feeling motion without a physics library
The thread needed to feel like real fiber under tension — a little lag, a little whip — but I wasn't using a physics engine. I solved this with a simple spring-chain: each point in the thread eases toward the point ahead of it at a slightly different rate, which produces a convincing "trailing rope" effect from just a few lines of math instead of a full physics simulation.
Touch and scrolling fighting each other on mobile
The canvas needs to capture the full drag gesture to draw the thread, but that conflicts with a user trying to scroll the page with a swipe — the browser doesn't know which one you meant. I fixed this by making the "Scroll" indicator an actual tappable link to the next section, so mobile users have a guaranteed way to move past the hero without needing a native scroll gesture to work through the canvas.
Knot detection without killing performance
Detecting when the current thread crosses an old part of itself meant checking distance against a growing history of past points — which gets expensive fast if it's naively checked every frame. I capped the history length, skip the most recent points (so the thread doesn't "detect" itself right next to where it currently is), and only check on a short cooldown after each knot, keeping the frame rate smooth even after a long session of weaving.
Keeping it accessible without a second version of the app
Since the whole interaction is mouse/touch driven, keyboard users and reduced-motion users could easily have been left out. Rather than building a separate fallback experience, I added arrow-key controls that drive the same thread logic as the pointer, and a prefers-reduced-motion check that calms the animation and disables the idle auto-weave — so it's one codebase that adapts, not two.
Technologies used
