Case study · 08 / 12
Jerrie Bones
One-page site for a painter and illustrator
- Year
- 2026
- Focus
- WebGL
- Status
- Live
A one-page portfolio for a painter, illustrator and draughtsman, where the hero photograph turns into a pencil drawing under your hand. The effect is a shader I wrote in raw WebGL, with no 3D library.
An artist's site should show the hand at work. The idea came quickly: the artist stands in front of his own name, and when you reach for him, the photograph becomes a drawing. Making it feel drawn was the work. The sweep has a ragged, charcoal edge with a line of gold running through it. The pencil lines shiver slightly, the way hand-drawn animation does. And it only answers when the pointer is on the figure itself, not on the empty box round him. I wrote the shader by hand in GLSL and kept the renderer outside React, so the site ships no 3D library at all. The palette is cream, charcoal and gold, the edges are torn paper, and the gallery pictures ripple like wet ink when you touch them.
What it does
- 01Turns the hero photograph into a pencil drawing, and back, with a sweep you control
- 02Answers the pointer only on the figure's silhouette
- 03Opens with a pencil line that draws itself while the page loads
- 04Ripples gallery pictures like wet ink on hover
- 05Switches quote and artwork together when you choose a collector
- 06Changes from a wide stage to a tall masthead according to the shape of the screen
How it was solved
- 01Wrote the sweep as a fragment shader: layered noise gives the front its ragged edge, with a charcoal fringe and a golden core
- 02Re-jittered the drawing six times a second, so the lines boil like a hand-drawn film
- 03Used raw WebGL with one quad and two textures in place of a 3D library, and asked the browser for the low-power graphics chip
- 04Read the cut-out's transparency into a small mask, so hover is tested against the figure and not its rectangle
- 05Made the sweep reversible mid-way, taking time in proportion to how far it had gone
- 06Gave each kind of input its own path: hover on a mouse, an automatic cycle on touch, a labelled button on a keyboard, an instant swap for reduced motion
- 07Fell back to a CSS wipe when WebGL is missing or the graphics context is lost, with the photograph always underneath for the first paint
- 08Paused the render loop off screen and in hidden tabs
- 09Seeded the torn edges, so the server and the browser tear the paper in the same place
52 unit tests with coverage held above 80%, and 30 end-to-end runs across desktop and phone. No sideways scroll at any width from 360 to 1920 pixels.
Stack
- Languages
- TypeScript (strict)GLSLCSSHTML
- Front-end
- Next.js 16 (App Router)React 19Turbopack
- Graphics
- WebGL 1Custom fragment shadersSVG filters (feTurbulence, feDisplacementMap)
- Motion
- React SpringLenis
- Styling
- Tailwind CSS v4Design tokensnext/font (Anton, Onest, Instrument Serif)
- Testing
- VitestV8 coveragePlaywright
- Asset pipeline
- rembgPillowsharpAVIF and WebP
- Tools
- ESLintGitGitHub
- #webgl
- #glsl
- #nextjs
- #typescript
- #shaders
- #portfolio
The case study is the how. The site is the proof.