Virtual Fidget toys
  • TypeScript 79.9%
  • GLSL 11.2%
  • Svelte 6.3%
  • JavaScript 2.1%
  • HTML 0.4%
  • Other 0.1%
Find a file
2026-06-03 07:41:35 +10:00
e2e feat: anti-aliasing 2026-05-29 07:04:41 +10:00
src refactor(fluid): clean up code 2026-06-03 07:41:35 +10:00
static Initial 2026-05-25 08:07:16 +10:00
.gitignore chore: update gitignore, wrangler types, and pnpm workspace 2026-05-28 09:48:20 +10:00
.npmrc Initial 2026-05-25 08:07:16 +10:00
.prettierignore Initial 2026-05-25 08:07:16 +10:00
.prettierrc Initial 2026-05-25 08:07:16 +10:00
CLAUDE.md fix: touch on spacelines 2026-05-28 19:23:17 +10:00
eslint.config.js Initial 2026-05-25 08:07:16 +10:00
package.json fix: remove type check 2026-06-02 14:47:59 +10:00
playwright.config.ts test: add e2e testing with playwright 2026-05-28 09:48:10 +10:00
pnpm-lock.yaml fix: updates and upgrades 2026-06-02 14:44:27 +10:00
README.md fix: touch on spacelines 2026-05-28 19:23:17 +10:00
svelte.config.js Initial 2026-05-25 08:07:16 +10:00
tsconfig.json Initial 2026-05-25 08:07:16 +10:00
vite.config.ts test: add unit testing with vitest 2026-05-28 09:47:57 +10:00
worker-configuration.d.ts fix: updates and upgrades 2026-06-02 14:44:27 +10:00
wrangler.jsonc Initial 2026-05-25 08:07:16 +10:00

Fidgets

Interactive visual fidgets built with SvelteKit and WebGL, deployed to Cloudflare Workers.

Spacelines

A WebGL particle system with connected lines, gaussian bloom, and an interactive dot grid that responds to mouse and touch input.

  • Particles drift with flow-field physics and connect when nearby
  • Dot grid reacts to cursor with repulsion displacement
  • Two-pass bloom: horizontal blur → vertical blur + composite + vignette
  • Theme-aware colors via CSS custom properties (--tint-color)
  • Touch support for mobile

Tech Stack

Layer Technology
Framework SvelteKit 2 + Svelte 5
Rendering WebGL with GLSL shaders
Styling TailwindCSS 4 + DaisyUI 5
Deploy Cloudflare Workers
Unit Tests Vitest + jsdom
E2E Tests Playwright (Chromium)

Getting Started

pnpm install
pnpm dev

Note: Use pnpm — npm will fail with peer dependency conflicts.

Scripts

Command Description
pnpm dev Start dev server
pnpm build Type-check + production build
pnpm preview Preview production build via Wrangler
pnpm check TypeScript type-check
pnpm test Run unit tests
pnpm test:e2e Run end-to-end tests
pnpm gen Regenerate Cloudflare worker types

Project Structure

src/lib/spacelines/
├── main.ts          # Entry point, animation loop, particle physics
├── color.ts         # OKLCH→RGB conversion, CSS variable reader
├── webgl.ts         # Shader compilation, buffer binding helpers
└── shaders/
    ├── scene.vert   # Particle vertex shader
    ├── scene.frag   # Particle fragment shader
    ├── grid.vert    # Dot grid with mouse repulsion
    ├── grid.frag    # Grid fragment shader
    ├── post.vert    # Fullscreen quad
    ├── blur-h.frag  # Horizontal gaussian blur
    └── post.frag    # Vertical blur + bloom + vignette

License

Private