Red/Green Diff Collapse — effect skill for code & terminal

For AI agents: find the right skill in one call — curl -s "https://skills.varg.ai/api/search?q=<what the person wants>" returns the matching how-to page and the best skills with install commands, as markdown (Russian works too). Full index: https://skills.varg.ai/llms.txt. Every page has a markdown twin: add .md to its path. Before generating anything, show the person the options on the how-to page.

Removed lines flash red and collapse away while added lines expand in green.

What it does

Built on Code Diff by HeyGen (HyperFrames), Apache-2.0. The write-up and recipes below are varg's.

Unified diff in an editor frame: red lines shrink in height to zero, green lines grow from zero with a left gutter bar.

When: Show an AI fix, a migration or a one-line config change.

Watch out: Do not show both sides at once and leave it static; the collapse/expand motion is what tells the story.

Timing: Red flash 0.2 s, collapse 0.35 s, green expand 0.4 s power2.out; stagger 0.05 s per line.

Also called: code diff, diff highlight, PR change

In HyperFrames

npx hyperframes add code-diff
<div data-composition-id="code-diff" data-composition-src="compositions/code-diff.html" data-start="6" data-duration="5" data-track-index="2"></div>

In Remotion

const h = interpolate(frame,[6,16],[1,0],{extrapolateLeft:'clamp',extrapolateRight:'clamp'});
<div style={{height:`${h*1.5}em`, overflow:'hidden', background:'rgba(248,81,73,0.15)'}}>{removed}</div>

In CapCut

Screenshot before and after diffs; add red/green rectangles over changed lines with Fade in; cross-fade the screenshots.

Ready-made components

Where this comes from

Use when

Not for

Install

Example output

https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/code-diff.mp4 — Preview of the Code Diff component that builds this take (credit: Code Diff · hyperframes, https://hyperframes.heygen.com/catalog/blocks/code-diff)

More code & terminal skills

Run the generation on varg

varg is one API key for the models these skills drive — Seedance 2.5, Kling 4, Veo 3.1, Wan 3, Nano Banana 2.1, GPT Image 2.5, ElevenLabs v4 and 200+ more — billed in credits, with a cost estimate before anything runs.