Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 9 additions & 128 deletions remotion/compositions/DriftReadmeDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {CSSProperties} from 'react';

import {Easing, AbsoluteFill, interpolate, spring, useCurrentFrame, useVideoConfig} from 'remotion';

import {DemoBackground, FooterStats} from './DriftReadmeDemoParts';
import {ACTIVE_STAGE_SCALE, CommandFlowPanel, DemoBackground, FooterStats, StagePanel} from './DriftReadmeDemoParts';

const palette = {
bgA: '#050d1a',
Expand All @@ -25,50 +25,16 @@ const shellStyle: CSSProperties = {
backdropFilter: 'blur(14px)',
};

const commandRows = [
'$ npx @eduardbar/drift scan .',
'$ drift guard src --budget 3',
'$ drift trust src --json > trust.json',
];

const stages = [
{
phase: 'Stage 01',
name: 'Scan',
text: 'Parse boundaries and dependencies with AST-level context.',
accent: palette.blue,
},
{
phase: 'Stage 02',
name: 'Evaluate',
text: 'Compare delta risk against baseline trust and budget.',
accent: palette.mint,
},
{
phase: 'Stage 03',
name: 'Gate',
text: 'Enforce merge policy with deterministic trust checks.',
accent: palette.violet,
},
];

const BODY_START_FRAME = 10;
const FOOTER_START_FRAME = 34;
const OUTRO_FADE_START_OFFSET_FRAMES = 14;
const SWEEP_START_FRAME = 12;
const SWEEP_EDGE_OFFSET_PX = 220;
const PULSE_PERIOD_FRAMES = 14;
const COMMAND_REVEAL_START_FRAME = 18;
const COMMAND_REVEAL_STAGGER_FRAMES = 10;
const COMMAND_REVEAL_DURATION_FRAMES = 8;
const COMMAND_REVEAL_OFFSET_PX = 10;
const EVALUATE_STAGE_START_FRAME = 72;
const GATE_STAGE_START_FRAME = 108;
const PULSE_MIN_SCALE = 0.95;
const PULSE_MAX_SCALE = 1.07;
const TITLE_INITIAL_OFFSET_PX = 36;
const BODY_INITIAL_OFFSET_PX = 28;
const ACTIVE_STAGE_SCALE = 1.02;

export const DriftReadmeDemo = () => {
const frame = useCurrentFrame();
Expand Down Expand Up @@ -110,8 +76,6 @@ export const DriftReadmeDemo = () => {
});

const pulse = interpolate(Math.sin(frame / PULSE_PERIOD_FRAMES), [-1, 1], [PULSE_MIN_SCALE, PULSE_MAX_SCALE]);
const activeStage = frame < EVALUATE_STAGE_START_FRAME ? 0 : frame < GATE_STAGE_START_FRAME ? 1 : 2;

return (
<AbsoluteFill
style={{
Expand Down Expand Up @@ -180,97 +144,14 @@ export const DriftReadmeDemo = () => {
minHeight: 0,
}}
>
<div
style={{
...shellStyle,
padding: '20px 22px',
display: 'grid',
alignContent: 'start',
gap: 12,
}}
>
<div
style={{
fontFamily: 'IBM Plex Mono, ui-monospace, SFMono-Regular, Menlo, monospace',
fontSize: 13,
letterSpacing: 1,
textTransform: 'uppercase',
color: palette.muted,
}}
>
Typical PR check flow
</div>
{commandRows.map((line, index) => {
const start = COMMAND_REVEAL_START_FRAME + index * COMMAND_REVEAL_STAGGER_FRAMES;
const reveal = interpolate(frame, [start, start + COMMAND_REVEAL_DURATION_FRAMES], [0, 1], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
});
return (
<div
key={line}
style={{
borderRadius: 14,
border: `1px solid ${palette.line}`,
background: 'rgba(8, 20, 40, 0.72)',
padding: '12px 14px',
opacity: reveal,
transform: `translateY(${(1 - reveal) * COMMAND_REVEAL_OFFSET_PX}px)`,
fontFamily: 'IBM Plex Mono, ui-monospace, SFMono-Regular, Menlo, monospace',
fontSize: 15,
color: '#d7eaff',
}}
>
{line}
</div>
);
})}
</div>

<div
style={{
...shellStyle,
padding: '16px 16px 14px',
display: 'grid',
alignContent: 'start',
gap: 10,
}}
>
{stages.map((stage, index) => {
const isActive = index === activeStage;
return (
<div
key={stage.name}
style={{
borderRadius: 16,
border: `1px solid ${isActive ? stage.accent : palette.line}`,
background: isActive
? `linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)), radial-gradient(circle at 100% 0%, ${stage.accent}33, transparent 60%)`
: 'rgba(7, 19, 38, 0.64)',
padding: '10px 12px',
boxShadow: isActive ? `0 12px 24px ${stage.accent}22` : 'none',
transform: `translateY(${isActive ? -2 : 0}px) scale(${isActive ? ACTIVE_STAGE_SCALE : 1})`,
}}
>
<div
style={{
fontFamily: 'IBM Plex Mono, ui-monospace, SFMono-Regular, Menlo, monospace',
fontSize: 11,
letterSpacing: 1,
textTransform: 'uppercase',
color: stage.accent,
}}
>
{stage.phase}
</div>
<div style={{marginTop: 3, fontSize: 23, fontWeight: 700}}>{stage.name}</div>
<div style={{marginTop: 3, fontSize: 14, lineHeight: 1.35, color: palette.muted}}>
{stage.text}
</div>
</div>
);
})}
</div>
<CommandFlowPanel frame={frame} lineColor={palette.line} mutedColor={palette.muted} shellStyle={shellStyle} />
<StagePanel
frame={frame}
activeScale={ACTIVE_STAGE_SCALE}
lineColor={palette.line}
mutedColor={palette.muted}
shellStyle={shellStyle}
/>
</div>

<FooterStats mutedColor={palette.muted} opacity={footerOpacity} shellStyle={shellStyle} />
Expand Down
152 changes: 151 additions & 1 deletion remotion/compositions/DriftReadmeDemoParts.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
import type {CSSProperties, ReactNode} from 'react';

import {AbsoluteFill} from 'remotion';
import {AbsoluteFill, interpolate} from 'remotion';

const COMMAND_REVEAL_START_FRAME = 18;
const COMMAND_REVEAL_STAGGER_FRAMES = 10;
const COMMAND_REVEAL_DURATION_FRAMES = 8;
const COMMAND_REVEAL_OFFSET_PX = 10;
const EVALUATE_STAGE_START_FRAME = 72;
const GATE_STAGE_START_FRAME = 108;
export const ACTIVE_STAGE_SCALE = 1.02;

const commandRows = [
'$ npx @eduardbar/drift scan .',
'$ drift guard src --budget 3',
'$ drift trust src --json > trust.json',
];

const stages = [
{
phase: 'Stage 01',
name: 'Scan',
text: 'Parse boundaries and dependencies with AST-level context.',
accent: '#67a7ff',
},
{
phase: 'Stage 02',
name: 'Evaluate',
text: 'Compare delta risk against baseline trust and budget.',
accent: '#46d9b0',
},
{
phase: 'Stage 03',
name: 'Gate',
text: 'Enforce merge policy with deterministic trust checks.',
accent: '#8a7dff',
},
];

const GRID_INSET_PX = 120;
const GLOW_TOP_OFFSET_PX = 120;
Expand Down Expand Up @@ -79,3 +114,118 @@ export const FooterStats = ({mutedColor, opacity, shellStyle}: FooterStatsProps)
</div>
);
};

