Skip to content

No.205 · Backgrounds

Marbled Ink

Endpaper marbling in a fragment shader: drag the cursor and it combs through the ink, dragging the veins along its path before they slowly settle.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Endpaper

Write a full-screen fragment shader (raw WebGL, one big triangle) that domain-warps 4-octave value-noise fbm twice (q, r) and reads marble veins from sin(f*22 + r.x*7), mixing four palette colours: base by f, a second colour by r.x, and thin veins in a fourth, then modulating with a fine paper-tooth noise. Add combing: keep a ring of 16 pointer samples (position + velocity) as a vec4 uniform array; for each, subtract its velocity × gaussian falloff × 6 from the sample coordinates so ink is dragged along the pointer's path. Velocities decay ×0.985 per frame so the veins ease back. Render at 0.6× DPR (cap 2), pause offscreen, use a static frame under reduced motion. Selected variant — Endpaper (endpaper): Endpaper palette [#0f2a3a, #e8dcc0, #b3392b, #f5efe0]: deep navy and cream marbling with thin red veins, like a bookbinder's endpaper. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Drag the pointer (or a finger) across the ink to comb the veins; they slowly relax afterwards. Motion: Slow noise-time drift plus decaying pointer advection in the shader. Accessibility: Decorative canvas (aria-hidden). Reduced motion freezes time (combing still works on demand). No flashing content. Responsive behavior: Resizes with its container; renders at reduced resolution for performance. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Drag the pointer (or a finger) across the ink to comb the veins; they slowly relax afterwards.
Motion
Slow noise-time drift plus decaying pointer advection in the shader.
Accessibility
Decorative canvas (aria-hidden). Reduced motion freezes time (combing still works on demand). No flashing content.
Responsive
Resizes with its container; renders at reduced resolution for performance.