Adds live, coded effects to a landing-page hero that arrive one at a time and stack: grainy gradient, prism glass, 3D parallax from a depth map, background text, 3D bend, brush stroke, clouds and god rays, biggest change last. Use when someone wants effects, shaders or depth on a hero, or a page that pops or feels 3D. Designing the page itself: charles-unreasonable-craft.
375 stars
0 votes
0 copies
0 views
Added December 2, 2026
ai-agentspythongoswiftbashreactnextjsnode
Works with
cli
Security analysis
A96/100
mediumInstalls packages at runtime which could introduce malicious dependencies
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Charles Hero Effects?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/lemonface0309-charles-hero-effects)
---
name: charles-hero-effects
description: "Adds live, coded effects to a landing-page hero that arrive one at a time and stack: grainy gradient, prism glass, 3D parallax from a depth map, background text, 3D bend, brush stroke, clouds and god rays, biggest change last. Use when someone wants effects, shaders or depth on a hero, or a page that pops or feels 3D. Designing the page itself: charles-unreasonable-craft."
compatibility: "A browser with WebGL2. Node 20+, playwright-core and Google Chrome to check renders; uv for the image scripts. 3D parallax: Depth Anything V2 Small, through uv or in Chrome. Clouds: Canvas UI, installed with npx shadcn. Cut-outs: macOS Vision, plus rembg when Vision misses a part or off a Mac."
---
# Goal
A live hero that starts as a clean page and gains effects one step at a time, each step on top of the last, ending on
the biggest change, until the page feels like a real object: depth you could reach into, light falling on something,
ink soaked into paper, glass you could touch. It runs in the visitor's browser, on a phone too, and every step is a
visible improvement at phone size.
# The rules
Every rule here comes from blind tests of the pages in Charles' reel, where a fresh critic compared each state with
the one before it.
1. **State 0 is a finished page.** A real business, photo-led or type-led, clear in a second, already good. An effect
can't rescue a weak page, and a ladder that starts broken proves nothing.
2. **Each effect fills something the page lacks.** Never lay an effect over a finished photograph or over the type:
every step that lost its test did that (a halftone over the photo read as "a muddy blob", window light on a wall
already in sun read as "an overlay"). Effects go in the backdrop, the light, the depth or empty space.
3. **Effects stack.** Each step adds on top, and nothing a step added disappears or gets covered later. Charles'
note on a page that broke this: "the dithering literally cancels out the halftone".
4. **Biggest change last.** Rank the effects by how much of the page changes at phone size and play them smallest
first. The last step is the one people remember; a small last step lands as an anticlimax.
5. **Visible on a phone within one second.** Look at every state 390 px wide. An effect you can't see there doesn't
count: a 30 px parallax drift and a 4 px dither both read as nothing.
6. **Name each effect for what you see**: "Brush stroke", not "motion blur"; "Prism" for reeded glass. People learn an
effect by its name; Charles' note on a brush painting a stroke that was labelled motion blur: "The brush moving
isn't really a motion blur effect".
7. **One idea per step.** A step may bring two effects only when they are one change in the world: the sun coming out
(god rays and their caustic light), weather arriving (a grainy sky and clouds).
# Steps
`<skill>` is this skill's folder.
## 1. Read the hero
Write down, in one line each: the subject (the photographed person, product or building, or none), the backdrop
(plain wall, sky, scene, paper, flat colour), the light (where it comes from), the brand's world (materials, place,
craft). The effects come from these four lines, never from a list of effects you like.
## 2. Choose three effects
Walk this tree once per page and take every line that applies: the lines are not alternatives. It gives candidates;
rule 2 decides.
```
Is there a photographed subject that can be cut out (a person, a product, a building)?
├── Yes: 3D parallax (the subject comes forward off the page and turns with the pointer), plus every line that fits:
│ ├── a plain wall or studio backdrop → grainy gradient: paint it in the brand's light, multiplied so its texture stays
│ ├── open sky → clouds
│ ├── a light that can shine from behind or above the subject (the sun, a lamp, headlights) → god rays
│ ├── empty space beside the subject, a quarter of the frame or more → background text: a word or line from the brand
│ └── glass belongs to the brand (an optician, a glass studio, a perfume house) → prism: a framed pane of reeded glass
├── No subject, a scene (sea, mountains, a city, a sky) → clouds, 3D parallax of the whole photo from its depth map,
│ god rays (light reaching into the scene)
└── No photo: a sheet, print or type-led page → background text (an inscription on the sheet), 3D bend (its ends roll
away), brush stroke (the page's mark, painted in one move)
```
Fewer than three: add from this order until there are three, skipping any that rule 2 rules out: background text,
grainy gradient, god rays (from a light the photo already shows), clouds (only over open sky). More than three: drop
prism first, then the smallest by the sizes below.
Brush stroke and 3D bend are for sheet, print and type-led pages only, where the sheet is the subject. Never paint a
stroke on a photo page: over the photograph it breaks rule 2, and behind a cut-out subject the brush has to pass behind
the subject too, which reads as a mistake. Never bend a photograph of a scene: a scene doesn't roll like paper, and the
reel's critics already called a sheet bent too far "a curved monitor or a can label".
Then order them by how much of the frame changes at phone size, smallest first:
- small: prism, 3D bend, thin clouds, a small inscription
- medium: a grainy gradient over the whole backdrop, a giant word behind the subject
- large: 3D parallax (the subject comes forward, zoom 0.1 to 0.28, and turns), god rays flooding the scene with light,
a brush stroke that becomes the page's subject
Between two large ones, the one that changes more of the frame goes last: light over the whole sky beats one subject
growing. A dependent effect comes after what it needs: god rays after clouds (the sun breaks through them).
Prism is the weakest of the eight: in the reel's tests it lost to the page without it in every form, which is why
the tree offers it only when glass belongs to the brand. Front effects (a glass pane, a stroke) stay clear of the
subject and the type in the phone crop too, not only on desktop.
## 3. Make the assets
Read [references/assets.md](references/assets.md) for the commands, what each costs and how long it takes:
- 3D parallax needs a depth map: `<skill>/scripts/depth.py` (Depth Anything V2 Small, Apache-2.0, through uv) or
`<skill>/scripts/depth-web.mjs` (the same model in Chrome, no Python), then `<skill>/scripts/depth_prep.py`. Never
use the Base or Large models on a client's or a commercial page: their licence is non-commercial.
- Anything that goes behind the subject (text, clouds, rays, a new backdrop) needs a cut-out: on macOS
`<skill>/scripts/cutout.swift` (Vision, nothing to download), then `<skill>/scripts/prep.py --check`. When the check
picture shows a part missing, or off a Mac, add rembg's mask (references/assets.md). Look at the check picture before
building on the cut-out: a model that drops a head or keeps a cast shadow says nothing about it.
- A brush stroke needs a picture of brushwork: the person's own scan of ink on paper or a generated stroke, keyed by
`<skill>/scripts/stroke_prep.py`, or one of the two AI-generated strokes already keyed in `<skill>/assets/`
(`enso.webp`, `swoosh.webp`, each with its path). Never a brush font: critics spot it at once.
- A 3D bend needs a picture of the sheet: `<skill>/scripts/shots.mjs --element`.
- God rays that light the subject up need the photo already lit plus a darkened copy for the states before the light:
`<skill>/scripts/darken.py`.
## 4. Build the page
Copy `<skill>/kit/` into the page's folder and start from `kit/page.html` (copied to `index.html`). Before writing,
read the finished example closer to your hero: `<skill>/examples/wendel/index.html` (a cut-out on a new sky: grainy
gradient and clouds, 3D parallax, god rays) or `<skill>/examples/atelier/index.html` (a sheet: background text, 3D
bend, brush stroke). Each effect is `{ name, dur, ease, apply(p) }`, where `apply(0)` is the page before it and
`apply(1)` after it; `createHero([...])` builds the ladder and `ladder.play()` plays it (below), `?state=n` holds state n
for checking, and the keys 0-9 play or jump. Build each effect from its recipe in
[references/effects.md](references/effects.md): the code, the numbers that worked and the reasons they did.
- Layer order, bottom to top: backdrop photo, backdrop effects (gradient, clouds, rays), text behind the subject, the
subject cut-out, front effects (a glass pane, the stroke), the interface. The type of the interface never moves
with the picture: two critics asked for it to stay put.
- Draw the photo and its cut-out with `depthLayer` and the same `position`, `shift` and `zoom`, so they never part.
A cut-out with no photo behind it (a product, a building on a new sky) goes on a layer that covers the whole hero,
placed with `rect`, so it can move and grow without being clipped at its own edges.
- Every layer that drifts with the parallax runs past the hero on each side by more than its drift (`inset: -6%`), or
its edge shows as a strip of the page behind it.
- The kit's 3D bend rolls a still picture of the sheet: anything that appears on the sheet later (text, a stroke) sits
on its own layer above it, inside the flat middle.
- End the script with `await ready(); ladder.play();`. A visitor then sees the clean page for 0.8 s, each step once,
0.9 s apart, and the page stays on its final state. Never leave the steps behind a key press or `?state=n`: a phone
has no keys, and a page that opens and sits on state 0 shows none of its effects.
- With prefers-reduced-motion the page opens on its final state and nothing on it moves: `play()` jumps there,
`paper.js` freezes its shaders and `follower` holds the centre. Freeze anything else that drifts (Canvas UI's clouds:
`speed: 0`), as `examples/wendel/` does.
- A prism pane over anything that moves (the parallax, drifting clouds) is repainted from the live layer every frame
(`paintFrom` in kit/glass.js), or the glass shows a still world while everything round it moves.
- On a textured backdrop (rain, reflections, leaves, brick) the parallax bends the backdrop's lines round the subject:
references/effects.md (3D parallax) gives the trade-off and the three fixes.
- Durations: 0.7 to 1.2 s a step: shorter reads as a cut, longer stalls the ladder. Colour and light ease with
`ease.soft` (light that snaps on looks switched, not risen); the parallax and things that slide in with `ease.swift`.
- The parallax follows the pointer like a hand (`follower`). On phones there is no pointer, so it sways in a slow
figure of eight, which keeps the depth visible there.
- Canvas UI's Clouds: install it with `bash <skill>/scripts/install-canvas-ui.sh`, which runs Canvas UI's own
`npx shadcn@latest add @canvas-ui/clouds-vanilla`. Never copy Canvas UI's code into a page you share as a template,
kit or skill: its licence (MIT + Commons Clause) allows it in your own site, not redistributed.
- Paper Shaders come vendored in `kit/vendor/paper-shaders/` with their LICENSE and NOTICE (Apache-2.0): keep both
files wherever the kit goes.
- In a React or Next.js app, build and check the hero as a plain page first, then port it: each layer mounts in a
`useEffect` that removes its canvas on unmount, Paper comes from npm (`@paper-design/shaders@0.0.82`, the version the
presets match) and Clouds from Canvas UI's React line (`npx shadcn@latest add @canvas-ui/clouds-react`).
## 5. Check every state
```bash
[ -f package.json ] || npm init -y; npm i -D playwright-core # once, in the page's folder
node <skill>/scripts/shots.mjs index.html --moves --photo '#photo' # --photo: the layer under the cut-out, if any
node <skill>/scripts/shots.mjs index.html --browser webkit # Safari's engine (npx playwright-core install webkit)
```
It writes `shots/sheet.jpg` (every state), `cutout.jpg`, `extremes.jpg`, `autoplay.jpg` and `move-<n>.jpg`. Look at
every image at full size. First state 0, because a broken cut-out passes every later check:
0. In `cutout.jpg` (state 0 with the photo hidden) and the cut-out's check picture: is the subject whole (head, hands,
hair, feet), with nothing cut out with it (a cast shadow, a piece of the old wall)? With the photo behind it, a
missing part is filled in by the photo and shows only once the subject moves. If not, fix the cut-out
(references/assets.md) before any effect.
Then, for each step n to n+1, answer in writing:
1. At 390 px wide, can you name what changed within a second? If not, make it bigger or replace it.
2. Is state n+1 better than state n as a page, not only different? If not, the effect is laid over something
complete (rule 2): move it to what the page lacks, or replace it.
3. Is everything earlier steps added still there and uncovered? A stroke painted over the background text breaks
rule 3 as surely as one that erases it: move the later effect, not the earlier one.
4. In the phone render, is the subject still in frame and the type readable over every effect? Fix `position` and the
layout, not the effect.
5. In `move-<n>.jpg`, does the move read as one piece (no edge doubling, no layer sliding off its photo)?
Then the page as a whole:
6. In `extremes.jpg` (the pointer at the hero's four corners): does no edge where the photo's frame crops the subject
come into the hero, and do straight lines near the subject (rain, a horizon, a window frame) stay straight? If not,
lower the shift and zoom or follow references/effects.md (3D parallax).
7. Did shots.mjs print `autoplay PASS`, and does `autoplay.jpg` show the final state at desktop and phone? That is
the page opened with no query and no input, as a visitor opens it.
Fix and render again until checks 0, 6 and 7 hold and 1 to 5 hold for every step. A step that still fails after two
fixes gets replaced by the next candidate from step 2.
# Deliver
The page folder (the page, `kit/`, its images, depth map and cut-out), `shots/sheet.jpg`, and four lines: each step
and what it adds, in the words a viewer would use (the page plays them once when it opens, then holds the last); which
browsers it was checked in; what had to be downloaded or installed; anything that still fails a check, said plainly.
Files in this skill
.gitignore154 B
README.md5 KB
SKILL.md14.1 KB
assets/brush.json38 B
assets/brush.webp81.7 KB
assets/enso.json129 B
assets/swoosh.json453 B
evals/README.md917 B
evals/no-trigger-hover-polish/graders/not-fired.md114 B
evals/no-trigger-hover-polish/prompt.md222 B
evals/outcome-depth-licence/graders/answer.md73 B
evals/outcome-depth-licence/graders/judgment.md415 B
evals/outcome-depth-licence/prompt.md271 B
evals/outcome-ladder-plan/case.yaml84 B
evals/outcome-ladder-plan/fixtures/hero.md576 B
evals/outcome-ladder-plan/graders/answer.md62 B
evals/outcome-ladder-plan/graders/judgment.md1020 B