Skip to content

Commit f263eed

Browse files
authored
fix: project card style (#66)
1 parent c4158f0 commit f263eed

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

apps/app/src/components/fragments/project-card/index.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ import { Link as GatsbyLink } from "gatsby";
44

55
import { styles } from "./styles";
66

7+
export interface MediaProps {
8+
title: string;
9+
url: string;
10+
}
11+
12+
export const Media = ({ title, url }: MediaProps) => {
13+
return (
14+
<mui.Box css={styles.media}>
15+
<iframe css={styles.mediaIframe} src={url} title={title} />
16+
</mui.Box>
17+
);
18+
};
19+
720
export interface ProjectCardProps {
821
description?: string;
922
onCopy?: () => void;
@@ -19,12 +32,7 @@ export const ProjectCard = ({
1932
}: ProjectCardProps) => {
2033
return (
2134
<mui.Card css={styles.root}>
22-
<mui.CardMedia
23-
component="iframe"
24-
css={styles.media}
25-
src={url}
26-
title={title}
27-
/>
35+
<mui.CardMedia component={Media} title={title} url={url} />
2836
<mui.Divider />
2937
<mui.CardContent css={styles.content}>
3038
<mui.Typography gutterBottom variant="h5">

apps/app/src/components/fragments/project-card/styles.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,23 @@ export const styles = {
1717
}),
1818

1919
media: (theme: AppTheme) =>
20+
css({
21+
height: theme.spacing(27),
22+
overflow: "hidden",
23+
pointerEvents: "none",
24+
position: "relative",
25+
width: theme.spacing(40),
26+
}),
27+
28+
mediaIframe: () =>
2029
css({
2130
border: 0,
22-
height: theme.spacing(300),
31+
height: "500%",
2332
overflow: "hidden",
2433
pointerEvents: "none",
25-
width: theme.spacing(400),
26-
zoom: 0.1,
34+
transform: "scale(0.2)",
35+
transformOrigin: "top left",
36+
width: "500%",
2737
}),
2838

2939
root: (theme: AppTheme) =>

0 commit comments

Comments
 (0)