Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…/website-redesign into summer24
  • Loading branch information
sriyanm committed Aug 15, 2024
2 parents d2228c4 + da785c4 commit 9c8932b
Show file tree
Hide file tree
Showing 21 changed files with 137 additions and 66 deletions.
17 changes: 12 additions & 5 deletions components/currentProjectCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const styles = {
display: 'flex',
flexDirection: 'row',
backgroundColor: '#333',
padding: '16px',
padding: '25px',
borderRadius: '8px',
width: '100%',
maxWidth: '600px',
Expand All @@ -52,31 +52,37 @@ const styles = {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
width: '100%',
flex: 1,
},
projectInfo: {
marginBottom: '16px',
flex: '1 1 300px',
alignItems: 'center',
justifyContent: 'center',
},
projectImage: {
borderRadius: '10%',
objectFit: 'cover',
width: 'auto',
height: '100%',
width: '100%',
height: 'auto',
},
projectTitle: {
marginTop: '16px',
fontSize: '24px',
fontWeight: 'bold',
textAlign: 'center',
color: 'white',
},
leadsInfo: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
flex: '1 1 75px',
},
leadText: {
fontSize: '20px',
fontWeight: 'bold',
color: 'white',
},
leadsContainer: {
display: 'flex',
Expand All @@ -101,5 +107,6 @@ const styles = {
textAlign: 'center',
fontSize: '14px',
fontWeight: '500',
color: 'white',
},
};
21 changes: 17 additions & 4 deletions components/projectCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import Image from "next/image";
import Icon from "@/components/icon";

