field-ui · a reciprocal DOM-physics field

Elements have mass.

This isn’t a layout on top of an effect. The words, links, and cards are physical bodies inside a single field — they carry weight, exert force, and the field pushes back. Here’s exactly how it works, with the real engine running behind every example.

Every part exerts force on the others — and the whole only works when you can feel them.

Substrate  one canvas, conserved Forces  34, composable · gated by conditions Law  nothing created from nothing
I

Substrate

What the field is made of — and how it locks to the page.

01 — Synchronization

The page and the field share one coordinate space.

A registry samples every body’s getBoundingClientRect() each animation frame and maps it onto the canvas — scaled by device pixel ratio.

Because it re-reads every frame, the invisible force fields stay locked to the visible boxes through scroll, resize, and reflow.

canvasₓ = rect.left + rect.width / 2 · DPR
02 — Mass & damping

Particles are point-masses in a medium.

Each particle carries a velocity and a mass proportional to its size. Every frame its velocity is multiplied by a friction factor — momentum bleeds off instead of accumulating.

vₜ₊₁ = v · f (f ≈ 0.95) · m ∝ size

Damping is why the field settles into calm swarms rather than scattering.

03 — Currents

The waves are a flow field.

Near a wave line, particles pick up a drag vector along the slope of the curve — the derivative of the sine — so they drift like debris carried down a river.

slope(x) = cos(x · freq + φ) · freq · amp · vₓ += slope · influence

It’s why the resting field feels alive without any input.

II

Forces

What a single body can do to the matter around it.

04 — Attraction

A body can pull the field into orbit.

An attractor defines a gravity well. The pull grows as distance falls, and a tangential component bends incoming particles into stable spirals.

F = (1 − d / dmax)² · S

Drag the attractor — the force is bound to the element, not the cursor.

attractor — drag me attractor force follows the element across the field
05 — Repulsion

A body can push the field away.

A repeller is an inverted well — the force points outward, carving a clean void the rest of the field flows around.

F = −(1 − d / dmax)² · S

Drag the repeller and watch a clearing open around it.

repeller — drag me repel force points outward — a void opens in the field
06 — Reflection

A body can be a wall.

A wall is an axis-aligned box. A crossing particle has its perpendicular velocity reversed and scaled by elasticity, then is projected back out — a hard hit throws a spark.

vertical edge: vₓ ← −Cᵣ · vₓ

Drag the wall into the drifting particles to deflect them.

wall — drag me
wall
particles bounce off the bounding box
07 — Swirl

A body can spin the field.

A swirl applies a dominantly tangential force — a swirl, not a drain. The inward pull is light (the swirl dominates it roughly eightfold), so matter wheels around the body instead of falling in. A tight inward spiral is a preset (whirlpool), never the canonical verb.

v += (−d̂_y, d̂_x) · S · spin + · S · 0.12

Drag the swirl into the swarm — particles orbit rather than fall in.

swirl — drag me swirl tangential force — the field circles, never collapses
08 — Stream

A body can blow a current.

A stream emits a constant force along a heading — a fan, a jet, a prevailing wind. The swarm combs into parallel flow.

v += (cos θ, sin θ) · S · (1 − d/dmax)

Drag the jet and watch matter streak into lanes downwind.

stream — drag me stream directional current — particles comb downwind
09 — Tether

A body can tether the field at a fixed distance.

A tether has a rest length. Matter that crowds in is pushed out; matter that strays is reeled in — the swarm settles into an orbiting shell.

v += û · (drest) · k

Drag the tether — matter springs back to its radius.

tether — drag me tether a tether — matter holds a shell at the rest radius
10 — Viscosity

A body can thicken the medium.

A viscosity body neither pulls nor pushes — it bleeds momentum, as if the field turned to honey. Paired with an attractor it turns a slingshot into a settled orbit.

vv · (1 − k), k ∝ (1 − d/d_max)·S

Agitate, then watch the rush die inside the zone.

viscosity — move me viscosity a viscous zone — momentum bleeds off, the swarm settles
11 — Accretion & release

A body can hold matter — and give it back.

An sink captures particles at its core. They aren’t deleted — they’re held inside, and the element inflates as it fills. When it saturates it goes supernova: the exact particles are released radially.

scale = 1 + (accreted / capacity) · 0.45 · captured = released

Nothing is conjured from thin air, and nothing vanishes. Matter changes hands.

