import React from "react"; import { AbsoluteFill, interpolate, spring, useCurrentFrame, useVideoConfig } from "remotion"; import { FONT } from "../../lib/fonts"; import { hexToRgba } from "../../lib/anim"; import { IgGlows, IgWordmark } from "./igkit"; import type { BlockProps, SceneBlock } from "../types"; const IGIntro: React.FC = ({ data, colors, L, durationInFrames }) => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); const out = interpolate(frame, [durationInFrames - 10, durationInFrames], [1, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }); const logo = spring({ frame, fps, config: { damping: 13, stiffness: 110 } }); const headSp = spring({ frame: frame - 8, fps, config: { damping: 16, stiffness: 110 } }); const subOp = interpolate(frame, [20, 36], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }); return (
{data.badge}
{data.headline}
{data.subtitle}
); }; export const IGIntroBlock: SceneBlock = { id: "IGIntro", label: "شروع (لوگوی اینستاگرام)", component: IGIntro, fields: [ { key: "badge", label: "نشان", type: "text", default: "اینستاگرام" }, { key: "headline", label: "تیتر", type: "text", default: "صفحهٔ ما را دنبال کنید" }, { key: "subtitle", label: "زیرعنوان", type: "text", default: "هر روز یک طرح تازه", multiline: true }, ], defaultDurationSec: 3, minDurationSec: 2, maxDurationSec: 5, };