-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
304 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import styles from 'styles/portfolio.module.scss'; | ||
import { motion } from 'framer-motion'; | ||
import useDelay from 'utils/useDelay'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const Backdrop = ({ | ||
onMouseEnter, onMouseLeave, showBackdrop, height, width, title, description, technologies, href, | ||
}) => { | ||
const delayClose = useDelay(showBackdrop, 300, false, true); | ||
const delayOpen = useDelay(showBackdrop, 300, true, false); | ||
|
||
return ( | ||
<a href={href} target="_blank" rel="noreferrer"> | ||
<motion.div | ||
className={styles.backdrop} | ||
onMouseEnter={onMouseEnter} | ||
onMouseLeave={onMouseLeave} | ||
animate={{ opacity: showBackdrop ? 0.9 : 0 }} | ||
style={{ display: delayClose ? '' : 'none', height, width }} | ||
> | ||
<h1>{title}</h1> | ||
<motion.div className={styles.divider} animate={{ width: delayOpen ? '80%' : '0%' }} transition={{ duration: delayOpen ? 0.6 : 0 }} /> | ||
<div className={styles.desc}>{description}</div> | ||
<div className={styles.tech}>{technologies.join(', ')}</div> | ||
</motion.div> | ||
</a> | ||
); | ||
}; | ||
|
||
Backdrop.propTypes = { | ||
onMouseEnter: PropTypes.func, | ||
onMouseLeave: PropTypes.func, | ||
showBackdrop: PropTypes.bool.isRequired, | ||
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
description: PropTypes.string, | ||
technologies: PropTypes.arrayOf(PropTypes.string), | ||
href: PropTypes.string, | ||
}; | ||
|
||
export default Backdrop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import { useEmblaCarousel } from 'embla-carousel/react'; | ||
import styles from 'styles/portfolio.module.scss'; | ||
import PortfolioSlide from './PortfolioSlide'; | ||
|
||
const Portfolio = ({ inputRef }) => { | ||
const [EmblaCarouselReact] = useEmblaCarousel({ loop: false }); | ||
|
||
return ( | ||
<section id="portfolio" className="container" ref={inputRef} style={{ position: 'relative' }}> | ||
<EmblaCarouselReact className={styles.emblaViewport}> | ||
<div className={styles.emblaContainer}> | ||
<PortfolioSlide | ||
title="RecMe" | ||
image={require('public/recme.png')} | ||
description="RecMe is an app that makes it easy to share businesses with friends and earn cashback rewards." | ||
technologies={['React Native', 'React', 'AWS', 'Serverless', 'GraphQL']} | ||
href="https://recme.app/" | ||
/> | ||
<PortfolioSlide | ||
title="High Frequency Tones" | ||
image={require('public/frequency.png')} | ||
description="Precisely generate sound waves and test the limits of what you can hear." | ||
technologies={['React Native', 'tone.js']} | ||
href="https://apps.apple.com/us/app/id1511601653" | ||
/> | ||
<PortfolioSlide | ||
title="nchtr.io" | ||
image={require('public/nchtr.png')} | ||
description="nchtr.io allows you to crowdsource your texts for when you have no clue how to respond." | ||
technologies={['React', 'node.js', 'Firebase', 'AWS S3']} | ||
href="http://nchtr.io/" | ||
/> | ||
</div> | ||
</EmblaCarouselReact> | ||
</section> | ||
); | ||
}; | ||
|
||
export default Portfolio; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React, { useState, useEffect, useRef } from 'react'; | ||
import useWindowSize from 'utils/useWindowSize'; | ||
import styles from 'styles/portfolio.module.scss'; | ||
import PropTypes from 'prop-types'; | ||
import Backdrop from './Backdrop'; | ||
|
||
const PortfolioSlide = ({ | ||
image, title, description, technologies, href, | ||
}) => { | ||
const [showBackdrop, setShowBackdrop] = useState(false); | ||
|
||
const imgRef = useRef(null); | ||
const { width: windowWidth, height: windowHeight } = useWindowSize(); | ||
const [width, setWidth] = useState(); | ||
const [height, setHeight] = useState(); | ||
|
||
useEffect(() => { | ||
if (imgRef?.current) { | ||
const { naturalWidth, naturalHeight } = imgRef.current; | ||
const maxWidth = windowWidth - 20; | ||
const maxHeight = windowHeight * 0.7; | ||
|
||
const widthRatio = maxWidth / naturalWidth; | ||
const heightRatio = maxHeight / naturalHeight; | ||
|
||
if (widthRatio <= heightRatio) { | ||
console.log('resize width', naturalHeight, maxWidth); | ||
setHeight(naturalHeight * (maxWidth / naturalWidth)); | ||
setWidth(maxWidth); | ||
} else { | ||
console.log('resize height', naturalWidth, maxHeight); | ||
setWidth(naturalWidth * (maxHeight / naturalHeight)); | ||
setHeight(maxHeight); | ||
} | ||
} | ||
}, [imgRef, windowWidth, windowHeight]); | ||
|
||
const onHover = () => { | ||
setShowBackdrop(true); | ||
}; | ||
|
||
const onUnhover = () => { | ||
setShowBackdrop(false); | ||
}; | ||
|
||
return ( | ||
<div className={styles.emblaSlide}> | ||
<div className={styles.inner}> | ||
<img src={image} alt={title} onMouseEnter={onHover} onMouseLeave={onUnhover} ref={imgRef} onClick={onHover} style={{ width, height }} /> | ||
<Backdrop | ||
onMouseEnter={onHover} | ||
onMouseLeave={onUnhover} | ||
showBackdrop={showBackdrop} | ||
height={height} | ||
width={width} | ||
title={title} | ||
description={description} | ||
technologies={technologies} | ||
href={href} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
PortfolioSlide.propTypes = { | ||
image: PropTypes.node.isRequired, | ||
title: PropTypes.string, | ||
description: PropTypes.string, | ||
technologies: PropTypes.arrayOf(PropTypes.string), | ||
href: PropTypes.string, | ||
}; | ||
|
||
export default PortfolioSlide; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
$teal: #3bb3a4; | ||
|
||
.emblaViewport { | ||
width: 100%; | ||
overflow: hidden; | ||
} | ||
|
||
.emblaContainer { | ||
display: flex; | ||
} | ||
|
||
.emblaSlide { | ||
position: relative; | ||
min-width: 100%; | ||
padding: 0px 10px; | ||
|
||
.inner { | ||
position: relative; | ||
overflow: hidden; | ||
height: 70vh; | ||
|
||
img { | ||
position: absolute; | ||
display: block; | ||
max-height: 100%; | ||
height: auto; | ||
width: auto; | ||
max-width: 100%; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, -50%); | ||
object-fit: contain; | ||
} | ||
} | ||
} | ||
|
||
.backdrop { | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, -50%); | ||
background-color: $teal; | ||
height: 100%; | ||
width: 100%; | ||
cursor: pointer; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
color: white; | ||
overflow: hidden; | ||
|
||
h1 { | ||
font-size: 2.5rem; | ||
margin-top: 0px; | ||
margin-bottom: 30px; | ||
text-align: center; | ||
} | ||
|
||
a { | ||
color: inherit; | ||
text-align: center; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.divider { | ||
height: 2px; | ||
min-height: 2px; | ||
background-color: white; | ||
} | ||
|
||
.desc { | ||
width: 80%; | ||
max-width: 80%; | ||
font-size: 1.3rem; | ||
text-align: center; | ||
font-weight: 400; | ||
margin-top: 30px; | ||
} | ||
|
||
.tech { | ||
width: 80%; | ||
max-width: 80%; | ||
font-size: 1rem; | ||
text-align: center; | ||
font-weight: 300; | ||
margin-top: 30px; | ||
} | ||
} | ||
|
||
@media screen and (max-height: 600px) { | ||
.backdrop { | ||
h1 { | ||
font-size: 1.5rem; | ||
} | ||
} | ||
} | ||
|
||
@media screen and (max-width: 500px), screen and (max-height: 600px) { | ||
.backdrop { | ||
h1 { | ||
margin-bottom: 10px !important; | ||
} | ||
} | ||
.desc { | ||
margin-top: 10px !important; | ||
font-size: 1.1rem | ||
} | ||
.tech { | ||
margin-top: 10px !important; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 374px) { | ||
.backdrop { | ||
h1 { | ||
font-size: 1.5rem; | ||
} | ||
} | ||
.desc, .tech { | ||
font-size: 0.9rem !important; | ||
} | ||
} | ||
|
||
@media screen and (max-height: 430px) { | ||
.desc { | ||
display: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters