-
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
18 changed files
with
171 additions
and
50 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,35 +1,87 @@ | ||
.project { | ||
display: flex; | ||
align-items: flex-start; /* Ensure top alignment */ | ||
justify-content: space-between; /* Keep items spaced out */ | ||
padding: 2em; | ||
margin: 0 auto; | ||
text-align: center; | ||
box-shadow: var(--shadow); | ||
transition: transform 0.2s linear; | ||
background-color: var(--clr-bg); | ||
overflow: hidden; /* Hide any overflow */ | ||
} | ||
|
||
.project:hover { | ||
transform: translateY(-7px); | ||
} | ||
|
||
.project__description { | ||
margin-top: 1em; | ||
flex: 1; /* Gives text a flexible width, but not as wide as images */ | ||
text-align: left; /* Align text to the left */ | ||
margin-right: 20px; /* Space between text and image */ | ||
} | ||
|
||
.project__stack { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
justify-content: flex-start; /* Align stack items at the start */ | ||
margin: 1.2em 0; | ||
} | ||
|
||
.project__stack-item { | ||
line-height: .5; | ||
margin: .75em; | ||
line-height: 1.5; /* Improved readability */ | ||
margin: 0.75em; /* Consistent margin */ | ||
font-weight: 500; | ||
font-size: 0.8rem; | ||
color: var(--clr-fg-alt); | ||
} | ||
|
||
.project .link--icon { | ||
margin-left: 0.5em; | ||
} | ||
} | ||
|
||
.project__demo { | ||
flex: 1; /* Gives the image area flexible width up to half of the container */ | ||
width: 50%; /* Explicitly define width to half of the container */ | ||
text-align: center; /* Center the image or video */ | ||
} | ||
|
||
.project__demo img { | ||
margin-top: 30px; | ||
width: 100%; /* Full width of its container */ | ||
height: auto; /* Maintain aspect ratio */ | ||
max-height: 600px; /* Control maximum height */ | ||
border-radius: 10px; | ||
border: .25px solid gray; | ||
} | ||
|
||
.project__dots { | ||
text-align: center; | ||
padding: 10px 0; | ||
} | ||
|
||
.dot { | ||
height: 10px; | ||
width: 10px; | ||
margin: 0 5px; | ||
background-color: #bbb; | ||
border-radius: 50%; | ||
display: inline-block; | ||
cursor: pointer; | ||
} | ||
|
||
.dot.active { | ||
background-color: #717171; | ||
} | ||
|
||
|
||
.project__demo.mobile-app img { | ||
max-width: 30%; /* Keep the width adjustment for mobile app specific styling */ | ||
height: 300px; /* Ensure mobile app images also have the same height */ | ||
object-fit: cover; /* Adjusts the content of the image to fit the container */ | ||
} | ||
|
||
|
||
.project__demo.mobile-app { | ||
align-self: center; /* Center the demo in the container */ | ||
} | ||
|
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 |
---|---|---|
@@ -1,43 +1,72 @@ | ||
import uniqid from 'uniqid' | ||
import uniqid from 'uniqid'; | ||
import GitHubIcon from '@mui/icons-material/GitHub'; | ||
import LaunchIcon from '@mui/icons-material/Launch'; | ||
import './ProjectContainer.css' | ||
import { useState } from 'react'; | ||
import './ProjectContainer.css'; | ||
|
||
const ProjectContainer = ({ project }) => ( | ||
<div className='project'> | ||
<h3>{project.name}</h3> | ||
const ProjectContainer = ({ project }) => { | ||
const [currentImage, setCurrentImage] = useState(0); | ||
|
||
<p className='project__description'>{project.description}</p> | ||
{project.stack && ( | ||
<ul className='project__stack'> | ||
{project.stack.map((item) => ( | ||
<li key={uniqid()} className='project__stack-item'> | ||
{item} | ||
</li> | ||
))} | ||
</ul> | ||
)} | ||
const handleDotClick = (index) => { | ||
setCurrentImage(index); | ||
}; | ||
|
||
{project.sourceCode && ( | ||
<a | ||
href={project.sourceCode} | ||
aria-label='source code' | ||
className='link link--icon' | ||
> | ||
<GitHubIcon /> | ||
</a> | ||
)} | ||
// Determine if the project is 'PlateMate' | ||
const isMobileApp = project.name === 'PlateMate'; | ||
|
||
{project.livePreview && ( | ||
<a | ||
href={project.livePreview} | ||
aria-label='live preview' | ||
className='link link--icon' | ||
> | ||
<LaunchIcon /> | ||
</a> | ||
)} | ||
</div> | ||
) | ||
return ( | ||
<div className='project'> | ||
<div className='project__description'> | ||
<h3>{project.name}</h3> | ||
<p>{project.description}</p> | ||
{project.stack && ( | ||
<ul className='project__stack'> | ||
{project.stack.map((item) => ( | ||
<li key={uniqid()} className='project__stack-item'> | ||
{item} | ||
</li> | ||
))} | ||
</ul> | ||
)} | ||
|
||
export default ProjectContainer | ||
{project.sourceCode && ( | ||
<a | ||
href={project.sourceCode} | ||
aria-label='source code' | ||
className='link link--icon' | ||
> | ||
<GitHubIcon /> | ||
</a> | ||
)} | ||
|
||
{project.livePreview && ( | ||
<a | ||
href={project.livePreview} | ||
aria-label='live preview' | ||
className='link link--icon' | ||
> | ||
<LaunchIcon /> | ||
</a> | ||
)} | ||
</div> | ||
<div className={`project__demo ${isMobileApp ? 'mobile-app' : ''}`}> | ||
{project.images && project.images.length > 0 && ( | ||
<> | ||
<img src={project.images[currentImage]} alt='Demo' /> | ||
<div className='project__dots'> | ||
{project.images.map((_, index) => ( | ||
<span | ||
key={index} | ||
className={`dot ${index === currentImage ? 'active' : ''}`} | ||
onClick={() => handleDotClick(index)} | ||
></span> | ||
))} | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProjectContainer; |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
.projects__grid { | ||
max-width: 1100px; | ||
margin: 0 auto; | ||
display: grid; | ||
grid-template-columns: repeat(auto-fit, minmax(18em, 1fr)); | ||
grid-gap: 2em; | ||
} | ||
max-width: 100%; | ||
margin: 0 auto; | ||
margin-top: 4em; | ||
display: grid; | ||
grid-template-columns: 1fr; /* One column layout */ | ||
grid-gap: 2em; | ||
} |
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.
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