Skip to content
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
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 57 additions & 1 deletion src/components/ProjectCard/ProjectCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
border-radius: 12px;
padding: 1rem;
display: flex;
flex-direction: column;
flex-direction: column; //Default Vertical Layout
gap: 1rem;
transition: box-shadow 0.2s ease;

//For Mobile: Add horizontal layout (for screens < 640px)
@media (max-width:639px){
flex-direction: row;
gap: 0.75rem;
padding: 0.75rem;
}
}

.card:hover {
Expand Down Expand Up @@ -44,8 +51,28 @@
display: flex;
justify-content: center;
align-items: center;

//For Mobile: Add smaller, fixed width
@media (max-width: 639px){
height: 80px;
width: 80px; //Maintain square shape
min-width: 80px;
border-radius: 6px;
}
}

//Add new wrapper using flex to stack contents vertically on mobile
.content{
display: flex;
flex-direction: column;
gap: 1rem;
flex: 1; //Take remaining space on mobile

@media (max-width:639px){
gap:0.5rem;
}
}

.preview img {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -79,12 +106,23 @@
font-size: 0.875rem;
color: #334155;
line-height: 1.4;

//For Mobile version
@media (max-width: 639px){
font-size: 0.8rem;
line-height: 1.3;
}
}

.tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;

//For Mobile version
@media (max-width: 639px){
gap: 0.25rem;
}
}

.tag {
Expand All @@ -93,12 +131,23 @@
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
border-radius: 9999px;

//For Mobile version
@media (max-width: 639px){
font-size: 0.65rem;
padding: 0.2rem 0.4rem;
}
}

.links {
display: flex;
gap: 0.5rem;
margin-top: auto;

//For Mobile version
@media (max-width: 639px) {
gap: 0.25rem;
}
}

.codeButton,
Expand All @@ -113,6 +162,13 @@
border: 1px solid #e2e8f0;
text-decoration: none;
font-weight: 500;

//For Mobile version
@media (max-width: 639px){
font-size: 0.65rem;
height: 1.75rem;
padding:0 0.5rem;
}
}

.codeButton {
Expand Down
71 changes: 37 additions & 34 deletions src/components/ProjectCard/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ export function ProjectCard({
}: ProjectCardProps) {
return (
<div className={styles.card}>
<div className={styles.header}>
<div className={styles.titleSection}>
<h2 className={styles.title}>{title}</h2>
<p className={styles.author}>{author}</p>
</div>
</div>

<div className={styles.preview}>
{previewImageUrl ? (
<img src={"/placeholder.svg"} alt={`${title} preview`} />
Expand All @@ -43,40 +36,50 @@ export function ProjectCard({
)}
</div>

<p className={styles.description}>{description}</p>
<div className={styles.content}>
<div className={styles.header}>
<div className={styles.titleSection}>
<h2 className={styles.title}>{title}</h2>
<p className={styles.author}>{author}</p>
</div>
</div>

<div className={styles.tags}>
{tags.slice(0, 3).map((tag) => (
<span className={styles.tag} key={tag}>
{tag}
</span>
))}
{tags.length > 3 && (
<span className={styles.tag}>+{tags.length - 3}</span>
)}
</div>

<div className={styles.links}>
<a
href={githubUrl}
target="_blank"
rel="noopener noreferrer"
className={styles.codeButton}
>
<Github className={styles.icon} />
Code
</a>
{liveUrl && (
<p className={styles.description}>{description}</p>

<div className={styles.tags}>
{tags.slice(0, 3).map((tag) => (
<span className={styles.tag} key={tag}>
{tag}
</span>
))}
{tags.length > 3 && (
<span className={styles.tag}>+{tags.length - 3}</span>
)}
</div>

<div className={styles.links}>
<a
href={liveUrl}
href={githubUrl}
target="_blank"
rel="noopener noreferrer"
className={styles.demoButton}
className={styles.codeButton}
>
<ExternalLink className={styles.icon} />
Demo
<Github className={styles.icon} />
Code
</a>
)}
{liveUrl && (
<a
href={liveUrl}
target="_blank"
rel="noopener noreferrer"
className={styles.demoButton}
>
<ExternalLink className={styles.icon} />
Demo
</a>
)}
</div>
</div>
</div>
);
Expand Down