Build a single-file interactive WebGPU page called "Plush Hammerhead".
Page: an editorial layout with a big two-line title "Plush / Hammerhead.", a warm studio-grey background, a control panel on the right, live readouts and collapsible technical notes. English UI.
The toy: a plush hammerhead shark. It has a wide, flat hammer-shaped head (cephalofoil) whose ends sweep back a little, with a shallow notch at the middle of the front edge. A glass eye sits on each tip of the hammer, looking out sideways. It has a tall sickle-shaped dorsal fin, two pectoral fins and a tail with a long upper lobe and a small lower one. A cream belly panel is sewn on below a seam along each flank, with embroidered gill lines. A smiling mouth is cut in under the hammer, lined with felt and set with soft white felt teeth; its lower jaw swings open on a hinge.
Simulation:
- Body, hammer and fins are one signed distance field filled with a soft-body XPBD lattice: shape-matched hexahedral cells and tetrahedral volume preservation. It is skinned to a high-res surface-nets mesh.
- It swims with a travelling S-wave that bends the cells' rest shapes side to side, more toward the tail, and steers by turning its head, the body curving into each turn.
- Fur is drawn as alpha-to-coverage shells over minky pile. The pile lags behind each jiggle on a spring and can be combed.
Behaviour:
- It circles its space.
- Scan: it sweeps its hammer side to side over the floor the way real hammerheads hunt. It also does this on its own now and then, and a little while hunting.
- Feed drops in a felt fish: it turns, closes in faster, opens wide and snaps it up.
- Dash is a burst of fast tail beats; Chomp opens the mouth and snaps it shut.
- Grab it by the tail and it thrashes; let go and it shoots off.
- Boop the middle of the hammer with the finger and it wriggles and blushes.
Tools: Hand, Finger, Comb.
Controls:
- Buttons: Feed, Dash, Scan, Chomp, Smooth fur, Reset, Pause.
- Toggles: Circle, quarter speed, Mesh.
- Sliders: Stuffing, Pile, Tail beat.
- Three fabrics: Bronze, Lagoon, Sunset.
- Readouts: mass, volume, beats per minute, fish eaten.
- Phone layout with a stacked panel.