export default function ProjectCard({ project, basePath }) {
const imagePath = `${basePath}/images/projects/${project.label.toLowerCase().split(" ").join("_")}.jpg`;
const imagePath = `${basePath}/images/projects/${project.label
.toLowerCase()
.split(" ")
.join("_")}.jpg`;
return (
<div className="text-left sm:text-center rounded bg-grey py-2 sm:py-4 px-2 sm:px-8 w-full sm:w-60 flex sm:block gap-8">
<Image
Expand All @@ -14,18 +17,28 @@ export default function ProjectCard({ project, basePath }) {
alt={project.label}
/>
<div className="">
<h3 className="mb-1 text-2xl font-bold tracking-tight">{project.label}</h3>
<h3 className="mb-1 text-2xl font-bold tracking-tight">
{project.label}
</h3>
<ul className="flex sm:justify-center mt-2 sm:mt-4 space-x-4">
{project.github && (
<li>
<Link href={project.github} className="hover:text-gray" aria-label="Github Repo">
<Link
href={project.github}
className="hover:text-gray"
aria-label="Github Repo"
>
<Icon name="github" className="text-3xl" />
</Link>
</li>
)}
{project.googleSlides && (
<li>
<Link href={project.googleSlides} className="hover:text-gray" aria-label="Google Slides">
<Link
href={project.googleSlides}
className="hover:text-gray"
aria-label="Google Slides"
>
<Icon name="file-pdf" className="text-3xl" />
</Link>
</li>
Expand Down
19 changes: 9 additions & 10 deletions config/communityImages.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[
{
"name": "WN24 Project Expo",
"image": "WN24_EXPO.JPG"
},
{
"name": "WN24 Data Science Night",
"image": "WN24_DSN.JPG"
}
]

{
"name": "",
"image": "WN24_EXPO.JPG"
},
{
"name": "",
"image": "WN24_DSN.JPG"
}
]
4 changes: 2 additions & 2 deletions config/currentProjects.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
{
"label": "SoccerNet",
"image": "soccernet.jpg",
"image": "soccernet.png",
"leads": [
{ "name": "Antonio Capdevielle", "image": "temp.jpeg" },
{ "name": "Shiva Chandran", "image": "shivac.jpg" }
Expand Down Expand Up @@ -85,7 +85,7 @@
"leads": [
{ "name": "Jason Yen", "image": "temp.jpeg" },
{ "name": "Onat Ozer", "image": "temp.jpeg" },
{ "name": "Adita Sinha", "image": "temp.jpeg" }
{ "name": "Aditya Sinha", "image": "temp.jpeg" }
]
}
]
Expand Down
33 changes: 17 additions & 16 deletions config/homepage.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
[
{
"name": "Image Colorization",
"image": "image_colorization.png",
"link": "https://docs.google.com/document/d/19CekIh2sZGKKMoRA5VNFEcjNGHc9GEYt/"
},
{
"name": "Webscraping",
"image": "webscraping.png",
"link": "https://docs.google.com/document/d/1uVD5nvpA0lg9E8tE9khuEQDlwCwHKgrHGqtvzKe2JoA/"
},
{
"name": "Footwear Classification",
"image": "footwear_classification.png",
"link": "https://docs.google.com/presentation/d/1Bb7nCc4o3fmV4OkR-NOeAwzl6i1E_BA_V937Gjoq1wc/"
}
]
{
"name": "LLM Augmentation",
"image": "llm_augmentation.png",
"link": "https://github.com/MichiganDataScienceTeam/W24-llm-augmentation"
},

{
"name": "Image Colorization",
"image": "image_colorization.png",
"link": "https://docs.google.com/document/d/19CekIh2sZGKKMoRA5VNFEcjNGHc9GEYt/"
},
{
"name": "Real Vs Fake Face",
"image": "rvf.png",
"link": "https://github.com/MichiganDataScienceTeam/W24-RvF/tree/main"
}
]
5 changes: 5 additions & 0 deletions config/ourteam.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@
"groupName": "Project Committee",
"description": "Project advisors who help MDST operate our projects smoothly and at scale. Led by the VP of Projects.",
"members": [
{
"name": "Aaron Williams",
"title": "Project Planner",
"image": "temp.jpeg"
},
{
"name": "Anthony Chen",
"title": "Project Planner",
Expand Down
58 changes: 40 additions & 18 deletions config/pastProjects.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
{
"Winter 2024": [
{
"label": "Codenames"
"label": "Codenames",
"googleSlides": "https://docs.google.com/presentation/d/1EEHSw-WKN6Oes6NFfYK7iZHj91J1CgmHiiV8aO99r6I/"
},
{
"label": "LLM Augmentation"
"label": "LLM Augmentation",
"github": "https://github.com/MichiganDataScienceTeam/W24-llm-augmentation"
},
{
"label": "Poker Bot"
},
{
"label": "Rate My Professor Sentiment Analysis"
"label": "RMP Sentiment Analysis",
"github": "https://github.com/MichiganDataScienceTeam/WN2024-RMP"
},
{
"label": "Real vs Fake Faces"
"label": "Real vs Fake Faces",
"github": "https://github.com/MichiganDataScienceTeam/W24-RvF"
},
{
"label": "Shazam Clone"
Expand All @@ -22,18 +26,25 @@
"label": "Spotify Analysis"
},
{
"label": "Stock Market Analysis"
"label": "Stock Market Analysis",
"github": "https://github.com/MichiganDataScienceTeam/W24-StockAnalysis"
},
{
"label": "TikTok Videos"
"label": "TikTok Videos",
"github": "https://github.com/MichiganDataScienceTeam/W24-TikTokVideos"
},
{
"label": "Neural Nets from Scratch",
"googleSlides": "https://docs.google.com/presentation/d/1eygF8pf7d1f8UMB-v2oypFPFSCwICGlTM48-deNqibI/"
}
],
"Fall 2023": [
{
"label": "Automated Poker Bot"
},
{
"label": "College Football Success Factors"
"label": "College Football Success Factors",
"googleSlides": "https://docs.google.com/presentation/d/1tmIdFj_GK67cwrD3ueg2BlnUTtP9SWHVOYZPKaXCI5A/"
},
{
"label": "Cracking Wordle"
Expand All @@ -45,16 +56,20 @@
"label": "NHANES"
},
{
"label": "Real vs Photoshopped Faces"
"label": "Real vs Fake Faces",
"github": "https://github.com/MichiganDataScienceTeam/W24-RvFF"
},
{
"label": "Reinforcement Learning"
"label": "Reinforcement Learning",
"github": "https://github.com/MichiganDataScienceTeam/F23-Reinforcement-Learning",
"googleSlides": "https://docs.google.com/presentation/d/1d4I_1fqJCD7ZppEVOkYuTzfMbQ8NKCpYjbQkIEoSwNk/"
},
{
"label": "Sentence Completer"
},
{
"label": "Webscraping"
"label": "Webscraping",
"github": "https://github.com/MichiganDataScienceTeam/F23-Webscraping"
}
],
"Winter 2023": [
Expand Down Expand Up @@ -91,29 +106,36 @@
],
"Fall 2022": [
{
"label": "College Football"
"label": "College Football",
"googleSlides": "https://docs.google.com/document/d/1aD0UfCwea5I35nqoAEfS0PNpnzrAv3LX-X4kTCLVuu4/"
},
{
"label": "Dogs vs Cats"
"label": "Dogs vs Cats",
"googleSlides": "https://docs.google.com/presentation/d/1p-nNSJNfZd09ApFk05hJZfRlY2Z8PlsiVTgp0i6_U44/"
},
{
"label": "Image Super Resolution"
"label": "Image Super Resolution",
"googleSlides": "https://drive.google.com/file/d/1cKrjVCl-M5wXzARgPMj8Gr-foZpEkIS_/"
},
{
"label": "Language Translation Application"
},
{
"label": "Pokemon Data Science"
"label": "Pokemon Data Science",
"github": "https://docs.google.com/presentation/d/1vgOGh7djJRqNI7Ihf-R4ZZh7ON_KlCtCsHYucy0Aujk/"
},
{
"label": "SEC Insider Information",
"github": "https://github.com/MichiganDataScienceTeam/F22-SEC-Insider-Trading"
"label": "SEC Insider Trading",
"github": "https://github.com/MichiganDataScienceTeam/F22-SEC-Insider-Trading",
"googleSlides": "https://docs.google.com/presentation/d/1dfPMDMX9n3X6GxDN9UDY6cfULwg4e-BLKfpSPziidKY/"
},
{
"label": "Sports Data Science"
"label": "Sports Data Science",
"googleSlides": "https://docs.google.com/presentation/d/1q_kJey90QQsP4Nm5b96o5NVMg4gRgbTqe9THJfaXle0/"
},
{
"label": "TLDR Machine"
"label": "TLDR Machine",
"googleSlides": "https://docs.google.com/presentation/d/1dmCTwBANTU1W1ik5dSXuwD5ycRRRCtjyiQzMFE2zDgs/"
},
{
"label": "Twitter Sentiment Analysis"
Expand Down
5 changes: 5 additions & 0 deletions config/sponsors.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"link": "https://www.myrocketcareer.com/",
"image": "rocket.png"
},
{
"name": "Discover",
"link": "https://www.discover.com/",
"image": "discover.png"
},
{
"name": "Wolverine Trading",
"link": "https://www.wolve.com/",
Expand Down
37 changes: 28 additions & 9 deletions pages/projects/[...slug].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ import Hero from "@/components/hero";
import Image from "next/image";
import HeadContent from "@/components/headContent";

// Function to get all projects from JSON files
const getAllProjects = () => {
try {
const pastProjects = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'config', 'pastProjects.json'), 'utf-8'));
const currentProjects = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'config', 'currentProjects.json'), 'utf-8'));
return [...pastProjects, ...currentProjects];
} catch (error) {
console.error("Error reading or parsing JSON files:", error);
return [];
}
};

function ProjectPage({ content, title, images }) {
const router = useRouter();
const basePath = router.basePath;
Expand All @@ -29,12 +41,19 @@ function ProjectPage({ content, title, images }) {
}

export async function getStaticProps({ params }) {
const allProjects = getAllProjects();
const [subdirectory, innerDir] = params.slug;
const filePath = path.join(process.cwd(), 'public', 'projects', subdirectory, innerDir, 'writeup.md');
const project = allProjects.find(proj => proj.subdirectory === subdirectory && proj.innerDir === innerDir);

if (!project) {
return { notFound: true };
}

const filePath = path.join(process.cwd(), 'content', 'projects', subdirectory, innerDir, 'writeup.md');
const fileContent = fs.readFileSync(filePath, 'utf-8');

const imagesDir = path.join(process.cwd(), 'public', 'projects', subdirectory, innerDir, 'images');
const images = fs.existsSync(imagesDir) ? fs.readdirSync(imagesDir).map(img => path.join('/projects', subdirectory, innerDir, 'images', img)) : [];
const imagesDir = path.join(process.cwd(), 'public', 'images', 'projects', subdirectory, innerDir);
const images = fs.existsSync(imagesDir) ? fs.readdirSync(imagesDir).map(img => path.join('/images/projects', subdirectory, innerDir, img)) : [];

return {
props: {
Expand All @@ -46,13 +65,13 @@ export async function getStaticProps({ params }) {
}

export async function getStaticPaths() {
const projectsDirectory = path.join(process.cwd(), "public", "projects");
const subdirectories = fs.readdirSync(projectsDirectory, { withFileTypes: true }).filter(dirent => dirent.isDirectory());
const allProjects = getAllProjects();

const paths = subdirectories.flatMap(subdirectory => {
const innerDirectories = fs.readdirSync(path.join(projectsDirectory, subdirectory.name), { withFileTypes: true }).filter(dirent => dirent.isDirectory());
return innerDirectories.map(innerDir => ({ params: { slug: [subdirectory.name, innerDir.name] } }));
});
const paths = allProjects.map(project => ({
params: {
slug: [project.subdirectory, project.innerDir],
},
}));

return {
paths,
Expand Down
Loading

0 comments on commit 9c8932b

Please sign in to comment.