sink — fills, then pops
core
matter accumulates, then releases on supernova
12 — Emission

A body can be a fountain.

An jet draws surrounding matter into its nozzle and relaunches it as a hot jet — the field is recycled into a stream, nothing conjured.

feed: v += d̂ · S · at nozzle: v = (cos θ, sin θ) · spd

Agitate to feed it, then watch the jet stream off along its heading.

jet — move me · jets → jet a fountain — matter is drawn in and jetted back out
III

Natural primitives

Real field laws — true 1/d², Lorentz, Langevin, diffusion, waves.

13 — Gravity

A heavy headline with a true 1/d² pull — a real well.

True softened inverse-square — a real 1/d² law.

F = G·M·d̂ / (d² + ε²), ε = r_s = 2GM/c²; |v| ≤ c
gravity — drag me gravity true softened inverse-square — a real 1/d² law
14 — Charge

Two states that demix charged matter into +/− domains.

The signed sibling of gravity — like repels, opposite attracts.

F = −σ·q·GM·d̂ / (d² + ε²)
charge — drag me charge the signed sibling of gravity — like repels, opposite attracts
15 — Magnetism

A region that curves moving charge into cyclotron arcs.

The Lorentz force — curves a moving charge, doing no work.

v ← rotate(v, θ), θ = q·spin·B·(1 − d/r)
magnetism — drag me magnetism the Lorentz force — curves a moving charge, doing no work
16 — Thermal

A "hot" badge that agitates the field with Brownian heat.

Langevin/Brownian agitation — a real temperature in the medium.

v += √(2T) · ξ, T = S·(1 − d/r), ξ ~ N(0,1) per axis
thermal — drag me thermal Langevin/Brownian agitation — a real temperature in the medium
17 — Collide

A dense cluster where particles ricochet like billiards.

Elastic pairwise collision — the hard-sphere billiard force.

overlapping, approaching discs exchange normal momentum (e = S)
collide — drag me collide elastic pairwise collision — the hard-sphere billiard force
18 — Diffuse

A trail particles lay down and follow — stigmergy.

A pheromone field — deposit a mark and follow the diffused gradient.

deposit φ; v += ∇φ · S; field blurs ∂φ/∂t = D∇²φ
diffuse — drag me diffuse a pheromone field — deposit a mark and follow the diffused gradient
19 — Propagate

A button that fires a real shock wave across the field.

A travelling wave — particles ride the expanding front.

pulse φ at the source; v += r̂·|∇φ|·S (ride the front out); ∂²φ/∂t² = c²∇²φ
propagate — drag me propagate a travelling wave — particles ride the expanding front
20 — Memory

A frequently-used path that wears in and starts pulling harder.

The field remembers — occupancy wears in paths that pull harder.

M(x) += λ where matter sits; v += û · (1 − d/r)² · S · 0.5 · (1 + μ·M)
memory — drag me memory the field remembers — occupancy wears in paths that pull harder
IV

Designed-extended

Further designed forces, and the modifiers that wrap a sibling.

21 — Lens

A link that bends a passing flow into caustics — no capture.

Rotates velocity, preserving speed — bends paths without adding energy.

v ← rotate(v, θ_max · (1 − d/r) · sign)
lens — drag me lens rotates velocity, preserving speed — bends paths without adding energy
22 — Gate

A one-way membrane: matter passes through but not back.

A one-way membrane — passes along its heading, reflects the reverse.

if v·n < 0: v −= 2(v·n)·n
gate — drag me gate a one-way membrane — passes along its heading, reflects the reverse
23 — Buoyancy

A feed where light/hot items rise and dense ones settle.

A constant lift/sink by density — light matter rises, dense settles.

v_y −= (ρ_med − ρ_p)·g, ρ_p = base / (size·(1 + heat))
buoyancy — drag me buoyancy a constant lift/sink by density — light matter rises, dense settles
24 — Shear

A divider with laminar flow — layers slide past each other.

A laminar velocity gradient — flow grows with perpendicular offset.

v∥ += S · (offset⊥ / r) · (1 − d/r)
shear — drag me shear a laminar velocity gradient — flow grows with perpendicular offset
25 — Crystallize

A "cool" section where matter snaps onto a lattice.

Snaps cool matter onto a lattice; melts and frees it when hot.

if heat < ½: v += (node − p)·k; v *= 0.9
crystallize — drag me crystallize snaps cool matter onto a lattice; melts and frees it when hot
26 — Align

