Skip to content

Commit

Permalink
Coursespace homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
hiriski committed May 3, 2022
1 parent 8d1218a commit 6dc2f2a
Show file tree
Hide file tree
Showing 90 changed files with 2,153 additions and 52 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"react": "18.0.0",
"react-dom": "18.0.0",
"react-scroll": "^1.8.7",
"react-slick": "^0.29.0"
"react-slick": "^0.29.0",
"slick-carousel": "^1.8.1"
},
"devDependencies": {
"@types/node": "17.0.25",
Expand Down
Binary file added public/images/avatars/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/avatars/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/avatars/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/avatars/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/avatars/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/certificate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/companies/airbnb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/companies/google.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/companies/grab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/companies/microsoft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions public/images/course-space-shape.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/headline-curve.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home-feature.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home-hero.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home-testimonial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/images/icons/dribbble.svg
1 change: 1 addition & 0 deletions public/images/icons/github.svg
1 change: 1 addition & 0 deletions public/images/icons/instagram.svg
1 change: 1 addition & 0 deletions public/images/icons/twitter.svg
1 change: 1 addition & 0 deletions public/images/icons/youtube.svg
Binary file added public/images/shape.png
78 changes: 78 additions & 0 deletions src/components/course/course-card-item.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import React, { FC } from 'react'
import Image from 'next/image'
import Box from '@mui/material/Box'
import Rating from '@mui/material/Rating'
import Typography from '@mui/material/Typography'
import IconButton, { iconButtonClasses } from '@mui/material/IconButton'
import ArrowForward from '@mui/icons-material/ArrowForward'
import { Course } from '@/interfaces/course'

interface Props {
item: Course
}

const CourseCardItem: FC<Props> = ({ item }) => {
return (
<Box
sx={{
px: 1,
py: 4,
}}
>
<Box
sx={{
p: 2,
backgroundColor: 'background.paper',
borderRadius: 4,
transition: (theme) => theme.transitions.create(['box-shadow']),
'&:hover': {
boxShadow: 2,
[`& .${iconButtonClasses.root}`]: {
backgroundColor: 'primary.main',
color: 'primary.contrastText',
boxShadow: 2,
},
},
}}
>
<Box
sx={{
lineHeight: 0,
overflow: 'hidden',
borderRadius: 3,
mb: 2,
}}
>
<Image src={item.cover} width={760} height={760} alt={'Course ' + item.id} />
</Box>
<Box sx={{ mb: 2 }}>
<Typography component="h2" variant="h5" sx={{ mb: 2, height: 56, overflow: 'hidden', fontSize: '1.2rem' }}>
{item.title}
</Typography>
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<Rating name="rating-course" value={item.rating} max={5} sx={{ color: '#ffce31', mr: 1 }} readOnly />
<Typography component="span" variant="h5">
({item.ratingCount})
</Typography>
</Box>
</Box>
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<Typography variant="h5" color="primary.main">
{'$' + item.price}
</Typography>
<Typography variant="h6">/ course</Typography>
</Box>
<IconButton
color="primary"
sx={{ '&:hover': { backgroundColor: 'primary.main', color: 'primary.contrastText' } }}
>
<ArrowForward />
</IconButton>
</Box>
</Box>
</Box>
)
}

export default CourseCardItem
1 change: 1 addition & 0 deletions src/components/course/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as CourseCardItem } from './course-card-item'
84 changes: 84 additions & 0 deletions src/components/footer/footer-navigation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import React, { FC } from 'react'
import Link from 'next/link'
import Grid from '@mui/material/Grid'
import MuiLink from '@mui/material/Link'
import type { Navigation } from '@/interfaces/navigation'
import { navigations as headerNavigations } from '@/components/navigation/navigation.data'
import { FooterSectionTitle } from '@/components/footer'

const courseMenu: Array<Navigation> = [
{
label: 'UI/UX Design',
path: '#',
},
{
label: 'Mobile Development',
path: '#',
},
{
label: 'Machine Learning',
path: '#',
},
{
label: 'Web Development',
path: '#',
},
]

const pageMenu = headerNavigations

const companyMenu: Array<Navigation> = [
{ label: 'Contact Us', path: '#' },
{ label: 'Privacy & Policy', path: '#' },
{ label: 'Term & Condition', path: '#' },
{ label: 'FAQ', path: '#' },
]

interface NavigationItemProps {
label: string
path: string
}

const NavigationItem: FC<NavigationItemProps> = ({ label, path }) => {
return (
<Link href={path} passHref>
<MuiLink
underline="hover"
sx={{
display: 'block',
mb: 1,
color: 'primary.contrastText',
}}
>
{label}
</MuiLink>
</Link>
)
}

