Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Projects page mobile view #146

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
55 changes: 32 additions & 23 deletions src/app/(pages)/projects/_components/PastProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,42 @@ import React from 'react';
import { ProjectDataType } from '@/lib/notion/projects';
import { CldImage } from 'next-cloudinary';
import { CardContent, CardTitle } from '@/components/ui/card';
import LinkButton from '@/components/LinkButton';
import { FaGithub } from 'react-icons/fa';

export default function PastProjectCard({ data }: { data: ProjectDataType }) {
return (
<a href={'/projects/' + data.pageId}>
<div className="bg-gradient-to-t from-[#0170DC] to-[#6191BC] rounded-[40px] flex flex-col max-h-[500px] p-4 outline hover:outline-white hover:outline-4 transition-all ease-in-out duration-150">
{data.logoUrl && (
<div className="flex justify-center items-center mb-4">
<CldImage
src={data.logoUrl}
alt={data.companyName}
width={250}
height={250}
className="w-48 h-48 object-fill"
/>
<div className="relative">
<a href={'/projects/' + data.pageId}>
<div className="flex flex-col justify-end items-center min-h-[400px] max-h-[500px] p-4 rounded-[40px] hover:outline hover:outline-4 hover:outline-white transition-all ease-in-out duration-150 bg-gradient-to-t from-[#0170DC] to-[#6191BC]">
{data.logoUrl && (
<div className="mb-4">
<CldImage
src={data.logoUrl}
alt={data.companyName}
width={250}
height={250}
className="w-48 h-48 object-fill"
/>
</div>
)}
<div className="flex flex-col items-center text-center gap-4">
<CardTitle className="flex md:items-center text-4xl text-white md:h-[80px]">{data.companyName}</CardTitle>
<CardContent className="text-2xl md:text-base text-white">
<p className="hidden md:line-clamp-4 h-[100px]">{data.description}</p>
<p className="block md:hidden">{data.productName}</p>
</CardContent>
</div>
)}
<div className="flex flex-col gap-4">
<div>
<CardTitle className="text-4xl text-center text-white h-[80px] flex items-center justify-center">
{data.companyName}
</CardTitle>
</div>
<CardContent className="text-md text-center text-white">
<p className="h-[100px] line-clamp-4">{data.description}</p>
</CardContent>
</div>
</div>
</a>
</a>
<LinkButton
href={data.gitHubUrl ?? '/projects'}
newTab={true}
variant="icon"
className="md:hidden absolute top-0 right-0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's adjust this so it will show up on top of the logo when the card gets too small

iPhone SE view:
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not that the card is too small (that card has the same height as the others)
it's because the logo has a background unlike the others which are transparent

this logo is super low resolution as well
can we replace it with a transparent version of https://yeco-canada.ca/wp-content/uploads/2024/06/cropped-1000697821.jpg ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this logo is super low resolution as well can we replace it with a transparent version of https://yeco-canada.ca/wp-content/uploads/2024/06/cropped-1000697821.jpg ?

@voidranjer would we be able to get better versions of logos for some of the projects including yeco canada?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nonetheless, will still push a change so it looks nice with all types of logos

>
<FaGithub className="h-[80px] w-[80px] md:h-12 md:w-12 text-white" />{' '}
</LinkButton>
</div>
);
}
27 changes: 18 additions & 9 deletions src/app/(pages)/projects/_components/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { FaArrowCircleRight } from 'react-icons/fa';

export default function ProjectCard({ data }: { data: ProjectDataType }) {
return (
<Card className={`flex justify-center items-center w-[300px] rounded-[30px] md:w-full `}>
<Card
className={`flex justify-center items-center w-full rounded-[40px] md:h-auto shadow-[2px_6px_4px_0px_rgba(0,0,0,0.25)]`}
>
{data.logoUrl && (
<CldImage
src={data.logoUrl}
Expand All @@ -19,24 +21,31 @@ export default function ProjectCard({ data }: { data: ProjectDataType }) {
/>
)}

<div>
<CardHeader>
<CardTitle className="text-4xl">{data.companyName}</CardTitle>
<CardDescription className="text-xl">{data.productName}</CardDescription>
<div className="flex flex-col justify-end md:justify-between min-h-[320px] md:min-h-full">
<CardHeader className="flex flex-col justify-between items-start pr-2 md:items-center md:block">
<CardTitle className="text-4xl font-bold">{data.companyName}</CardTitle>
<div className="flex flex-row md:pt-0 md:items-center">
<CardDescription className="text-2xl md:text-xl font-medium pt-2 md:pt-0">
{data.productName}
</CardDescription>
{data.logoUrl && (
<CldImage src={data.logoUrl} alt={data.companyName} width={120} height={120} className="md:hidden" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should clip any part of the image that goes off the card or adjust the image accordingly so it will fit within the card:

iPhone SE view:
image

)}
</div>
</CardHeader>
<CardContent className={'md:h-24 overflow-hidden text-md mb-5'}>
<CardContent className={'hidden md:block md:h-24 overflow-hidden text-md mb-5'}>
<p>{data.description}</p>
</CardContent>
<CardFooter className={'space-x-4 text-xs md:text-lg'}>
<CardFooter className={'space-x-4 text-xs md:text-lg justify-end md:justify-start pb-4 md:pb-6'}>
{data.gitHubUrl && (
<LinkButton href={data.gitHubUrl} newTab={true} variant="icon">
{' '}
<FaGithub className="text-5xl text-black hover:text-blueprint transition-colors ease-in-out duration-300" />{' '}
<FaGithub className="text-6xl md:text-5xl text-black hover:text-blueprint transition-colors ease-in-out duration-300" />{' '}
</LinkButton>
)}
{data.pageId && (
<LinkButton href={'/projects/' + data.pageId} newTab={true} variant="icon">
<FaArrowCircleRight className="text-5xl" />
<FaArrowCircleRight className="text-6xl md:text-5xl" />
</LinkButton>
)}
</CardFooter>
Expand Down
2 changes: 1 addition & 1 deletion src/app/(pages)/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default async function Projects() {
const pastProjects = res.filter(project => !isCurrentProject(project));

return (
<div className="space-y-6">
<div className="md:space-y-6">
<CurrentProjects projects={currentProjects} />
<PastProjects projects={pastProjects} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Toaster } from '@/components/ui/toaster';
import './globals.css';
import 'react-notion-x/src/styles.css';

const poppins = Poppins({ subsets: ['latin'], weight: ['400', '500', '600'] });
const poppins = Poppins({ subsets: ['latin'], weight: ['400', '500', '600', '700'] });

export const metadata: Metadata = {
title: 'Carleton Blueprint',
Expand Down