|
| 1 | +import React from 'react'; |
| 2 | +import PropTypes from 'prop-types'; |
| 3 | +import clsx from 'clsx'; |
| 4 | + |
| 5 | +import { |
| 6 | + Box, |
| 7 | + Button, |
| 8 | + Container, |
| 9 | + Grid, |
| 10 | + Hidden, |
| 11 | + Typography, |
| 12 | + makeStyles |
| 13 | +} from '@material-ui/core'; |
| 14 | +import PlayArrowIcon from '@material-ui/icons/PlayArrow'; |
| 15 | + |
| 16 | +const background = 'linear-gradient(270.72deg, #180255 0.25%, #000000 97.54%)'; |
| 17 | + |
| 18 | +const useStyles = makeStyles(theme => ({ |
| 19 | + root: { |
| 20 | + color: '#FFF', |
| 21 | + background, |
| 22 | + paddingTop: 80, |
| 23 | + paddingBottom: 60, |
| 24 | + paddingLeft: 70, |
| 25 | + paddingRight: 70, |
| 26 | + [theme.breakpoints.down('md')]: { |
| 27 | + paddingLeft: 15, |
| 28 | + paddingRight: 15 |
| 29 | + } |
| 30 | + }, |
| 31 | + extraPadding: { |
| 32 | + padding: '0 70px 0px 0px', |
| 33 | + textAlign: 'justify', |
| 34 | + [theme.breakpoints.down('sm')]: { |
| 35 | + padding: '0' |
| 36 | + } |
| 37 | + }, |
| 38 | + image: { |
| 39 | + perspectiveOrigin: 'left center', |
| 40 | + transformStyle: 'preserve-3d', |
| 41 | + perspective: 1500, |
| 42 | + '& > img': { |
| 43 | + maxWidth: '100%', |
| 44 | + height: 'auto', |
| 45 | + backfaceVisibility: 'hidden' |
| 46 | + }, |
| 47 | + [theme.breakpoints.down('md')]: { |
| 48 | + alignItems: 'center', |
| 49 | + display: 'flex', |
| 50 | + flexDirection: 'column', |
| 51 | + height: '100%', |
| 52 | + justifyContent: 'center' |
| 53 | + } |
| 54 | + }, |
| 55 | + hide: { |
| 56 | + display: 'none' |
| 57 | + }, |
| 58 | + btn: { |
| 59 | + backgroundColor: '#A60000', |
| 60 | + color: '#ffffff', |
| 61 | + textTransform: 'capitalize', |
| 62 | + [theme.breakpoints.down('sm')]: { |
| 63 | + width: '100%' |
| 64 | + }, |
| 65 | + '&:hover': { |
| 66 | + backgroundColor: 'rgba(166, 0, 0, 0.8)' |
| 67 | + } |
| 68 | + } |
| 69 | +})); |
| 70 | + |
| 71 | +function Hero({ className, ...rest }) { |
| 72 | + const classes = useStyles(); |
| 73 | + |
| 74 | + return ( |
| 75 | + <div className={clsx(classes.root, className)} {...rest}> |
| 76 | + <Container maxWidth="lg"> |
| 77 | + <Grid container spacing={3}> |
| 78 | + <Grid item xs={12} md={6}> |
| 79 | + <Box |
| 80 | + display="flex" |
| 81 | + flexDirection="column" |
| 82 | + justifyContent="center" |
| 83 | + height="100%" |
| 84 | + className={clsx(classes.extraPadding, className)} |
| 85 | + > |
| 86 | + <Typography variant="h1" gutterBottom> |
| 87 | + Learn for Cause |
| 88 | + </Typography> |
| 89 | + <Typography variant="h1">Code for Cause</Typography> |
| 90 | + <Hidden mdUp> |
| 91 | + <Box mt={6} mb={2}> |
| 92 | + <div className={classes.image}> |
| 93 | + <img |
| 94 | + alt="codeforcauseimg" |
| 95 | + src="/static/home/codeforcause.svg" |
| 96 | + /> |
| 97 | + </div> |
| 98 | + </Box> |
| 99 | + </Hidden> |
| 100 | + <Box mt={5}> |
| 101 | + <Typography variant="body1"> |
| 102 | + An initiative to help the community by providing training, |
| 103 | + guidance and awareness about the possibilities in the software |
| 104 | + field to students & professionals. |
| 105 | + </Typography> |
| 106 | + </Box> |
| 107 | + <Box mt={4}> |
| 108 | + <Grid container xs={12} md={12}> |
| 109 | + <Grid item xs={12} md={12}> |
| 110 | + <Button |
| 111 | + className={classes.btn} |
| 112 | + component="a" |
| 113 | + href="https://youtube.com/codeforcause" |
| 114 | + target="_blank" |
| 115 | + size="large" |
| 116 | + variant="contained" |
| 117 | + > |
| 118 | + <PlayArrowIcon style={{ paddingRight: 5 }} /> |
| 119 | + Watch Our Videos |
| 120 | + </Button> |
| 121 | + </Grid> |
| 122 | + </Grid> |
| 123 | + </Box> |
| 124 | + </Box> |
| 125 | + </Grid> |
| 126 | + <Hidden smDown> |
| 127 | + <Grid item xs={12} md={6}> |
| 128 | + <Box> |
| 129 | + <div className={classes.image}> |
| 130 | + <img |
| 131 | + alt="codeforcauseimg" |
| 132 | + src="/static/home/codeforcause.svg" |
| 133 | + /> |
| 134 | + </div> |
| 135 | + </Box> |
| 136 | + </Grid> |
| 137 | + </Hidden> |
| 138 | + </Grid> |
| 139 | + </Container> |
| 140 | + </div> |
| 141 | + ); |
| 142 | +} |
| 143 | + |
| 144 | +Hero.propTypes = { |
| 145 | + className: PropTypes.string |
| 146 | +}; |
| 147 | + |
| 148 | +export default Hero; |
0 commit comments