const FooterNavigation: FC = () => {
return (
<Grid container spacing={2}>
<Grid item xs={12} md={4}>
<FooterSectionTitle title="Course" />
{courseMenu.map(({ label, path }, index) => (
<NavigationItem key={index + path} label={label} path={/* path */ '#'} />
))}
</Grid>
<Grid item xs={12} md={4}>
<FooterSectionTitle title="Menu" />
{pageMenu.map(({ label, path }, index) => (
<NavigationItem key={index + path} label={label} path={path} />
))}
</Grid>
<Grid item xs={12} md={4}>
<FooterSectionTitle title="About" />
{companyMenu.map(({ label, path }, index) => (
<NavigationItem key={index + path} label={label} path={path} />
))}
</Grid>
</Grid>
)
}

export default FooterNavigation
25 changes: 25 additions & 0 deletions src/components/footer/footer-section-title.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { FC } from 'react'
import Box from '@mui/material/Box'
import Typography from '@mui/material/Typography'

interface Props {
title: string
}

const FooterSectionTitle: FC<Props> = ({ title }: Props) => {
return (
<Box
sx={{
display: 'flex',
flexDirection: 'column',
mb: 2,
}}
>
<Typography component="p" variant="h5" sx={{ mb: 1, color: 'primary.contrastText', fontWeight: '700' }}>
{title}
</Typography>
</Box>
)
}

export default FooterSectionTitle
97 changes: 97 additions & 0 deletions src/components/footer/footer-social-links.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import React, { FC } from 'react'
import Box from '@mui/material/Box'
import Link from '@mui/material/Link'
import { SocialLink } from '@/interfaces/social-link'

export const socialLinks: SocialLink[] = [
{
name: 'Instagram',
link: '#',
icon: '/images/icons/instagram.svg',
},
{
name: 'YouTube',
link: '#',
icon: '/images/icons/youtube.svg',
},
{
name: 'Twitter',
link: '#',
icon: '/images/icons/twitter.svg',
},
{
name: 'Dribbble',
link: 'https://dribbble.com/shots/18114471-Coursespace-Online-Course-Landing-Page',
icon: '/images/icons/dribbble.svg',
},
{
name: 'Github',
link: 'https://github.com/hiriski/coursespace-landing-page',
icon: '/images/icons/github.svg',
},
]

interface SocialLinkItemProps {
item: SocialLink
}

const SocialLinkItem: FC<SocialLinkItemProps> = ({ item }) => (
<Box
component="li"
sx={{
display: 'inline-block',
color: 'primary.contrastText',
mr: 0.5,
}}
>
<Link
target="_blank"
sx={{
lineHeight: 0,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
width: 36,
height: 36,
borderRadius: '50%',
color: 'inherit',
'&:hover': {
backgroundColor: 'secondary.main',
},
'& img': {
fill: 'currentColor',
width: 22,
height: 'auto',
},
}}
href={item.link}
>
{/* eslint-disable-next-line */}
<img src={item.icon} alt={item.name + 'icon'} />
</Link>
</Box>
)

// default
const SocialLinks: FC = () => {
return (
<Box sx={{ ml: -1 }}>
<Box
component="ul"
sx={{
m: 0,
p: 0,
lineHeight: 0,
borderRadius: 3,
listStyle: 'none',
}}
>
{socialLinks.map((item) => {
return <SocialLinkItem key={item.name} item={item} />
})}
</Box>
</Box>
)
}

export default SocialLinks
33 changes: 33 additions & 0 deletions src/components/footer/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { FC } from 'react'
import Box from '@mui/material/Box'
import Grid from '@mui/material/Grid'
import Container from '@mui/material/Container'
import Typography from '@mui/material/Typography'
import { FooterNavigation, FooterSocialLinks } from '@/components/footer'

const Footer: FC = () => {
return (
<Box component="footer" sx={{ backgroundColor: 'primary.main', py: 10, color: 'primary.contrastText' }}>
<Container>
<Grid container spacing={1}>
<Grid item xs={12} md={5}>
<Box sx={{ width: { xs: '100%', md: 360 } }}>
<Typography component="h2" variant="h2" sx={{ mb: 2 }}>
Coursespace
</Typography>
<Typography variant="subtitle1" sx={{ letterSpacing: 1, mb: 2 }}>
Coursespace is an online learning platform that has been operating since 2018 until now.
</Typography>
<FooterSocialLinks />
</Box>
</Grid>
<Grid item xs={12} md={7}>
<FooterNavigation />
</Grid>
</Grid>
</Container>
</Box>
)
}

export default Footer
4 changes: 4 additions & 0 deletions src/components/footer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as Footer } from './footer'
export { default as FooterSectionTitle } from './footer-section-title'
export { default as FooterNavigation } from './footer-navigation'
export { default as FooterSocialLinks } from './footer-social-links'
Loading

0 comments on commit 6dc2f2a

Please sign in to comment.