mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
* add project setup * add tools to eslint * remove contributing.md * update claude md * chore: simplify CI to single Node.js version (22) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * use node 20 * adjust formatting * fix linting * format * fix layout * fix: align CI node version to .nvmrc (22), remove redundant gotcha Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: arkon <arkon.85@hotmail.com>
86 lines
1.8 KiB
TypeScript
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>
|
|
);
|
|
};
|