Skip to content

Commit

Permalink
Add different colour option for project card subtitles
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkthmpsn committed May 8, 2024
1 parent be73964 commit db32633
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const ProjectsPage = () => {
subtitle="Matplotlib | Development"
backgroundImage={twenty3FontTextSizeThumb}
internalLink={"/matplotlib-font-text-sizing"}
subtitleColour="white"
/>
</div>
<br />
Expand Down
6 changes: 5 additions & 1 deletion components/projectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ interface ProjectCardProps {
subtitle: string;
backgroundImage: any;
internalLink: string;
subtitleColour?: string;
}

const ProjectCard: React.FC<ProjectCardProps> = ({
title,
subtitle,
backgroundImage,
internalLink,
subtitleColour = "black",
}) => {
return (
<a href={internalLink} className="no-underline">
Expand All @@ -25,7 +27,9 @@ const ProjectCard: React.FC<ProjectCardProps> = ({
{title}
</p>
</div>
<div className="flex flex-col items-center justify-end text-center text-black w-full h-full absolute bottom-0 md:pb-4 md:!opacity-0 md:text-normal md:group-hover:!opacity-100 transition-opacity duration-150">
<div
className={`flex flex-col items-center justify-end text-center text-${subtitleColour} w-full h-full absolute bottom-0 md:pb-4 md:!opacity-0 md:text-normal md:group-hover:!opacity-100 transition-opacity duration-150`}
>
<p className="text-sm mb-2 md:mb-4 md:text-lg">{subtitle}</p>
</div>
</div>
Expand Down

0 comments on commit db32633

Please sign in to comment.