All files / src/components/scenes HookScene.tsx

11.11% Statements 1/9
0% Branches 0/1
0% Functions 0/1
11.11% Lines 1/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179                                        1x                                                                                                                                                                                                                                                                                                                            
import React from "react";
import {
  AbsoluteFill,
  useCurrentFrame,
  useVideoConfig,
  spring,
  interpolate,
} from "remotion";
 
interface HookSceneProps {
  skillName: string;
  hook: string;
  ccVersion: string;
  primaryColor: string;
  stats?: {
    skills?: number;
    agents?: number;
  };
}
 
export const HookScene: React.FC<HookSceneProps> = ({
  skillName,
  hook,
  ccVersion,
  primaryColor,
  stats = { skills: 169, agents: 35 },
}) => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();
 
  // Animations
  const badgeScale = spring({
    frame,
    fps,
    config: { damping: 80, stiffness: 300 },
  });
 
  const skillNameScale = spring({
    frame: Math.max(0, frame - 5),
    fps,
    config: { damping: 80, stiffness: 250 },
  });
 
  const hookScale = spring({
    frame: Math.max(0, frame - 12),
    fps,
    config: { damping: 80, stiffness: 200 },
  });
 
  const statsOpacity = interpolate(frame, [20, 30], [0, 1], {
    extrapolateRight: "clamp",
  });
 
  // Subtle background pulse
  const bgPulse = 1 + Math.sin(frame * 0.05) * 0.02;
 
  return (
    <AbsoluteFill
      style={{
        justifyContent: "center",
        alignItems: "center",
        backgroundColor: "#0a0a0f",
        overflow: "hidden",
      }}
    >
      {/* Radial gradient background */}
      <AbsoluteFill
        style={{
          background: `radial-gradient(ellipse at center, ${primaryColor}15 0%, transparent 70%)`,
          transform: `scale(${bgPulse})`,
        }}
      />
 
      {/* Content */}
      <div
        style={{
          display: "flex",
          flexDirection: "column",
          alignItems: "center",
          gap: 16,
          textAlign: "center",
        }}
      >
        {/* CC Version Badge */}
        <div
          style={{
            transform: `scale(${badgeScale})`,
            opacity: Math.min(1, frame / 10),
          }}
        >
          <div
            style={{
              fontSize: 13,
              color: "#6b7280",
              fontFamily: "Menlo, monospace",
              letterSpacing: "0.15em",
              textTransform: "uppercase",
              padding: "6px 16px",
              backgroundColor: "rgba(255,255,255,0.05)",
              borderRadius: 20,
              border: "1px solid rgba(255,255,255,0.1)",
            }}
          >
            {ccVersion} ALIGNED
          </div>
        </div>
 
        {/* Skill Name */}
        <div
          style={{
            transform: `scale(${skillNameScale})`,
            opacity: Math.min(1, (frame - 5) / 10),
          }}
        >
          <code
            style={{
              fontSize: 56,
              color: primaryColor,
              fontFamily: "Menlo, monospace",
              fontWeight: 700,
              textShadow: `0 0 40px ${primaryColor}50`,
            }}
          >
            /{skillName}
          </code>
        </div>
 
        {/* Hook Text */}
        <div
          style={{
            transform: `scale(${hookScale})`,
            opacity: Math.min(1, (frame - 12) / 10),
          }}
        >
          <h1
            style={{
              fontSize: 52,
              color: "white",
              fontFamily: "Inter, system-ui",
              fontWeight: 700,
              maxWidth: 900,
              lineHeight: 1.2,
              margin: 0,
            }}
          >
            {hook}
          </h1>
        </div>
 
        {/* Stats Badge */}
        <div
          style={{
            opacity: statsOpacity,
            marginTop: 20,
          }}
        >
          <div
            style={{
              display: "flex",
              gap: 24,
              fontSize: 14,
              color: "#9ca3af",
              fontFamily: "Menlo, monospace",
            }}
          >
            <span>
              <span style={{ color: primaryColor }}>{stats.skills}</span> skills
            </span>
            <span style={{ color: "#4b5563" }}>*</span>
            <span>
              <span style={{ color: primaryColor }}>{stats.agents}</span> agents
            </span>
          </div>
        </div>
      </div>
    </AbsoluteFill>
  );
};