Motion · Transição
Gradient transition
The background smoothly transitions among linear, radial, and conic CSS gradients — angle, color stops, center, and radius each interpolate, with a cross-fade at type changes.
Fonte: video-shotcraft (Vincent Wei) ↗ · Apache-2.0 · Composição Remotion (React/TSX) — vídeo de prévia, sem player no navegador
When to use
A continuous variation for the atmosphere / section background color; gives a static layout section a background layer that feels "alive".
Intention
A gradient isn't a static bitmap but an animatable parameter set: any parameter within the same gradient type can interpolate into a smooth change, with a short cross-fade bridging type changes. Used as a background layer, it gives a section with "no subject motion" a persistent low-speed energy.
Duration & energy
- Duration: About 6.0s (180f@30fps; linear 0–2.4s · radial 2–4.2s · conic 4–6s)
- Energy: Low (pure background motion, stays out of the foreground content's way)
Shot recipe (original Chinese — timing, easing, parameter table, known pitfalls)
意图
渐变不是静态贴图而是可动画的参数集:同类型渐变内部任何参数都能插值出丝滑变化,跨类型则用短交叉淡化衔接。作背景层用,给"没有主体运动"的段落一层持续的低速能量。
动效核心
- 三层各持一种渐变类型,同一时刻只有一层主导,交叉淡化窗口很窄(0.08)
- linear 段(t=0–0.4):角度 40°→230°,两组色标在 HSL 空间三通道插值(
mixH对 h/s/l 分别 lerp)——比 RGB 插值不发灰 - radial 段(t=0.33–0.7):圆心 (28%,66%)→(72%,32%) 对角迁移 + 半径 45%→85% 扩张,暗色外圈近黑,光斑像在画面里游走
- conic 段(t=0.66–1):七段彩虹色环
from角 0→300° 旋转,首尾同色(hsl 0 出现两次)可无缝循环 - 中央玻璃 pill 标签实时显示当前类型(LINEAR/RADIAL/CONIC),demo 用;实用时删掉
参数表
| 参数 | 典型值 | 调节手感 | |------|--------|----------| | 段窗口重叠 | 相邻段起点比前段终点早 0.07 | 重叠保证淡化时两层都在动;无重叠会看到"接管瞬间静止" | | 交叉淡化 | 0.30–0.38 / 0.63–0.71,各 0.08 | 拉宽会同屏看到两种渐变结构打架;窄淡化 + 参数同动是"换类型不换气"的关键 | | HSL 插值 | h/s/l 三通道独立 lerp | 色相差 >180° 时会绕远路(如 340→160),需要短路径时给起点 +360 | | radial 迁移 | 中心对角走位 + 半径近倍扩 | 中心不动只扩半径会读作"呼吸"不是"游走" | | conic 旋转 | from 0→300°(不满一圈) | 转满 360° 收尾与开头同帧,接循环时用;单次播放留 60° 缺口避免"回到原点"感 | | 色标组 | 每段两组 HSL 起止 | 换项目色时保持"亮色+暗色"配对结构,radial 外圈必须暗(光斑成立的前提) |
已知坑
- 这是背景卡:前景放排版/UI 时把 label pill 删掉,并把整层 opacity 压到 0.6–0.8 或叠暗色 scrim,否则彩虹 conic 段会吃掉前景对比度
- CSS 渐变字符串每帧重写触发 repaint 而非 composite——大画幅 + 低端设备需实测;Remotion 服务端渲染无此顾虑
- conic 段的七段色环是"演出"性质,品牌化场景建议换成三色循环(A→B→C→A)
- 三段各自独立可拆用:只要 linear 段(0–0.4 重归一化到 0–1)就是一张"角度扫过"的极简底
参考实现
demos/transition/gradient-transition/ (GradientTransition.tsx)
Reference implementation (Remotion)
- demos/transition/gradient-transition/GradientTransition.tsx — https://raw.githubusercontent.com/Vincentwei1021/video-shotcraft/main/demos/transition/gradient-transition/GradientTransition.tsx
The component imports shared fixtures from demos/_fixtures and helpers from assets/lib in the repo; SKILL.md there documents the render workflow.
Tudo nesta página também é legível por máquina. Aponte seu agente para o JSON ou adicione o servidor MCP do gimgs e peça para buscar templates de motion.
- Baixe o JSON — contém a receita do plano (timing, easing, tabela de parâmetros, armadilhas) e o código TSX completo.
- Clone o repositório video-shotcraft; o componente importa fixtures de demos/_fixtures e helpers de assets/lib.
- Registre o componente como <Composition> em um projeto Remotion e renderize com `npx remotion render`, ou reimplemente a receita no seu próprio engine.
curl -s https://gimgs.net/motion/gradient-transition.jsongit clone https://github.com/Vincentwei1021/video-shotcraft
# component: demos/transition/gradient-transition/GradientTransition.tsx
npx remotion render <CompositionId> out.mp4claude mcp add --transport http gimgs https://gimgs.net/mcp
# then: search_motion_templates / get_motion_template("gradient-transition")Prompt
Use the video-shotcraft shot recipe "Gradient transition" (Remotion composition, Apache-2.0) published on gimgs.net. Recipe JSON (prompt = timing/easing/parameter table/pitfalls, files = TSX source): https://gimgs.net/motion/gradient-transition.json Raw TSX: https://gimgs.net/motion/gradient-transition/template.html Repository: https://github.com/Vincentwei1021/video-shotcraft (component: demos/transition/gradient-transition/GradientTransition.tsx; imports demos/_fixtures and assets/lib) Spec: 1920x1080, 30 fps, 6.5s 1. Read the JSON and follow its "prompt" section (when to use, intention, parameter table, known pitfalls). 2. Adapt it for: <describe what you want>. 3. Either clone the repo, register the component as a <Composition> in a Remotion project and run npx remotion render <CompositionId> out.mp4 — or re-implement the recipe in your own engine (HTML/WAAPI works: keep the same timing and easing).
// ===== demos/transition/gradient-transition/GradientTransition.tsx =====
// gradient-transition — Gradient Transition 渐变过渡(motion-lab 定稿转原生 Remotion)
// 背景在三类 CSS 渐变之间平滑过渡:linear 段插值角度+色标,radial 段插值中心+半径,
// conic 段旋转彩虹;等价"解析 gradient 字符串逐参数插值"的配方,中央 pill 标注当前段。
// 设计坐标 480×270(DesignStage 等比放大),参数表数值以此坐标系标定。
import React from 'react';
import { DesignStage, E, lerp, seg, useT } from '../../_fixtures/Motion';
export const GRADIENT_TRANSITION_DURATION = 180; // 6000ms @30fps
const hsl = (h: number, s: number, l: number) => `hsl(${h},${s}%,${l}%)`;
type H3 = [number, number, number];
// hsl 三元组按分量插值
const mixH = (a: H3, b: H3, k: number): H3 => [lerp(k, a[0], b[0]), lerp(k, a[1], b[1]), lerp(k, a[2], b[2])];
const layerStyle = (background: string, opacity: number): React.CSSProperties => ({
position: 'absolute',
inset: 0,
background,
opacity,
});
export const GradientTransition: React.FC = () => {
const t = useT();
// Phase 1: linear —— 角度 40°→230°,两组色标 hsl 插值
const p1 = seg(t, 0, 0.4, E.inOutQuad);
const ang = lerp(p1, 40, 230);
const l1c1 = mixH([340, 88, 60], [160, 78, 52], p1);
const l1c2 = mixH([265, 80, 52], [205, 92, 58], p1);
const bg1 = `linear-gradient(${ang}deg, ${hsl(...l1c1)}, ${hsl(...l1c2)})`;
// Phase 2: radial —— 中心 (28%,66%)→(72%,32%),半径 45%→85%
const p2 = seg(t, 0.33, 0.7, E.inOutQuad);
const cx = lerp(p2, 28, 72), cy = lerp(p2, 66, 32), rr = lerp(p2, 45, 85);
const l2c1 = mixH([45, 95, 62], [285, 85, 58], p2);
const l2c2 = mixH([220, 60, 14], [230, 55, 10], p2);
const bg2 = `radial-gradient(circle ${rr}% at ${cx}% ${cy}%, ${hsl(...l2c1)}, ${hsl(...l2c2)})`;
// Phase 3: conic —— from 角度旋转的彩虹环(首尾同色可无缝循环)
const p3 = seg(t, 0.66, 1, E.inOutQuad);
const from = p3 * 300;
const bg3 = `conic-gradient(from ${from}deg at 50% 50%,
hsl(0,85%,60%), hsl(60,85%,60%), hsl(120,75%,55%), hsl(180,80%,55%),
hsl(240,85%,62%), hsl(300,85%,60%), hsl(0,85%,60%))`;
return (
<DesignStage bg="#0a0b10">
{/* 三层渐变依次交叉淡入淡出 */}
<div style={layerStyle(bg1, 1 - seg(t, 0.3, 0.38))} />
<div style={layerStyle(bg2, seg(t, 0.3, 0.38) - seg(t, 0.63, 0.71))} />
<div style={layerStyle(bg3, seg(t, 0.63, 0.71))} />
{/* 中央 pill:标注当前渐变类型 */}
<div
style={{
position: 'absolute',
left: '50%',
top: '50%',
transform: 'translate(-50%,-50%)',
padding: '6px 18px',
borderRadius: 999,
background: 'rgba(8,9,14,.55)',
color: '#fff',
fontFamily: '-apple-system,system-ui,sans-serif',
fontSize: 13,
letterSpacing: 4,
fontWeight: 700,
backdropFilter: 'blur(4px)',
}}
>
{t < 0.34 ? 'LINEAR' : t < 0.67 ? 'RADIAL' : 'CONIC'}
</div>
</DesignStage>
);
};
- Read the recipePrompt = when to use, intention, parameter table with typical values and how each one feels, known pitfalls. Treat values as calibrated starting points.
- Get the codetool: git
git clone https://github.com/Vincentwei1021/video-shotcraft && cd video-shotcraft && npm install - Register + rendertool: remotion
npx remotion render <CompositionId> out.mp4 # component: demos/transition/gradient-transition/GradientTransition.tsx - Or re-implementPort the timing/easing from the recipe to HTML + WAAPI (gimgs motion contract) or any engine; keep the same segment windows and easing.
| param | type | default | description |
|---|---|---|---|
| — | |||
Mais nesta categoria

White flash: logo simplifies
A colorful liquid-gradient wordmark holds with flowing light, then the frame flashes white and overexposes; a flat wordmark fades in on white and settles — one flash completes the downgrade to simplicity.

Geometric wipe transitions
Two geometric wipe transitions — clock-wipe, a radar-hand sweep changing the page, and blinds-slice, 12 vertical strips flipping in staggered waves.

Hidden-cut transitions
Three hidden-cut transitions — foreground occlusion invisible cut, versus-slam opener, and warm light-leak burn; the hard cut hides inside 1-3 frames of occlusion/impact/light peak, so the viewer never sees the scissors.

Travel-through transitions
Two travel-through transitions — shared-element homecoming and letter-cavity pass-through; the camera drills through a real element inside the frame to complete the scene change.