Skip to main content
A shared surface separates the glass from its content. Add stationary content once, then move independently sized lenses over the completed scene.
Put the canvas inside a positioned .goop-orb-surface element. Size the surface explicitly. Place the content and lens elements inside it, with the .goop-orb-scene-content and .goop-orb classes respectively. Lens elements need a measurable box; interactive vanilla lenses need tabindex="0", role="group" and an accessible label. Ordinary drag stretches. Command-drag, or Command plus arrow keys, requests movement through onMove. The callback receives damped incremental CSS-pixel displacement, not an absolute position. The host applies it to the element. Without onMove, Command-drag retains stretch behavior. The built-in move modifier uses the Meta key; touch and hosts where the operating system reserves Meta need a host-provided positioning control.

Overlap

zIndex sets back-to-front lens order; equal values keep mounting order. Match DOM input stacking with that order. Scene-backed lenses refract completed layers beneath them. A lens with its own explicit source continues sampling that source. Independent lenses batch when texture bindings permit. Overlapping paint bounds require GPU backdrop copies; a hundred overlapping lenses cost more than a hundred separated lenses. This is one shared context with instanced draws, not a promise of one draw for every scene.

Removal and reuse

add and addContent return { update(options), destroy() }. Destroying a mount releases its own resources and source lease. It does not remove the host element or destroy caller-owned sources or shapes. Remove all consumers before destroying a shared shape or source. Read surface.stats without copying it into React state each frame. See performance for interpreting its counters.