Skip to content

Commit 219cf4a

Browse files
committed
feat: add download video to the about page; closes #66
1 parent ff2cd95 commit 219cf4a

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

src/pages/AboutPage.tsx

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ const AboutPage: React.FC = () => {
3131
video: "preview_video.mp4",
3232
ref: previewVideoRef,
3333
},
34-
{
35-
src: "download.png",
36-
alt: "download icon",
37-
tip: "Download tutotial video",
38-
video: "download_video.mp4",
39-
ref: downloadVideoRef,
40-
},
4134
{
4235
src: "api.png",
4336
alt: "api icon",
4437
tip: "Rest API - Python tutotial video",
4538
video: "python_api_video.mp4",
4639
ref: apiVideoRef,
4740
},
41+
{
42+
src: "download.png",
43+
alt: "download icon",
44+
tip: "Download tutotial video",
45+
video: "download_video.mp4",
46+
ref: downloadVideoRef,
47+
},
4848
];
4949

5050
const TutorialVideoItem = ({
@@ -165,7 +165,7 @@ const AboutPage: React.FC = () => {
165165
style={{ maxHeight: "500px", objectFit: "cover" }}
166166
>
167167
<source
168-
src="https://neurojson.io/io/download/static/videos/introduction_video.mp4"
168+
src="https://neurojson.io/io/download/static/videos/introduction.mp4"
169169
type="video/mp4"
170170
/>
171171
Your browser does not support the video tag.
@@ -210,9 +210,17 @@ const AboutPage: React.FC = () => {
210210
component="img"
211211
src={`${process.env.PUBLIC_URL}/img/about_page/${src}`}
212212
alt={alt}
213-
onClick={() =>
214-
ref?.current?.scrollIntoView({ behavior: "smooth" })
215-
}
213+
// onClick={() =>
214+
// ref?.current?.scrollIntoView({ behavior: "smooth" })
215+
216+
// }
217+
onClick={() => {
218+
if (ref?.current) {
219+
const offset = 80; // adjust this to match your fixed navbar height
220+
const top = ref.current.offsetTop - offset;
221+
window.scrollTo({ top, behavior: "smooth" });
222+
}
223+
}}
216224
sx={{
217225
width: {
218226
xs: "25%",
@@ -264,28 +272,28 @@ const AboutPage: React.FC = () => {
264272
<Grid item xs={12} sm={6} ref={previewVideoRef}>
265273
<TutorialVideoItem
266274
title="Preview tutorial"
267-
videoUrl="https://neurojson.io/io/download/static/videos/preview_video.mp4"
275+
videoUrl="https://neurojson.io/io/download/static/videos/preview.mp4"
268276
/>
269277
</Grid>
270278

271-
<Grid item xs={12} sm={4} ref={downloadVideoRef}>
279+
<Grid item xs={12} sm={6} ref={apiVideoRef}>
272280
<TutorialVideoItem
273-
title="Download tutorial"
274-
videoUrl="https://neurojson.io/io/download/static/videos/search_video.mp4"
281+
title="Rest API - Python tutorial"
282+
videoUrl="https://neurojson.io/io/download/static/videos/python_api.mp4"
275283
/>
276284
</Grid>
277285

278-
<Grid item xs={12} sm={4} ref={apiVideoRef}>
286+
<Grid item xs={12} sm={6}>
279287
<TutorialVideoItem
280-
title="Rest API - Python tutorial"
281-
videoUrl="https://neurojson.io/io/download/static/videos/search_video.mp4"
288+
title="Rest API - Matlab tutorial"
289+
videoUrl="https://neurojson.io/io/download/static/videos/matlab_api.mp4"
282290
/>
283291
</Grid>
284292

285-
<Grid item xs={12} sm={4}>
293+
<Grid item xs={12} sm={6} ref={downloadVideoRef}>
286294
<TutorialVideoItem
287-
title="Rest API - Matlab tutorial"
288-
videoUrl="https://neurojson.io/io/download/static/videos/matlab_api.mp4"
295+
title="Download tutorial"
296+
videoUrl="https://neurojson.io/io/download/static/videos/download.mp4"
289297
/>
290298
</Grid>
291299
</Grid>

0 commit comments

Comments
 (0)