type CommandFlowPanelProps = {
frame: number;
lineColor: string;
mutedColor: string;
shellStyle: CSSProperties;
};

export const CommandFlowPanel = ({frame, lineColor, mutedColor, shellStyle}: CommandFlowPanelProps): ReactNode => {
return (
<div
style={{
...shellStyle,
padding: '20px 22px',
display: 'grid',
alignContent: 'start',
gap: 12,
}}
>
<div
style={{
fontFamily: 'IBM Plex Mono, ui-monospace, SFMono-Regular, Menlo, monospace',
fontSize: 13,
letterSpacing: 1,
textTransform: 'uppercase',
color: mutedColor,
}}
>
Typical PR check flow
</div>
{commandRows.map((line, index) => {
const start = COMMAND_REVEAL_START_FRAME + index * COMMAND_REVEAL_STAGGER_FRAMES;
const reveal = interpolate(frame, [start, start + COMMAND_REVEAL_DURATION_FRAMES], [0, 1], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
});
return (
<div
key={line}
style={{
borderRadius: 14,
border: `1px solid ${lineColor}`,
background: 'rgba(8, 20, 40, 0.72)',
padding: '12px 14px',
opacity: reveal,
transform: `translateY(${(1 - reveal) * COMMAND_REVEAL_OFFSET_PX}px)`,
fontFamily: 'IBM Plex Mono, ui-monospace, SFMono-Regular, Menlo, monospace',
fontSize: 15,
color: '#d7eaff',
}}
>
{line}
</div>
);
})}
</div>
);
};

type StagePanelProps = {
frame: number;
activeScale: number;
lineColor: string;
mutedColor: string;
shellStyle: CSSProperties;
};

export const StagePanel = ({frame, activeScale, lineColor, mutedColor, shellStyle}: StagePanelProps): ReactNode => {
const activeStage = frame < EVALUATE_STAGE_START_FRAME ? 0 : frame < GATE_STAGE_START_FRAME ? 1 : 2;

return (
<div
style={{
...shellStyle,
padding: '16px 16px 14px',
display: 'grid',
alignContent: 'start',
gap: 10,
}}
>
{stages.map((stage, index) => {
const isActive = index === activeStage;
return (
<div
key={stage.name}
style={{
borderRadius: 16,
border: `1px solid ${isActive ? stage.accent : lineColor}`,
background: isActive
? `linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)), radial-gradient(circle at 100% 0%, ${stage.accent}33, transparent 60%)`
: 'rgba(7, 19, 38, 0.64)',
padding: '10px 12px',
boxShadow: isActive ? `0 12px 24px ${stage.accent}22` : 'none',
transform: `translateY(${isActive ? -2 : 0}px) scale(${isActive ? activeScale : 1})`,
}}
>
<div
style={{
fontFamily: 'IBM Plex Mono, ui-monospace, SFMono-Regular, Menlo, monospace',
fontSize: 11,
letterSpacing: 1,
textTransform: 'uppercase',
color: stage.accent,
}}
>
{stage.phase}
</div>
<div style={{marginTop: 3, fontSize: 23, fontWeight: 700}}>{stage.name}</div>
<div style={{marginTop: 3, fontSize: 14, lineHeight: 1.35, color: mutedColor}}>{stage.text}</div>
</div>
);
})}
</div>
);
};
Loading
Loading