Skip to content

Commit

Permalink
Make responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
S-P-R committed Jan 12, 2024
1 parent 6364df5 commit 39fe1e2
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 36 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import './styles/App.css'
/**
* App
*
* Lays out page contents
* Lays out page
*
*/
function App() {
const [hoveredProject, setHoveredProject] = useState<string | null> (null);

return (
<div className='app-layout'>
<HeroSection/>
<div className='hero-section'> <HeroSection/> </div>
<div className='main-content'>
<h3> Hello! &#128075; </h3>
<p> I’m Sean, a fourth-year student at Tufts University &#128024; pursuing a Bachelor’s
Expand Down
8 changes: 4 additions & 4 deletions src/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import emailWhite from '../assets/email-white.png'
*/
export default function HeroSection (){
return (
<div className='hero-text'>
<div>
<h1 className='name'> <span className='first-name'>Sean</span> <span className='last-name'>Reilly</span> </h1>
<div className='external-links'>
<a href="https://github.com/S-P-R" target="_blank" rel="noopener noreferrer">
<img src={githubLogoWhite} alt="Github Logo" style={{ width: 50, height: 50 }} />
<img className="icon" src={githubLogoWhite} alt="Github Logo" />
</a>
<a href="https://www.linkedin.com/in/sean-reilly-301176225/" target="_blank" rel="noopener noreferrer">
<img src={linkedinLogoWhite} alt="Linkedin Logo" style={{ width: 50, height: 50 }} />
<img className="icon" src={linkedinLogoWhite} alt="Linkedin Logo" />
</a>
<a href="mailto:[email protected]" target="_blank" rel="noopener noreferrer">
<img src={emailWhite} alt="Email Logo" style={{ width: 50, height: 50 }} />
<img className="icon" src={emailWhite} alt="Email Logo" />
</a>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default function Project ({name, description, shouldDim, onMouseEnter, on
<h3 className="project-name"> {name} </h3>
<div className='project-content'>
<p> {description} </p>
<img className="project-image" src={imageURL} alt="Project Screenshot" style={{ width: 360, height: 204 }} />
<div className='image-container'>
<img className="project-image" src={imageURL} alt="Project Screenshot" />
</div>
</div>
</div>
)
Expand Down
17 changes: 15 additions & 2 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,18 @@
background-color: #000000;
color: rgb(255, 255, 255);
font-family: 'League Spartan', sans-serif;
font-size: 100%;
}
/* font-size: calc(1rem + 1vw); */
font-size: clamp(1rem, 2vw + .25rem, 2rem);
font-size: clamp(1rem, 1.10vw + .545rem, 2rem);
/* font-size: 2.25rem */
/* font-size: 100%; */
}

/* img {
height: 100%;
width: auto;
border-style: solid;
border-radius: 10px;
border-color: aqua;
} */
46 changes: 38 additions & 8 deletions src/styles/App.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
.app-layout {
.hero-section {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
flex-direction: column;
margin: 4rem;
margin-top: 2.4rem;
margin-bottom: .25rem;
}

.main-content {
font-size: .85rem;
display: flex;
flex-direction: column;

margin: 10rem;
margin-top: 8rem;
font-size: 1.5rem;
margin: 4rem;
margin-top: 2.5rem;
line-height: 1.5;
}

@media screen and (min-width: 1080px) {
.app-layout {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
}

.hero-section {
margin: 4rem;
margin-top: 2.4rem;
position: sticky;
top: 2.8rem; /* Slight increase over top-margin gets rid of small stutter when starting to scroll */
align-self: flex-start; /* Necessary for sticky positioning to work */
}

.main-content {
margin-top: 3.2rem
}
}

@media screen and (max-width: 1080px) {
.app-layout {
display: flex;
flex-direction: column;
justify-content: space-between;
width: 100%;
}
}
25 changes: 10 additions & 15 deletions src/styles/Hero.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
.hero-text {
display: flex;
flex-direction: column;
margin: 10rem;
margin-top: 6rem;
position: sticky;
top: 7rem; /* Slight increase over top-margin gets rid of small stutter when starting to scroll */
align-self: flex-start; /* Necessary for sticky positioning to work */
}

.name {
white-space: nowrap;
transition: text-shadow 0.3s ease, transform 0.3s ease;
font-size: 5rem;
font-size: 2.5rem;
}

.name:hover {
Expand All @@ -23,18 +13,23 @@
display: flex;
flex-direction: row;
justify-content: flex-start;

height: 1.75rem;
}

.external-links > * {
transition: transform 0.3s ease, opacity 0.3s ease;
opacity: 0.75;
padding-right: 3rem;
padding-right: 1.2rem;
}

.external-links > *:hover {
padding-right: 3rem;
padding-right: 1.2rem;
transition: transform 0.3s ease, opacity 0.3s ease;
transform: scale(1.15);
opacity: 1;
}
}

.icon {
height: 100%;
width: auto;
}
12 changes: 10 additions & 2 deletions src/styles/Project.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
border-radius: 40px;
border-style: solid;
border-width: .2rem;
padding: 1rem;
padding: .4rem;
transition: background-color .5s ease, border-color .3s ease;
color: inherit;
text-decoration: none;
Expand All @@ -31,13 +31,21 @@
}

.project-content > * {
margin: 1rem;
margin: .4rem;
margin-left: 0rem;
}

.image-container {
height: 5rem
}

.project-image {
border-color: #232323;
border-radius: 5px;
border-style: solid;
border-width: .1rem;
height: 100%;
width: auto;
max-width: 720px;
max-height: 408px;
}
1 change: 0 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})

0 comments on commit 39fe1e2

Please sign in to comment.