import React from 'react'; import { spring, useCurrentFrame, useVideoConfig } from 'remotion'; /** * Pixel-accurate iPhone 17 Pro frame. * * Dimensions based on iPhone 16 Pro (same form factor): * - Screen: 393×852 CSS points (2622×1206 @3x) * - Corner radius: 55px (device), 50px (screen inner) * - Bezel: ~3.5px (thinnest in any iPhone) * - Dynamic Island: 126×37 pill, centered 13px from top * - Safe area: top 59px, bottom 34px (home indicator) * - Frame: natural titanium (#8a8a8e border) */ type IPhone17ProFrameProps = { children: React.ReactNode; /** Disable the spring entrance animation */ noAnimation?: boolean; }; // Device dimensions (CSS points) const SCREEN_W = 393; const SCREEN_H = 852; const BEZEL = 4; const DEVICE_W = SCREEN_W + BEZEL * 2; // 401 const DEVICE_H = SCREEN_H + BEZEL * 2; // 860 const DEVICE_RADIUS = 55; const SCREEN_RADIUS = 50; // Dynamic Island const DI_W = 126; const DI_H = 37; const DI_TOP = 13; // from top of screen const DI_RADIUS = DI_H / 2; // pill shape export { SCREEN_W, SCREEN_H }; export const IPhone17ProFrame: React.FC = ({ children, noAnimation }) => { const frame = useCurrentFrame(); const { fps } = useVideoConfig(); const scale = noAnimation ? 1 : spring({ frame, fps, config: { damping: 15, stiffness: 80 } }); return (
{/* Titanium frame (outer body) */}
{/* Side button (right) — power */}
{/* Side buttons (left) — volume up, down, action */}
{/* Screen */}
{/* App content */} {children} {/* Dynamic Island (on top of everything) */}
{/* Home indicator */}
); };