Skip to content

Commit 4d1067d

Browse files
authored
feat: more rounded corners, updated buttons, footer centered, and new cover animation (#11)
1 parent 1960565 commit 4d1067d

File tree

5 files changed

+73
-20
lines changed

5 files changed

+73
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To edit the documentation sections or the tutorials section of the website:
2424

2525
All markdown files containing documentation details of the projects are in **docs/projects/** with the project's name marking the folder that contain's it's documentation
2626

27-
All markdown files containing tutorial details are in **docs/tutorials/** with the specific tutorial's name makring the folder that contain's it's files.
27+
All markdown files containing tutorial details are in **docs/tutorials/** with the specific tutorial's name marking the folder that contain's it's files.
2828

2929
All markdown files should follow Docusaurus's guidelines for folder structure for autogenerating the UI and pagination. More details are available at the [Docusaurus Docs](https://docusaurus.io/docs/sidebar/autogenerated).
3030

package-lock.json

Lines changed: 35 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"@emotion/react": "^11.11.4",
2222
"@emotion/styled": "^11.11.5",
2323
"@mdx-js/react": "^3.0.0",
24-
"@mui/material": "^5.15.20",
24+
"@mui/icons-material": "^5.15.21",
25+
"@mui/material": "^5.15.21",
2526
"animate.css": "^4.1.1",
2627
"clsx": "^2.0.0",
2728
"docusaurus": "^1.14.7",

src/css/custom.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ html[data-theme='dark'] .navbar__github {
5656
color: #fff;
5757
}
5858

59+
footer {
60+
align-items: center;
61+
text-align: center;
62+
border-radius: 16px 16px 0px 0px;
63+
}
64+
5965
.navbar__github:hover {
6066
background: var(--ifm-color-emphasis-200);
6167
}

src/pages/index.js

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
// React
3-
import React from 'react';
3+
import React, { useEffect, useState } from 'react';
44
import { Link as RouterLink } from 'react-router-dom';
55
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
66
import { useColorMode } from '@docusaurus/theme-common';
@@ -14,6 +14,8 @@ import Typography from '@mui/material/Typography';
1414
import Button from '@mui/material/Button';
1515
import Grid from '@mui/material/Unstable_Grid2';
1616
import Paper from '@mui/material/Paper';
17+
import SchoolIcon from '@mui/icons-material/School';
18+
import AutoStoriesIcon from '@mui/icons-material/AutoStories';
1719

1820
// Local
1921
import Layout from '@theme/Layout';
@@ -22,25 +24,39 @@ function HomepageHeader() {
2224
const { siteConfig } = useDocusaurusContext();
2325
const { colorMode } = useColorMode();
2426
const isDarkMode = colorMode === 'dark';
27+
28+
const [gradientAngle, setGradientAngle] = useState(0); // Initial gradient angle
29+
30+
useEffect(() => {
31+
const intervalId = setInterval(() => {
32+
setGradientAngle((prevAngle) => (prevAngle + 0.2));
33+
}, 30); // Change image every 15 seconds
34+
35+
return () => clearInterval(intervalId); // Cleanup interval on component unmount
36+
}, []);
2537

2638
return (
2739
<Box
2840
component="header"
2941
sx={{
30-
backgroundImage: `url('/img/logo_icon.png')`,
42+
// backgroundImage: `url(${images[currentImageIndex]})`,
43+
backgroundImage: isDarkMode ? `linear-gradient(${gradientAngle}deg, #534666, #CD7672)` : `linear-gradient(${gradientAngle}deg, #9dcbfc, white)`,
44+
borderRadius: '16px',
45+
filter: isDarkMode ? 'drop-shadow(0 0.4rem 0.3rem rgba(123, 123, 123, 0.5))' : 'drop-shadow(0 0.4rem 0.3rem rgba(0,0,0,0.5))',
46+
transition: 'background-image 0.5s ease', // smooth transition
3147
backgroundSize: 'cover',
3248
backgroundPosition: 'center',
3349
color: 'white',
3450
textAlign: 'center',
3551
py: 10,
36-
bgcolor: isDarkMode ? 'grey.900' : 'primary.main',
52+
// bgcolor: isDarkMode ? 'grey.900' : 'primary.main',
3753
}}
3854
>
3955
<Container maxWidth="md">
40-
<Typography variant="h1" component="h1" className="animate__animated animate__fadeInDown">
56+
<Typography variant="h1" component="h1" className="animate__animated animate__fadeInDown" color={isDarkMode ? 'white' : '#707070'}>
4157
{siteConfig.title}
4258
</Typography>
43-
<Typography variant="h5" component="p" sx={{ mt: 2 }} className="animate__animated animate__fadeInUp">
59+
<Typography variant="h5" component="p" sx={{ mt: 2 }} className="animate__animated animate__fadeInUp" color={isDarkMode ? 'white' : '#707070'}>
4460
{siteConfig.tagline}
4561
</Typography>
4662
<Stack
@@ -52,21 +68,23 @@ function HomepageHeader() {
5268
>
5369
<Button
5470
variant="contained"
55-
color="primary"
56-
size="large"
71+
size="large"z
5772
sx={{ mt: 4 }}
73+
color='primary'
5874
component={RouterLink}
5975
to="docs/tutorials/welcome"
76+
startIcon={<SchoolIcon/>}
6077
>
6178
Explore Tutorials
6279
</Button>
6380
<Button
64-
variant="outlined"
65-
color="primary"
81+
variant="contained"
6682
size="large"
67-
sx={{ mt: 2, ml: 2 }}
83+
sx={{ mt: 2, ml: 2, }}
84+
color='primary'
6885
component={RouterLink}
6986
to="docs/projects/welcome"
87+
endIcon={<AutoStoriesIcon/>}
7088
>
7189
View Projects
7290
</Button>
@@ -85,6 +103,7 @@ const PaperCard = ({ children, isDarkMode }) => (
85103
bgcolor: isDarkMode ? 'grey.800' : 'background.paper',
86104
color: isDarkMode ? 'white' : 'text.primary',
87105
height: '100%',
106+
borderRadius: '16px',
88107
}}
89108
>
90109
{children}

0 commit comments

Comments
 (0)