peelFrame
The geometry of a page curling up from one corner: where the curl reads the child from, how far it has turned, and how far each pixel is from the crease.
peelFrame(opts: {corner: PropRef; amount: ArgSpec; radius: ArgSpec}): GatherFrame
Import effects from shaders/std and use effects.blurs.peelFrame.
corner is a compileTime string prop ('top-left' | 'top-right' | 'bottom-left' | 'bottom-right') with no transform. amount (0–1) is how far the peel has progressed, 0 flat and 1 fully peeled. radius is the tightness of the curl as a fraction of the page diagonal (0.02–0.4). Keep the frame in a module constant and pass it to the peel shading words and peelCompose.
Parameters
| Name | Type | Notes |
|---|---|---|
opts | {corner: PropRef; amount: ArgSpec; radius: ArgSpec} |
Example
const peel = peelFrame({corner: p('corner'), amount: p('amount'), radius: p('radius')})
Tip. Leave the
cornerprop without atransform: it must stay a string for the frame to read.
See also
peelCompose— A finished page peel: the cast shadows, the flat page and the lit curl, layered back to front.curlShading— The darkening in the crook of a curl, easing to full brightness at the lip.curlSheen— The band of light running up a curl.overhangShadow— The shadow a lifted curl casts on the flat page just past the crease.revealShadow— The shadow on the surface a peel reveals, just inside the crease.