Files
Codeman/scripts/remotion/components/PhoneFrame.tsx
T
arkonandClaude Opus 4.6 7101e64800 refactor: restructure repo for cleaner GitHub landing page
Reduce visible top-level items from 21 to 14:
- Untrack test-results/, tmp/, public symlink (added to .gitignore)
- Move agent-teams/ → docs/agent-teams/
- Move mobile-test/ → test/mobile/
- Move tools/remotion/ → scripts/remotion/
- Move eslint.config.js, vitest.config.ts → config/

All path references updated across CLAUDE.md, package.json,
.prettierignore, vitest configs, and capture scripts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:23:54 +02:00

86 lines
1.8 KiB
TypeScript

import React from 'react';
import { spring, useCurrentFrame, useVideoConfig } from 'remotion';
import { colors } from '../lib/theme';
type PhoneFrameProps = {
children: React.ReactNode;
/** Width of the phone viewport */
width?: number;
/** Height of the phone viewport */
height?: number;
};
export const PhoneFrame: React.FC<PhoneFrameProps> = ({
children,
width = 375,
height = 812,
}) => {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
// Scale-in animation
const scale = spring({
frame,
fps,
config: { damping: 15, stiffness: 80 },
});
const bezelW = width + 24;
const bezelH = height + 24;
return (
<div
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: '100%',
transform: `scale(${scale})`,
}}
>
<div
style={{
width: bezelW,
height: bezelH,
borderRadius: 44,
background: '#1a1a1a',
border: '2px solid #333',
padding: 12,
position: 'relative',
boxShadow: '0 20px 60px rgba(0,0,0,0.6)',
}}
>
{/* Notch / Dynamic Island */}
<div
style={{
position: 'absolute',
top: 10,
left: '50%',
transform: 'translateX(-50%)',
width: 120,
height: 28,
borderRadius: 14,
background: '#000',
zIndex: 20,
}}
/>
{/* Screen content */}
<div
style={{
width,
height,
borderRadius: 32,
overflow: 'hidden',
background: colors.bg.dark,
position: 'relative',
}}
>
{children}
</div>
</div>
</div>
);
};