A nav where particles flock to a shared heading.

Steers toward a heading, preserving speed — flock alignment.

v += (ĥ·|v| − v)·k, ĥ = neighbour-mean heading (or the body heading)
align — drag me align steers toward a heading, preserving speed — flock alignment
27 — Wind

A hero with divergence-free turbulence drifting through it.

Divergence-free curl-noise turbulence.

v += curl(ψ)·S, ψ = sin(x·s + 0.2t)·cos(y·s − 0.2t)
wind — drag me wind divergence-free curl-noise turbulence
28 — Cohesion

A tag group that behaves like a droplet — a swarm with a skin.

Short-range pressure + mid-range pull — surface tension.

neighbours: push if d < r₀, pull if r₀ < d < r₁
cohesion — drag me cohesion short-range pressure + mid-range pull — surface tension
29 — Pressure

A dense cluster that relaxes to an even fill, like a settling fluid.

SPH density relaxation — incompressible even-fill via mutual repulsion.

ρ = Σ W(d, h); v += −k·(ρ − ρ₀)·∇W (push down the density gradient)
pressure — drag me pressure SPH density relaxation — incompressible even-fill via mutual repulsion
30 — Hunt

A two-species swarm that chases and scatters — a living ecosystem.

Two-species pursuit — predators seek prey, prey flee predators.

predator: v += seek(nearest prey)·S; prey: v += flee(nearest predator)·S
hunt — drag me hunt two-species pursuit — predators seek prey, prey flee predators
31 — Spawn

A nozzle that jets matter into the field — a literal fountain or a star seeding the void.

A source [S] — creates matter along the heading, budgeted by a lifespan + pool ceiling.

while engaged: emit S·2 particles/frame along the heading, each living ~90 frames
spawn — drag me spawn a source [S] — creates matter along the heading, budgeted by a lifespan + pool ceiling
32 — Link

A cluster that holds together like cloth — a soft structure that ropes and drapes.

A Verlet distance constraint — ropes, chains, cloth, soft structures.

neighbours: e = d − L; v += ½k·(e/L)·û (holds rest length L = range·0.35)
link — drag me link a Verlet distance constraint — ropes, chains, cloth, soft structures
33 — Morph

A logo or chart that assembles from drifting matter — a mark, never words.

Matter assembles into a mark / chart / logo — never words (§11).

assign p → target t (hash of gx); v += (t − p)·k + jitter·(1 − arrived)
morph — drag me morph matter assembles into a mark / chart / logo — never words (§11)
34 — Resonate

Pair with attract: a well that breathes (pulsing strength).

Pulses its sibling forces with a time-varying strength.

modifier: scales sibling S by S(t) = 1 + sin(ω·t)
resonate — drag me resonate pulses its sibling forces with a time-varying strength
35 — Spotlight

Pair with stream: a directed beam confined to a cone.

A directional gate — confines sibling forces to a beam.

modifier: gates siblings outside an angular cone of the heading
spotlight — drag me spotlight a directional gate — confines sibling forces to a beam
36 — Pigment

A section that stains passing matter its own colour, carried away.

Conserved colour transport — matter takes on and carries a tint.

on overlap: c_p ← mix(c_p, tint, rate); the colour advects with matter
pigment — drag me pigment conserved colour transport — matter takes on and carries a tint
37 — Field Flow

A magnet or charge whose field lines the swarm threads, like plasma along a solar prominence.

Follow the field lines — steer onto and stream down the net field a body radiates.

n̂ = netField/|netField|; v += (n̂·|v| − v)·k_steer + n̂·gain·a_accel, gain = S·(1 − d/r)
fieldflow — drag me fieldflow follow the field lines — steer onto and stream down the net field a body radiates
V

Presets

Cosmology as composition — named arrangements of the primitives.

38 — Blackhole

A dramatic focal element — the field pours in, circles, and is swallowed.

A well, an accretion disk, an event horizon, and lensing.

expands to: attract · swirl · sink · lens
blackhole — drag me blackhole hover to engage · 4 forces in one body
39 — Whitehole

A source that only emits — the field is pushed away and downwind.

An emission horizon that throws matter out.

expands to: repel · stream
whitehole — drag me whitehole hover to engage · 2 forces in one body
40 — Star

A balanced body — gravity’s pull held off by thermal pressure.

Hydrostatic equilibrium — gravity balanced by thermal pressure.

