Skip to content

Commit 42f30c7

Browse files
authored
Merge pull request #72 from oslabs-beta/austin-vimeo
feat: embedded Vimeo players in the DemoCard.tsx component of splash site
2 parents 10d0cf3 + 482df3a commit 42f30c7

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

mlflow-site/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12+
"next": "14.2.15",
1213
"react": "^18",
13-
"react-dom": "^18",
14-
"next": "14.2.15"
14+
"react-dom": "^18"
1515
},
1616
"devDependencies": {
17-
"typescript": "^5",
1817
"@types/node": "^20",
1918
"@types/react": "^18",
2019
"@types/react-dom": "^18",
20+
"eslint": "^8",
21+
"eslint-config-next": "14.2.15",
2122
"postcss": "^8",
2223
"tailwindcss": "^3.4.1",
23-
"eslint": "^8",
24-
"eslint-config-next": "14.2.15"
24+
"typescript": "^5"
2525
}
2626
}

mlflow-site/src/app/components/Demo.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ const Demo = () => {
1212
'Description for what\'s happening in Demo 2. This block of text will contain all the info needed to understand the demo.',
1313
'Description for what\'s happening in Demo 3. This block of text will contain all the info needed to understand the demo.'
1414
];
15+
const demoCardVideos = [
16+
"https://player.vimeo.com/video/1022732764",
17+
"https://player.vimeo.com/video/1022732772",
18+
];
1519
for (let i = 0; i < 3; i++) {
1620
demos.push(
1721
<DemoCard
1822
key={`demoCard${i}`}
1923
header={demoCardHeaders[i]}
2024
blurb={demoCardBlurbs[i]}
25+
video={demoCardVideos[i]}
2126
/>
2227
);
2328
}

mlflow-site/src/app/components/DemoCard.tsx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1-
import Image from 'next/image';
2-
31
const DemoCard = ({
42
header,
53
blurb,
4+
video
65
}: {
76
key: string;
87
blurb: string;
98
header: string;
9+
video: string;
1010
}) => {
1111
return (
12-
<div className='demoCard'>
13-
<Image
14-
src='https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExaW9tcWttZ3R0YTVpNWxwcGJ4M2YyZ2ExcmxlazN5N3JyenF0ajl4dCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/FqdGGgugkC4Xm/giphy.gif'
15-
alt=''
16-
width={700}
17-
height={475}
18-
sizes='100vw'
19-
style={{
20-
width: '100%',
21-
height: 'auto',
22-
}}
23-
/>
24-
<div className='demoCardText'>
25-
<div className='demoCardHeader'>{header}</div>
26-
<div className='demoCardInfo'>{blurb}</div>
12+
<div className="demoCard">
13+
<div style={{ padding: '56.25% 0 0 0', position: 'relative' }}>
14+
<iframe
15+
src={video}
16+
style={{
17+
position: 'absolute',
18+
top: 0,
19+
left: 0,
20+
width: '100%',
21+
height: '100%',
22+
}}
23+
allow="autoplay; fullscreen; picture-in-picture"
24+
allowFullScreen
25+
title="Vimeo Video Player"
26+
/>
27+
</div>
28+
<div className="demoCardText">
29+
<div className="demoCardHeader">{header}</div>
30+
<div className="demoCardInfo">{blurb}</div>
2731
</div>
2832
</div>
2933
);

0 commit comments

Comments
 (0)