AWESOME AI MOTION
효과Effects / 원리 도해Explainer / Nº 372

코드 변경 전개Code Diff Reveal

Code Diff Reveal
코드 변경 전개
다른 이름Also known as · Code diff · 코드 차이 전개 · Code edit insertion and removal · 코드 삽입과 삭제 · Code Token Replace and Reflow · 코드 토큰 교체와 재배치
372
렌더 추가 예정CLIP COMING코드 변경 전개Code Diff Reveal정의·파라미터·프롬프트는 아래에 있다Definition, parameters and prompts are below
도판Fig. 372. 코드 변경 전개 · Code Diff Reveal · power2.out

삭제된 줄이 붉게 줄어 사라지고 추가된 줄이 초록색으로 펼쳐진다.Removed lines collapse and added lines expand with distinct markings.

01

무엇을 전하나What it tells

전달 효과ConveysCONVEYS
변경 전후의 추가와 삭제를 구별한다.Distinguishes what changed between code versions.
언제 쓰나Use whenUSE WHEN
  • 삭제 줄에는 마이너스, 추가 줄에는 플러스 표식을 붙여 공개한다.
  • 변경 전후의 추가와 삭제를 구별한다. 기준값과 대상을 함께 표시할 때.
  • Explain additions and deletions in code.
  • Keep the encoded values, labels, and visual state synchronized.
과용 주의AvoidAVOID
  • 코드 읽기 시간을 최소 2초 확보한다.
02

좋은 예와 나쁜 예Good and bad use

좋은 사례GOOD

삭제 줄에는 마이너스, 추가 줄에는 플러스 표식을 붙여 공개한다.

과용 · 나쁜 사례OVERUSE

색만 바꾸고 삭제와 추가의 구분 표식을 생략한다.

03

파라미터Parameters

기본값은 클립에 쓴 값Defaults are the values used in the clip

항목PARAM기본DEFAULT범위RANGE메모NOTE
장면 지속6000ms4000~8000ms읽기 정지 포함
줄 간격100ms60~180ms줄 순서 유지
줄 교체400ms250~600ms삭제 후 추가
GSAP
const tl=gsap.timeline({paused:true});
tl.to('.removed',{opacity:0,height:0,duration:0.4,stagger:0.1,ease:'power2.out'},1);
tl.fromTo('.added',{opacity:0,height:0},{opacity:1,height:32,duration:0.4,stagger:0.1,ease:'power2.out'},2);
tl.to({}, {duration:3},3);
04

에이전트 프롬프트Agent prompts

그대로 붙여 넣는다Paste as is

Claude Code

<파일>의 <대상>에 코드 변경 전개을 적용해. 원본과 결과 줄을 비교한 고정 상태표로 줄 마스크와 위치를 보간한다. 장면 지속 6000ms; 줄 간격 100ms; 줄 교체 400ms을 적용한다. GSAP 코어의 paused 타임라인 하나로 seek 가능하게 만들고 임의 난수와 타이머를 쓰지 마.

Implement Code Diff Reveal on <target> in <file>. Use a 6000ms scene with 100ms line stagger and 400ms line replacements. Mark removals with minus signs and additions with plus signs and leave at least 2s to read. Use one paused GSAP core timeline, support seeking, and avoid random values and timers.

Codex

<파일>의 설명 장면에서 <대상>에 코드 변경 전개을 적용해. 원본과 결과 줄을 비교한 고정 상태표로 줄 마스크와 위치를 보간한다. 장면 지속 6000ms; 줄 간격 100ms; 줄 교체 400ms을 적용한다. 0초, 3초, 6초를 캡처해 시작 상태, 중간 진행, 최종 상태를 확인하고 같은 시각으로 다시 seek했을 때 좌표와 라벨이 같은지 검증해.

Implement Code Diff Reveal on <target> in <file>. Use a 6000ms scene with 100ms line stagger and 400ms line replacements. Mark removals with minus signs and additions with plus signs and leave at least 2s to read. Use one paused GSAP core timeline, support seeking, and avoid random values and timers. Capture at 0s, 3s, and 6s to check the initial state, intermediate motion, and final state. Seek to each time again and verify identical geometry and labels.

05

도구별로 쓰기In your tools

HyperFrames · ReelForge · Scrolline

HyperFramesVIDEO · GSAP
paused 타임라인에 코드 변경 전개 상태를 넣고 seek 시 6초의 좌표와 색을 다시 계산한다.
ReelForgeBRIEF TO VIDEO
씬 워커 브리프에 장면 지속 6000ms; 줄 간격 100ms; 줄 교체 400ms을 싣고 삭제 줄에는 마이너스, 추가 줄에는 플러스 표식을 붙여 공개한다.
Scrolline DeckSCROLL SCRUB
진행률 0~1을 6초 구간에 매핑한다. scrub에서는 스프링 대신 power2.out을 쓰고 역방향에서도 라벨과 도형을 함께 갱신한다.
06

잘 맞는 조합Pairs well with

07

출처Sources

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