// ===== demos/data/ring-diagram-annotation-reveal/RingDiagramAnnotationReveal.tsx =====
// ring-diagram-annotation-reveal — 全屏主体收束成同心环图解,再左移让出注释栏。
// 保留原 motion-blocking 的圆窗收缩、分段外环、向心箭头、旋转、错峰标签与收尾 hold。
import React from 'react';
import { Easing, interpolate, useCurrentFrame } from 'remotion';
import { DesignStage } from '../../_fixtures/Motion';
export const RING_DIAGRAM_ANNOTATION_REVEAL_DURATION = 190;
const CLAMP = { extrapolateLeft: 'clamp', extrapolateRight: 'clamp' } as const;
const p = (frame: number, start: number, end: number) =>
interpolate(frame, [start, Math.max(start + 1, end)], [0, 1], {
...CLAMP,
easing: Easing.bezier(0.16, 1, 0.3, 1),
});
const TitleBlock: React.FC<{ frame: number; start: number; shade: string; index: number }> = ({
frame,
start,
shade,
index,
}) => {
const k = p(frame, start, start + 8);
const echo = interpolate(frame, [start - 1, start, start + 2, start + 8], [0, 0.32, 0.32, 0], CLAMP);
return (
);
};
export const RingDiagramAnnotationReveal: React.FC = () => {
const frame = useCurrentFrame();
const aperture = p(frame, 11, 50);
const ringIn = p(frame, 18, 60);
const coilsIn = p(frame, 30, 50);
const arrowsIn = p(frame, 35, 50);
const layout = p(frame, 90, 134);
const label = p(frame, 114, 160);
const definition = p(frame, 137, 143);
const centerX = interpolate(layout, [0, 1], [240, 154]);
const scale = interpolate(layout, [0, 1], [1, 0.84]);
const rotate = interpolate(frame, [29, 187], [0, 44.2], CLAMP);
const apertureRadius = interpolate(aperture, [0, 1], [540, 61]);
const arrows = Array.from({ length: 12 }, (_, i) => {
const a = ((-90 + i * 30) * Math.PI) / 180;
const outer = 97;
const inner = 72;
return {
x1: 240 + Math.cos(a) * outer,
y1: 123 + Math.sin(a) * outer,
x2: 240 + Math.cos(a) * inner,
y2: 123 + Math.sin(a) * inner,
};
});
return (
CONTENT
SUBJECT
{['#59595c', '#69696c', '#858588', '#a7a7aa'].map((shade, i) => (
))}
EXPLANATION
SUPPORTING DETAIL
);
};