mesh-avatar-studio
Turn one illustration into an animated 2D mesh avatar with a coding agent and a local editor
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证A repository for stickers
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
Live demo: arn.as/stickers — works on desktop and phones.
A sticker playground in the browser. Open a pack, grab a corner, peel one off and slap it onto a notebook.查看完整 README ↗Live demo: arn.as/stickers — works on desktop and phones.
A sticker playground in the browser. Open a pack, grab a corner, peel one off and slap it onto a notebook.
npm install
npm run dev # http://localhost:4791
npm run check # type-check, formatting, unit tests
npm run e2e # browser smoke test: peel, carry, drop, make your own
npm run build # static site in dist/
src/peel/model.ts)A sticker is treated as an inextensible sheet. A peel is fully described by a fold line (direction d and position f), a curl radius r and a wrap angle θ:
r for up to θ radians;Arc length is preserved, so the sticker never stretches (the tests check this numerically).
The harder part is the inverse problem: given where the pointer is, find the fold so that the point you grabbed lands under the cursor.
s − r·sin(s/r) along the peel direction while it's on the curl, which is solved with guarded Newton iteration, and (reach + πr)/2 once the flap lies flat on top.The pointer target is spring-smoothed and the fold direction is blended, so switching between the two cases never snaps. Releasing early sends the target back through an underdamped spring, so the flap slaps down.
Once a sticker is free, it's carried by the exact point you were holding (pivot · tilt · yaw · translate(−grab), using the grab point's curled position). That's why a freshly popped flap unfolds around your fingers instead of jumping.
src/peel/wrap.ts)Stickers that hang past the notebook's edge fold over it, run down the side and continue onto the desk. Each point's distance from the edge is kept the same, so the sticker doesn't stretch here either.
src/stickers/factory.ts)Each sticker's die-cut silhouette is rasterised to a coarse mask. A chamfer distance transform of that mask gives two things at any point:
The gradient sends a corner grab along the bisector and an edge grab straight in. Picking raycasts the deformed meshes, then checks the hit's UV against the mask, so the transparent part of the quad can't be grabbed.
Geometry. A resting sticker is two static meshes cut from its silhouette: an opaque core and a thin alpha-tested edge band (src/stickers/split.ts). The GPU can skip whatever the opaque core covers, so a pile of overlapping stickers costs roughly one layer, not all of them. A sticker that's curling, wrapping or flying switches to an 84×84 grid that the CPU deforms only on frames where something changed. It shares that grid between its printed front and an adhesive-paper back face.
Soft shadows. src/scene/pcss.ts patches three's shadow lookup with percentage-closer soft shadows. A blocker search estimates how high the occluder is and widens the filter to match. A lifted corner gets a tight contact shadow, and a sticker held 3 cm up throws a broad, faint one. Two things keep it cheap:
Holographic foil. src/stickers/materials.ts injects a foil pass into the sticker material before lighting:
Foil is masked per sticker, so the ink and faces stay printed.
Generated assets. Textures, die-cut borders, the kiss-cut sheet (with liner holes and a roughness map for the glossy liner) and all sounds are generated at runtime. The peel crackle is a stream of band-passed noise grains whose density follows the speed of the peel front.
Nothing is drawn unless something changed. The frame loop (src/loop.ts) goes to sleep entirely when the scene is still and wakes on input. The only thing that wakes it on its own is the "peel me" corner's occasional flutter on the opening screen, which stops once you've peeled something. Shadows are re-rendered only when something that casts one moves. Passive motion (parallax, settling springs) is capped at 60 fps, while dragging gets the display's full rate. Pixel ratio is capped at 1.5 and drops on slower GPUs.
Measured on an M4, 1920×1080 window at 1.5× (2880×1620 pixels):
| Scene | GPU per frame |
|---|---|
| Opening view | ~2 ms |
| 92 overlapping stickers | ~5 ms |
| Idle (nothing moving, no flutter in progress) | no frames |
| File | What it owns |
|---|---|
src/peel/model.ts | peel geometry and the drag → fold solver (pure, tested) |
src/peel/wrap.ts | wrapping over box edges (pure, tested) |
src/playground.ts | interaction state machine: hover, peel, carry, drop, layering |
src/stickers/factory.ts | art → die-cut sticker, masks, distance field |
src/stickers/sticker.ts | per-sticker meshes, pose and deformation |
src/stickers/split.ts | resting sticker → opaque core + alpha-tested edge band |
src/stickers/materials.ts | gloss / matte / holo materials, shared per design |
src/stickers/art.ts | the ten characters, as SVG |
src/scene/* | renderer, camera, desk, notebook, sheet, PCSS |
src/loop.ts | frame loop that sleeps when idle |
src/view.ts | camera: opening shot, desk tilt, pointer/gyro parallax |
src/library.ts | sticker designs (built-in and user-made), built once and cached |
src/composition.ts, src/persist.ts | saving the desk, share links (tested) |
src/ui.ts | toolbar, sticker maker, hints |
src/audio.ts | synthesised sound |