Skip to content

Added responsiveness to Welcome Section. #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions src/assets/bulb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/HomePage/SectionLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function SectionLayout({ children, lastSection, onScrollClick, alternate }) {
return (
<Container
className={classes.container}
style={{ backgroundColor: alternate ? 'red' : 'blue' }}
style={{ backgroundColor: alternate ? 'red' : 'black' }}
>
{children}
{lastSection ? null : (
Expand Down
91 changes: 88 additions & 3 deletions src/components/HomePage/Welcome.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,108 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { Grid, Typography } from '@material-ui/core';

import SectionLayout from './SectionLayout';
import { ReactComponent as ReactSvgImg } from '../../assets/bulb.svg';

function Welcome({ onScrollClick }) {
const classes = useStyle();

return (
<SectionLayout onScrollClick={onScrollClick}>
<h1 className={classes.heading}>Welcome Section</h1>


{/*---the svg image (bulb)---*/}

<Grid
container
xs={12}
direction='row'
justify='center'
alignItems='center'
className={classes.svgContainer}
>
<Grid item xs={12} style={{ textAlign: 'center' }}>
<ReactSvgImg />
</Grid>
</Grid>

{/*----- Text ----- */}

<Grid
container
xs={12}
direction='column'
justify='center'
alignItems='center'
className={classes.textContainer}
>
<Grid item xs={12}>
<Typography gutterBottom variant='h2'>
WELCOME TO
</Typography>
</Grid>
<Grid item xs={12}>
<Typography gutterBottom variant='h1'>
OPENCODE
</Typography>
</Grid>
</Grid>
</SectionLayout>
);
}

export default Welcome;

const useStyle = makeStyles((theme) => ({
heading: {
svgContainer: {
position: 'absolute',
top: '0',
height: '100%',

'& svg': {
width: '600px',
height: '500px',
[theme.breakpoints.down('sm')]: {
width: '480px',
height: '400px',
},
[theme.breakpoints.down('xs')]: {
width: '340px',
height: '300px',
},
},
},

textContainer: {
fontFamily: theme.typography.fontFamily,
fontSize: '3em',
color: 'white',

'& h2': {
[theme.breakpoints.up('sm')]: {
letterSpacing: '.5.0rem',
},
[theme.breakpoints.up('md')]: {
letterSpacing: '1.0rem',
},

fontWeight: '700',
mixBlendMode: 'difference',
},

'& h1': {
color: 'black',
[theme.breakpoints.up('sm')]: {
letterSpacing: '1.0rem',
},
[theme.breakpoints.up('md')]: {
letterSpacing: '2.0rem',
},

fontWeight: '700',
WebkitTextStroke: '1px whitesmoke',
textShadow: '1px 1px 0px #e3e3e3',
mixBlendMode: 'screen',
},
},
}));