-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy patharcade.tsx
More file actions
42 lines (41 loc) · 1007 Bytes
/
arcade.tsx
File metadata and controls
42 lines (41 loc) · 1007 Bytes
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
type ArcadeProps = {
src: string;
/** Constrains the embed width (for example `640px` or `55%`). Defaults to full width of the content column. */
width?: string;
};
export function Arcade({src, width}: ArcadeProps) {
return (
<div
style={{
maxWidth: '100%',
width: width ?? '100%',
}}
>
{/* Inner wrapper: % padding is relative to outer width so aspect ratio matches narrow embeds. */}
<div
style={{
height: '0px',
paddingBottom: 'calc(56.8359% + 41px)',
position: 'relative',
width: '100%',
}}
>
<iframe
src={src}
loading="lazy"
allowFullScreen
allow="fullscreen;"
style={{
border: 'none',
colorScheme: 'light',
height: '100%',
left: '0px',
position: 'absolute',
top: '0px',
width: '100%',
}}
/>
</div>
</div>
);
}