Portfolio Motion
Pick the level first
| Level | What moves | Libraries | Budget (gzip JS) | When |
|---|---|---|---|---|
| Calme | Section fades, hover and press states | none | < 5 KB | Recruiter-first, corporate targets |
| Vivant | + split headline, counters, marquee with pause, magnetic main button, staggered lists | GSAP (+ ScrollTrigger) or one-shot-site effects.js | < 60 KB | Most portfolios |
| Spectaculaire | + one 3D or WebGL hero, one pinned scroll scene, custom cursor, scroll progress | three.js (lazy chunk), GSAP, optional Lenis | < 300 KB, three.js loaded after first paint | Creative devs, AI / 3D / front-end roles |
Ask the person. "Futuriste, animé" means Spectaculaire. Never mix two heavy scenes on one page.
Non-negotiable
- Animate
transform,opacity,clip-pathonly. Never width, height, top, left. - Hover effects only under
@media (hover: hover) and (pointer: fine). prefers-reduced-motion: reduce→ no movement, no parallax, 3D renders one still frame, content visible.- 3D: WebGL check, poster or plain background fallback,
pixelRatiocapped at 1.5 on phones / 2 elsewhere, render loop paused off screen and in hidden tabs. one-shot-siteaddons/hero3d.jsalready does all of this. - Text over a canvas needs a scrim (gradient) so contrast holds whatever the scene draws.
- Pinned scenes: use
pinType: 'transform'if the audit reports layout shift on the pinned element. - Hero headline readable within ~1 s; a showpiece may go to 2 s, never more.
- Loops beside text need a pause button (WCAG 2.2.2). The marquee in
effects.jsadds one. - Phone: no horizontal pinned scroll, stack the cards; keep one sticky action bar at the thumb.
Recipes that worked (files in recipes/ next to this SKILL.md)
recipes/agent-network.js— 3D agent-network hero,buildfor one-shot-siteinitHero3drecipes/a-3d.js— hero A: glass + bloom + Lenis (awwwards-3d glass-product ported to npm)recipes/b-particles.js— hero B: name in particles → sphere, mouse repulsion (frontend-atlas 6.1 ported to vanilla)recipes/c-type.js— hero C: type-fx tunnel + split-flap + grain (cinematic-ui; needscinematic-ui/kit/type-fx.js)recipes/common.css— shared hero layout and scrimrecipes/scene-particles.js— V6 hero: name → sphere → orbit rings, one shader, mouse repulsionrecipes/scene-glass.js— V6 contact: glass knot + bloom, lazy-loaded near the sectionrecipes/file-build.mjs— double-click build post-processor
| Effect | File / source | Notes |
|---|---|---|
| 3D agent network hero (core + agents on 3 orbits + travelling packets + dust) | recipes/agent-network.js, passed to one-shot-site initHero3d | Follows the pointer, recedes on scroll via window.__heroScroll |
| Split headline, counters, drawn SVG lines, marquee, magnetic, tilt | one-shot-site addons/effects.js (data-split, data-count, data-draw, data-marquee, data-magnetic, data-tilt) | Pick 3–4, not all |
| Pinned horizontal projects with counter "1 / 3" | main.js → ScrollTrigger pin + containerAnimation | Desktop ≥ 900 px only |
| Timeline line that draws while reading, dots light up | main.js → scaleY scrub + toggleClass | |
| Section titles that decode like a terminal | main.js → scramble() | Keep aria-label = real text |
| Custom cursor dot + ring | gsap.quickTo | Fine pointer only |
| Pointer light on cards | CSS radial-gradient at --mx/--my | |
| Reading progress bar, film grain overlay | CSS + one ScrollTrigger | Grain at 4–6 % opacity |
Where to get more
frontend-atlas→references/INDEX.md: 457 anchored recipes. For portfolios start withtext-effects.md,interactions.md(cursor, magnetic),scroll-gsap.md(pin, horizontal, stacked cards),webgl-shaders-3d.md(particles, fluid, shader backgrounds),page-transitions.md. Many examples are React: port to vanilla (same GSAP calls, querySelector instead of refs).cinematic-ui→kit/type-fx.js:typeFx(el, 'tunnel' | 'glitch' | 'split-flap' | 'read-fill' | 'blur-resolve' | 'slit-scan' | …), drivefx.p(0–1) with a ScrollTrigger or a tween andfx.tfor continuous effects.kit/grade.jsfor grain and halation.awwwards-3d→docs/templates/*.html(minimal, coin-scroll, room-walkthrough, glass-product),references/PATTERNS.md,SHADERS.md,POST_PROCESSING.md. Replace unpkg imports with npm packages.auteur→reference/scroll-cinema.mdfor wipe / curtain / shutter transitions and displacement.
Verify motion, do not guess
npm run build
node <one-shot-site>/scripts/film.mjs dist # strips + timeline: layout-shift, slow-headline, loops
node <one-shot-site>/scripts/film.mjs dist --reduced # must be "All clear"
node <frontend-atlas>/scripts/motion-audit.mjs <url> # CLS, frame pacing, reveals that never fire
Headless Chrome on WSL/Linux without system libs: install playwright-core, run
npx playwright-core install chromium-headless-shell, extract libnspr4 libnss3 libasound2t64 with
apt-get download + dpkg-deb -x into a folder, and point CHROME_PATH at a wrapper that sets
LD_LIBRARY_PATH (see tools/portfolio-kit/chrome-wsl.sh).
Pitfalls found in V6
document.fonts.load()rejects onfile://: always.catch(() => {})before sampling text into particles.- three.js does not parse
oklch(): convert CSS colours by painting one canvas pixel and reading it back. - Type-fx layers (tunnel) are decoration: mark the stage
aria-hiddenandinert, or axe reports contrast on them.
Shipping a build that opens by double-click
file:// blocks ES modules, crossorigin font preloads and lazy chunks. Most people open index.html from the
explorer first and conclude the site is broken. Ship both:
dist/— normal Vite build for hosting.dist-file/—FILE_BUILD=1 BASE=./ vite build --outDir dist-filewithrolldownOptions.output = { format: 'iife', codeSplitting: false }, thentools/portfolio-kit/file-build.mjs(copied by the kit installer): removes font preloads, swapstype="module"fordefer, injects the CSS with fonts inlined as base64. Test it with afile://URL in headless Chrome; zero console errors except{{URL}}before deploy.