Skip to content

Commit 6c23312

Browse files
committed
css: update about page videos layout; refs #66
1 parent 5f754f6 commit 6c23312

1 file changed

Lines changed: 105 additions & 38 deletions

File tree

src/pages/AboutPage.tsx

Lines changed: 105 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ import {
1010
import { Colors } from "design/theme";
1111
import React, { useRef } from "react";
1212

13-
const videoData = [
14-
{
15-
src: "search.png",
16-
alt: "search icon",
17-
tip: "Search tutotial video",
18-
video: "preview_video.mp4",
19-
// ref: searchVideoRef,
20-
},
21-
{ src: "preview.png", alt: "preview icon", tip: "Preview tutotial video" },
22-
{ src: "download.png", alt: "download icon", tip: "Download tutotial video" },
23-
{ src: "api.png", alt: "api icon", tip: "Restful API tutotial video" },
24-
];
13+
// const videoData = [
14+
// {
15+
// src: "search.png",
16+
// alt: "search icon",
17+
// tip: "Search tutotial video",
18+
// video: "preview_video.mp4",
19+
// // ref: searchVideoRef,
20+
// },
21+
// { src: "preview.png", alt: "preview icon", tip: "Preview tutotial video" },
22+
// { src: "download.png", alt: "download icon", tip: "Download tutotial video" },
23+
// { src: "api.png", alt: "api icon", tip: "Restful API tutotial video" },
24+
// ];
2525

2626
const AboutPage: React.FC = () => {
2727
const searchVideoRef = useRef<HTMLVideoElement | null>(null);
@@ -34,7 +34,7 @@ const AboutPage: React.FC = () => {
3434
src: "search.png",
3535
alt: "search icon",
3636
tip: "Search tutotial video",
37-
video: "preview_video.mp4",
37+
video: "search_video.mp4",
3838
ref: searchVideoRef,
3939
},
4040
{
@@ -48,18 +48,53 @@ const AboutPage: React.FC = () => {
4848
src: "download.png",
4949
alt: "download icon",
5050
tip: "Download tutotial video",
51-
video: "preview_video.mp4",
51+
video: "download_video.mp4",
5252
ref: downloadVideoRef,
5353
},
5454
{
5555
src: "api.png",
5656
alt: "api icon",
57-
tip: "Restful API tutotial video",
58-
video: "preview_video.mp4",
59-
ref: searchVideoRef,
57+
tip: "Rest API - Python tutotial video",
58+
video: "python_api_video.mp4",
59+
ref: apiVideoRef,
6060
},
6161
];
6262

63+
const TutorialVideoItem = ({
64+
title,
65+
videoUrl,
66+
}: {
67+
title: string;
68+
videoUrl: string;
69+
}) => (
70+
<Box
71+
sx={{
72+
mb: 6,
73+
boxShadow: 3,
74+
borderRadius: 2,
75+
overflow: "hidden",
76+
}}
77+
>
78+
<Typography
79+
variant="h6"
80+
sx={{
81+
mb: 1,
82+
color: Colors.darkPurple,
83+
fontWeight: "medium",
84+
}}
85+
>
86+
{title}
87+
</Typography>
88+
<video
89+
controls
90+
width="100%"
91+
style={{ maxHeight: "500px", objectFit: "cover" }}
92+
>
93+
<source src={videoUrl} type="video/mp4" />
94+
Your browser does not support the video tag.
95+
</video>
96+
</Box>
97+
);
6398
return (
6499
<Box
65100
// sx={{
@@ -147,7 +182,7 @@ const AboutPage: React.FC = () => {
147182
style={{ maxHeight: "500px", objectFit: "cover" }}
148183
>
149184
<source
150-
src="https://neurojson.io/video/introduction_video.mp4"
185+
src="https://neurojson.io/io/download/static/videos/introduction_video.mp4"
151186
type="video/mp4"
152187
/>
153188
Your browser does not support the video tag.
@@ -170,7 +205,24 @@ const AboutPage: React.FC = () => {
170205
}}
171206
>
172207
{videoData.map(({ src, alt, tip }) => (
173-
<Tooltip title={tip} arrow key={src}>
208+
<Tooltip
209+
title={tip}
210+
arrow
211+
key={src}
212+
componentsProps={{
213+
tooltip: {
214+
sx: {
215+
bgcolor: Colors.lightGray,
216+
color: Colors.darkPurple,
217+
},
218+
},
219+
arrow: {
220+
sx: {
221+
color: Colors.lightGray,
222+
},
223+
},
224+
}}
225+
>
174226
<Box
175227
component="img"
176228
src={`${process.env.PUBLIC_URL}/img/about_page/${src}`}
@@ -215,26 +267,41 @@ const AboutPage: React.FC = () => {
215267
>
216268
Getting Started with NeuroJSON
217269
</Typography>
218-
<Box
219-
sx={{
220-
mt: 4,
221-
boxShadow: 3,
222-
borderRadius: 2,
223-
overflow: "hidden",
224-
}}
225-
>
226-
<video
227-
controls
228-
width="100%"
229-
style={{ maxHeight: "500px", objectFit: "cover" }}
230-
>
231-
<source
232-
src="https://neurojson.io/video/preview_video.mp4"
233-
type="video/mp4"
270+
<Grid container spacing={5} sx={{ mt: 3 }}>
271+
<Grid item xs={12} sm={6}>
272+
<TutorialVideoItem
273+
title="Search tutorial"
274+
videoUrl="https://neurojson.io/io/download/static/videos/search_video.mp4"
275+
/>
276+
</Grid>
277+
278+
<Grid item xs={12} sm={6}>
279+
<TutorialVideoItem
280+
title="Preview tutorial"
281+
videoUrl="https://neurojson.io/io/download/static/videos/preview_video.mp4"
282+
/>
283+
</Grid>
284+
285+
<Grid item xs={12} sm={4}>
286+
<TutorialVideoItem
287+
title="Download tutorial"
288+
videoUrl="https://neurojson.io/io/download/static/videos/search_video.mp4"
289+
/>
290+
</Grid>
291+
292+
<Grid item xs={12} sm={4}>
293+
<TutorialVideoItem
294+
title="Rest API - Python tutorial"
295+
videoUrl="https://neurojson.io/io/download/static/videos/search_video.mp4"
234296
/>
235-
Your browser does not support the video tag.
236-
</video>
237-
</Box>
297+
</Grid>
298+
<Grid item xs={12} sm={4}>
299+
<TutorialVideoItem
300+
title="Rest API - Matlab tutorial"
301+
videoUrl="https://neurojson.io/io/download/static/videos/search_video.mp4"
302+
/>
303+
</Grid>
304+
</Grid>
238305
</Container>
239306
</Box>
240307
</Box>

0 commit comments

Comments
 (0)