expands to: gravity · thermal
star — drag me star hover to engage · 2 forces in one body
41 — Quasar

An accreting core with bright jets firing from its poles.

An accreting black hole with polar jets.

expands to: attract · swirl · sink · lens · jet
quasar — drag me quasar hover to engage · 5 forces in one body
42 — Galaxy

A spiral that winds the field into arms and settles into a disk.

A spiral disk that settles into a plane.

expands to: attract · swirl · viscosity · lens
galaxy — drag me galaxy hover to engage · 4 forces in one body
43 — Nebula

A warm, slow cloud — the field churns and light wisps rise.

A warm, slow cloud with rising wisps.

expands to: thermal · viscosity · buoyancy
nebula — drag me nebula hover to engage · 3 forces in one body
44 — Tornado

A funnel that swirls the field up its axis, ragged at the edges.

A funnel with an updraft, calmed at the edges.

expands to: swirl · stream · viscosity
tornado — drag me tornado hover to engage · 3 forces in one body
45 — Fountain

A literal fountain — matter sprays upward and falls back in an arc.

A class-[S] source jetting matter up, arcing home under gravity.

expands to: spawn · gravity
fountain — drag me fountain hover to engage · 2 forces in one body
VI

Conditions

When a force decides to act, and on which matter.

46 — Conditional

A force can choose what it touches.

Any body can carry a condition — gated on being engaged, or on a particle’s speed or heat. A selective force reads every free agent and acts only on those that match.

when = active · fast · slow · hot · cool · scrolling

The catcher below only grips hot particles. Heat the field and the excited matter is pulled in while the calm passes through.

conditional — catches heat only when hot selective attractor — grips excited matter, ignores the calm
VII

System

What emerges when the parts interact.

47 — Reciprocity

The field changes the element back.

The element bends the field — and the field’s local density bends the element in return. As particles gather on a word, it gains weight, brightness, and lift.

--d = density(body) weight, glow, rise

Hover the word — it pulls the field, the field piles up, and the pile makes the word heavier. A closed loop.

density → weight density gathered particles raise the element’s weight
48 — Conserved attention

The page can’t emphasize two things at once.

There is one finite budget of force for the whole page. Engage a word and it pulls force off every other — so as one gathers matter and grows heavier, the rest give theirs up. Focus isn’t styled; it’s conserved.

Σ Sᵢ · effortᵢ = constant

Hover one word — watch the others surrender their weight to it.

one budget, redistributed
focus depth weight
one finite budget — engaging one starves the rest
49 — Threads

Engaging one body wires the set.

Engage an element in a group and the field draws living threads between it and its siblings. A list stops being a list and shows itself as a connected system.

Hover any line.

a connected set
Product System Interface Material
threads connect the engaged body to its set
50 — Cross-boundary causality

Density doesn’t stop at the edge.

When a body saturates, the excess spills to its neighbours — weighted by nearness, and conserved. Engage one tile and the ones beside it light up on their own. The wiring between elements appears because matter actually flows between them.

Φᵢⱼ = κ · excessᵢ · wᵢⱼ ⁄ Σ wᵢₖ

Hover the middle tile — watch its neighbours catch, the far ones faintly.

spill → neighbours light
engage one — the excess spills to whoever’s near
51 — Formations

The whole field can change its mind.

Forces act locally. A formation acts on every particle at once — a single global bias. As you scrolled, each chapter quietly switched it.

Ambient — calm brownian drift, the resting state.

52 — Material typography

Type is a readout of mass.

The word is a body. It pulls the field, matter pools beneath it, and its whole appearance — weight, optical size, tracking, bloom, colour — is a live readout of how much has gathered. One value, --d, drives every axis at once.

--d wght · opsz · tracking · bloom · colour

Disturb it — the burst scatters the pile, the type goes light and pale, then it thickens back as the field resettles under its own pull. Type as a material, not a style.

density → every type axis material weight, optical size, tracking, glow and colour are one density
53 — Self-laying-out

The page arranges itself.

These nodes aren’t pinned by CSS. Each one pushes off the others and drifts away from crowded field, settling into an equilibrium — and re-settling when the field is disturbed or the window resizes. Layout as a physical process, not fixed coordinates.

F = anchor + repel + density pressure

Drag the attractor through them, or resize the window — the constellation scatters and re-settles like a physical object.

elements find their own positions field
Product System Interface Material Motion
anchor + mutual repulsion + density pressure → equilibrium

Now go bend it yourself.