광원 위치가 이동하며 물체의 밝은 면과 그림자 방향이 함께 바뀌는 효과A light source moves, changing the bright side of an object and the shadow direction together.
광원이 2초 동안 카드 왼쪽 -20%에서 오른쪽 120%로 이동하고 그림자가 20px 안에서 반대 방향으로 따라 움직인다
광원만 움직이고 그림자 방향이 그대로여서 물리적으로 어색하거나, 광원 밝기가 커 글자가 하얗게 날아간다
기본값은 클립에 쓴 값Defaults are the values used in the clip
| 항목PARAM | 기본DEFAULT | 범위RANGE | 메모NOTE |
|---|---|---|---|
| 이동 시간 | 2000ms | 1200~3500ms | 광원 이동 |
| 광원 x | -20%에서 120% | -30~130% | 카드 폭 기준 |
| 그림자 이동 | ±20px | 10~30px | 광원 반대 방향 |
| 광원 반경 | 45% | 30~60% | radial-gradient |
| 밝기 | 0.45 | 0.3~0.6 | overlay 또는 soft-light |
const s={x:-20};
tl.to(s,{x:120,duration:2,ease:'sine.inOut',onUpdate(){
card.style.background=`radial-gradient(circle at ${s.x}% 30%,rgba(255,255,255,.45),transparent 45%),#1c2230`;
card.style.boxShadow=`${(50-s.x)*.4}px 24px 40px rgba(0,0,0,.35)`;}},t);그대로 붙여 넣는다Paste as is
<카드>에 이동 광원을 넣어줘. radial-gradient 광원(반경 45%, 밝기 0.45)이 x -20%에서 120%로 2초 동안 sine.inOut 이동하고, box-shadow는 (50-x)*0.4px 만큼 반대 방향으로 이동하게 해. y 오프셋은 24px, blur 40px 고정. CSS 변수 --lx를 gsap로 보간하고 paused 타임라인으로 구동해.
Add a moving light to <card>. A radial-gradient light (radius 45%, brightness 0.45) moves from x -20% to 120% over 2s with sine.inOut, and the box-shadow shifts (50-x)*0.4px in the opposite direction with a fixed 24px y offset and 40px blur. Tween the CSS variable --lx with GSAP on a paused timeline.
<파일>의 <카드>에 moving-light를 구현해. 광원 x -20%에서 120%, 2000ms sine.inOut, 반경 45%, 밝기 0.45, 그림자 ±20px 반대 방향. 0초, 1초, 2초를 캡처해 밝은 면과 그림자가 반대로 움직이는지, 글자가 하얗게 날아가지 않는지 확인해.
Implement moving-light on <card> in <file>: light x -20% to 120%, 2000ms sine.inOut, radius 45%, brightness 0.45, shadow +/-20px opposite. Capture at 0s, 1s, and 2s to verify the lit side and shadow move in opposite directions and text does not blow out to white.
HyperFrames · ReelForge · Scrolline

개념 출처와 라이선스. 구현은 이 레포에서 새로 씀Concept sources and licenses. Implementations are original to this repo