본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)7.2k · #13428

falling-leaves

하는 일

이 스킬은 분명하게 나뭇잎으로 읽히는 낙엽 효과를 만들도록 AI 에이전트를 안내합니다. 계절이나 자연 느낌의 움직임을 원하지만 색종이처럼 보이지 않기를 원하는 웹 디자이너를 위한 스킬입니다.

사용하는 경우

  • ✓계절이나 자연 주제의 페이지에 실제 나뭇잎처럼 보이는 잎이 필요할 때.
  • ✓단순한 파티클 효과가 색종이처럼 보여 더 형태가 필요할 때.
  • ✓평면 캔버스 버전이나 3D 버전 중 하나의 낙엽을 원하는 경우.

스킬 링크

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/falling-leaves/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/falling-leaves/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“히어로 섹션에 가을 낙엽이 떨어지게 해 주세요. 잎이 구르고 돌면서 분명하게 나뭇잎처럼 보여야 합니다.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 각 잎을 자기 축을 중심으로 돌게 해, 앞면을 보였다가 가장자리로 얇아지고 다시 펴지게 합니다. 옆으로 흐르는 움직임은 그 회전을 따르며, 잎은 재활용되고 깊이를 위해 겹쳐집니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Falling Leaves

Make the falling thing read as a leaf. Reach for ambient-section-particles when you want a bounded atmosphere of generic motes. Reach for this when the shape has to be recognisable.

Build the tumble first

Turn each leaf about its own long axis so it shows its face, thins to nothing edge-on, then opens out on the other side. That instant of near-disappearance is what the eye reads as "leaf". A sprite that only spins in the picture plane reads as confetti, a coin, or a paper scrap, however good the artwork is.

On 2-D canvas the tumble is a horizontal scale that crosses zero:

ctx.save();
ctx.translate(l.x, l.y);
ctx.rotate(l.roll);              // long axis drifting in-plane
ctx.scale(Math.cos(l.spin), 1);  // the tumble: cos crosses 0, edge-on
ctx.globalAlpha = l.alpha;
ctx.drawImage(sprite, -w / 2, -h / 2, w, h);
ctx.restore();

Drive two axes, not one. roll turns the leaf within the picture plane; spin turns it through the plane. Give each its own rate per leaf, or the motion reads as mechanical however you ease it.

In 3-D, instance quads, never point sprites. A point sprite always faces the camera and can never turn away, so it can never go edge-on. That single constraint decides the whole implementation.

Couple the slip to the tumble

Drive lateral motion from the same angle as the tumble, ninety degrees out of phase. A leaf slides sideways when it knifes through the air edge-on and stalls when it presents its face flat:

l.x += Math.sin(l.spin) * l.slip * dt;   // fastest when cos(spin) ≈ 0
l.y += l.fall * dt;

Do not put an independent sine on x. It reads as wind or as an easing bug. This coupling costs one term and is what makes the path look aerodynamic.

Bake both faces

Bake two sprites per colour and pick by the sign of the tumble:

const img = Math.cos(l.spin) < 0 ? sprite.back : sprite.face;

Make the back duller and paler than the front. Without this the leaf reads as a flat cut-out spinning; with it, as a solid object with a front and a back. It is the cheapest realism in the system.

Vary every parameter per leaf

Randomise fall speed, tumble rate, roll rate, slip amount, phase, scale, and opacity at spawn. Share any one of them and the field stops being leaves and becomes a texture scrolling down the screen. The eye finds the common rhythm in about two seconds.

Choose where leaves come back from

This decides how many leaves are actually on screen.

In 2-D, recycle across the viewport. When a leaf passes the bottom, respawn it above the top at a new random x. Wrap x as well, so wind does not empty one side.

In 3-D, recycle ahead of the camera, not around it. A band centred on the camera spends nearly all its volume behind and beside the frustum; on a 36° camera, a couple of hundred leaves put barely a dozen in frame. Drop them into a disc hung down the camera's own sight line instead and the same count appears several times over:

camera.getWorldDirection(fwd); fwd.y = 0; fwd.normalize();
const cx = camera.position.x + fwd.x * AHEAD;
const cz = camera.position.z + fwd.z * AHEAD;
const a = Math.random() * TAU, r = Math.sqrt(Math.random()) * SPREAD;
l.x = cx + Math.cos(a) * r;  l.z = cz + Math.sin(a) * r;  l.y = camera.position.y + 16;

Keep a far wrap as a backstop for a camera that walks out from under its own weather, and put it well outside the fog so nothing is seen to jump.

Set density by band area, not by count

On-screen density goes as count ÷ band area. Tighten the band before raising the count:

  • Halving the recycle radius quadruples on-screen density at the same count.
  • Doubling the count doubles draw cost for the same on-screen gain.

Scale an authored count by viewport area rather than taking it literally, or a figure that reads as a drift on desktop arrives as a blizzard on a phone:

const k = clamp(Math.sqrt((W * H) / (1440 * 900)), .5, 1.3);
const n = Math.round(authored * layerShare * k);

Layer for depth

Use two or three layers, each with its own scale, speed, opacity, and blur:

layer scale fall opacity note
far 0.3–0.5 slow 0.22–0.40 drawn first, may sit behind content
mid 0.5–0.85 medium 0.46–0.78 the body of the effect
near 1.05–1.9 fast 0.50–0.82 few, optionally blurred, drawn over content

Cross the near layer in front of the type. That crossing is the depth cue. Use two or thre

자주 묻는 질문

잎이 잠깐 사라지는 것처럼 보이는 이유는 무엇인가요?

잎이 옆으로 돌아 가장자리만 보일 때 얇아 보이는데, 그 짧은 순간이 나뭇잎처럼 읽히게 만듭니다.

3D 옵션이 있나요?

네. 이 스킬은 인스턴스 방식의 3D 버전을 다루며, 잎이 카메라에서 돌아갈 수 있도록 평평한 모양을 씁니다.

움직임에 민감한 방문자는 어떻게 하나요?

모션 줄이기 지원과, 효과가 보이지 않을 때 멈추는 기능이 포함되어 있습니다.

상세 정보

작성자의 원본 설명

Build falling leaves that read as leaves, with each one tumbling on its own axis so it presents a face, thins to an edge, and opens out again, and with its sideways slip driven by that same tumble. Covers the 2-D canvas build and the instanced-3-D variant, where leaves are recycled from, density-versus-count maths, depth layering, colour under a tone-mapped composite, reduced motion, and visibility pausing. Use for autumn maple, sakura petals, blossom, ash, snowfall shapes, or any drifting foliage where a generic particle field reads as confetti.

repo: MengTo/Skills

인기도

GitHub 스타
7.2k
순위
#13428
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