Skip to content

Commit

Permalink
Merge pull request #71 from hack-rpi/feature/Previous_Projects
Browse files Browse the repository at this point in the history
Feature/previous projects
  • Loading branch information
CooperW824 committed Aug 5, 2024
2 parents d1be421 + 18506d6 commit 9b5d43f
Show file tree
Hide file tree
Showing 139 changed files with 713 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

amplify_outputs.json
.amplify
.env

# amplify
Expand Down
466 changes: 441 additions & 25 deletions app/last-year/page.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/interactive-map/interactive-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const links: Link[] = [
{ href: "/event/schedule", children: "Schedule" },
{ href: "/event/prizes", children: "Prizes" },
{ href: "/resources", children: "Resources" },
{ href: "/last-year", children: "HackRPI 2023" },
{ href: "/last-year", children: "HackRPI X" },
{ href: "/sponsor-us", children: "Sponsor Us" },
];

Expand Down
2 changes: 1 addition & 1 deletion components/nav-bar/nav-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const links: NavGroup[] = [
],
},
{
name: "HackRPI 2023",
name: "HackRPI X",
links: [
{ href: "/last-year#winners", children: "Winners" },
{ href: "/last-year#photos", children: "Photos" },
Expand Down
61 changes: 61 additions & 0 deletions components/prev-projects/project-carousel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import Image from "next/image";
import Carousel from "react-multi-carousel";
import "react-multi-carousel/lib/styles.css";

export interface ProjectCarouselProps {
prizeCategory: string;
title: string;
authors: string[];
description: string;
imageUrl: string;
}

export default function ProjectCarousel({ projects }: { projects: ProjectCarouselProps[] }) {
const responsive = {
all: {
breakpoint: { max: 4000, min: 0 },
items: 1,
},
};

return (
<div className="w-full">
<Carousel
swipeable={true}
draggable={true}
showDots={true}
responsive={responsive}
infinite={true}
keyBoardControl={true}
ssr={true}
containerClass="w-full h-fit rounded-md mb-2"
>
{projects.map((project, index) => (
<div className="w-full h-fit flex items-start justify-center my-4" key={index}>
<div className="w-full sm:w-3/4 flex flex-col items-center justify-start bg-silver rounded-md m-4 text-hackrpi-secondary-dark-blue shadow-lg shadow-hackrpi-primary-blue">
<div className="flex flex-col-reverse md:flex-row w-full h-fit items-center md:items-start md:justify-center">
<div className="flex flex-col w-full md:w-1/2 pl-4 mt-2">
<h1 className="w-11/12 text-left text-xl xs:text-2xl sm:text-3xl font-bold font-sans">
{project.prizeCategory}
</h1>
<h2 className="w-11/12 text-left text-2xl font-bold font-sans">{project.title}</h2>
<hr className="border-black w-11/12"></hr>
<p className="w-11/12 text-left">{project.authors.join(", ")}</p>
<hr className="border-black w-11/12"></hr>
</div>
<Image
src={project.imageUrl}
alt={project.title}
width={500}
height={500}
className="w-full md:w-1/2 h-fit object-contain mb-2 rounded-md"
></Image>
</div>
<p className="w-full px-4 font-sans text-left my-2">{project.description}</p>
</div>
</div>
))}
</Carousel>
</div>
);
}
58 changes: 58 additions & 0 deletions components/prev-projects/project-display.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from "react";
import Image from "next/image";

export interface ProjectDisplayProps {
title: string;
authors: string[];
prizeCategory: string;
description: string;
imageUrl: string;
imageOnLeft: boolean;
}

export default function ProjectDisplay(props: ProjectDisplayProps) {
return (
<>
<DesktopProjectDisplay {...props} />
<MobileProjectDisplay {...props} />
</>
);
}

function DesktopProjectDisplay(props: ProjectDisplayProps) {
return (
<div
className={`hidden xl:flex ${props.imageOnLeft ? "flex-row-reverse" : "flex-row"} items-center justify-between`}
>
<div className="w-1/2">
<h1 className="font-sans font-bold font-white text-4xl">{props.prizeCategory}</h1>
<h2 className="font-sans font-bold font-white text-2xl">{props.title}</h2>
<hr />
<p className="font-sans font-white text-lg text-nowrap">{props.authors.join(", ")}</p>
<hr />
<p className="mt-2">{props.description}</p>
</div>
<div className="w-2/5">
<Image src={props.imageUrl} alt={props.title} height={500} width={500} />
</div>
</div>
);
}

function MobileProjectDisplay(props: ProjectDisplayProps) {
return (
<div className="flex xl:hidden flex-col items-start justify-start w-fit">
<div className="w-full flex items-center justify-center">
<Image src={props.imageUrl} alt={props.title} height={500} width={500} className="" />
</div>
<div>
<h1 className="font-sans font-bold font-white text-4xl">{props.prizeCategory}</h1>
<h2 className="font-sans font-bold font-white text-2xl">{props.title}</h2>
<hr />
<p className="font-sans font-white text-lg">{props.authors.join(", ")}</p>
<hr />
<p className="mt-2">{props.description}</p>
</div>
</div>
);
}
Loading

0 comments on commit 9b5d43f

Please sign in to comment.