Skip to content

Commit

Permalink
Merge pull request #10 from skunichetty/frontpage-updates
Browse files Browse the repository at this point in the history
Update frontpage
  • Loading branch information
skunichetty authored Aug 20, 2024
2 parents c693aff + 9b33494 commit 0a94be3
Show file tree
Hide file tree
Showing 20 changed files with 554 additions and 353 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/build-and-deploy.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/build.yml

This file was deleted.

7 changes: 4 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Footer from "@/components/footer";
import Navbar, { NavbarItem } from "@/components/navbar";
import Footer from "@/components/server/footer";
import Navbar from "@/components/client/navbar";
import { NavbarItem } from "@/components/server/navbar_static";
import type { Metadata } from "next";
import { Inter_Tight } from "next/font/google";
import "./globals.css";
import "katex/dist/katex.min.css";
import '@wooorm/starry-night/style/both';
import "@wooorm/starry-night/style/both";

const inter_tight = Inter_Tight({ subsets: ["latin"] });

Expand Down
136 changes: 15 additions & 121 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,112 +1,13 @@
"use client";
import Dropdown from "@/components/dropdown";
import ExperienceList from "@/components/experience_list";
import Location from "@/components/location";
import { useGSAP } from "@gsap/react";
import gsap from "gsap";
import { useEffect, useRef } from "react";

const experiences = [
{
position: "Software Engineer Intern",
start_date: new Date("May 2023"),
end_date: new Date("August 2023"),
company: "Wolverine Trading",
href: "https://www.wolve.com",
location: "Chicago, IL",
},
{
position: "Machine Learning Engineer Intern",
start_date: new Date("May 2022"),
end_date: new Date("July 2022"),
company: "Mage",
href: "https://www.mage.ai",
location: "Santa Clara, CA",
},
{
position: "Lead Instructional Aide - Machine Learning",
start_date: new Date("August 2022"),
end_date: new Date("April 2024"),
company: "University of Michigan CSE",
location: "Ann Arbor, MI",
},
{
position: "Teaching Assistant",
start_date: new Date("September 2021"),
end_date: new Date("April 2022"),
company: "University of Michigan Physics",
location: "Ann Arbor, MI",
},
];

function generateNoise(width: number, height: number, opacity: number): string {
const canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext("2d");
if (ctx) {
const imageData = ctx.createImageData(width, height);
const data = imageData.data;
for (let i = 0; i < data.length; i += 4) {
const value = Math.floor(Math.random() * 256);
data[i] = value;
data[i + 1] = value;
data[i + 2] = value;
data[i + 3] = Math.floor(opacity * 255);
}
ctx.putImageData(imageData, 0, 0);
return canvas.toDataURL();
}
return "";
}
import Dropdown from "@/components/client/dropdown";
import ExperienceList from "@/components/server/experience_list";
import Location from "@/components/client/location";
import Hero from "@/components/client/hero";

interface LineWithHeadingProps {
heading: string;
description: string;
}

function Hero() {
const hero = useRef<HTMLDivElement>(null);
const heroContent = useRef<HTMLDivElement>(null);

useGSAP(() => {
gsap.fromTo(
hero.current,
{ xPercent: 100 },
{
opacity: 1,
duration: 2,
xPercent: 0,
ease: "power1.out",
}
);
gsap.to(heroContent.current, {
opacity: 1,
duration: 1,
delay: 2.2,
});
});

useEffect(() => {
if (heroContent.current) {
const noiseImage = generateNoise(
heroContent.current.offsetWidth,
heroContent.current.offsetHeight,
0.02
);
heroContent.current.style.backgroundImage = `url(${noiseImage})`;
}
}, []);

return (
<div
className="opacity-0 bg-gradient-to-l from-blue-500 text-center w-full sm:h-52 h-40 mt-5 relative"
ref={hero}
>
<div ref={heroContent} className="opacity-0 w-full h-full"></div>
</div>
);
}
function LineWithHeading({ heading, description }: LineWithHeadingProps) {
return (
<p>
Expand All @@ -117,31 +18,21 @@ function LineWithHeading({ heading, description }: LineWithHeadingProps) {
}

export default function Home() {
const locationInfo = useRef(null);

useGSAP(() => {
gsap.to(locationInfo.current, {
opacity: 1,
duration: 2,
xPercent: 0,
ease: "power1.out",
});
});
return (
<div className="overflow-hidden">
<div className="block h-fit mt-6 sm:w-4/5 w-full px-10">
<div className="line text-4xl">Hi, I&apos;m Sachchit.</div>
<div className="line sm:text-2xl text-xl mt-1">
I&apos;m a software engineer and computer scientist.
</div>
<div className="line opacity-0" ref={locationInfo}>
<div className="line">
<Location />
</div>
</div>
<Hero />
<div className="info grid grid-row-1 grid-col-3 gap-1 px-10 my-5 sm:w-4/5 w-full">
<Dropdown icon="terminal" title="Work Experience">
<ExperienceList experiences={experiences} />
<ExperienceList />
</Dropdown>
<Dropdown icon="graduation" title="Education">
<div className="md:text-base sm:text-sm text-xs sm:max-w-md max-w-sm ">
Expand All @@ -152,7 +43,10 @@ export default function Home() {
<p>Aug 2020 - Apr 2024</p>
</div>
<p className="text-gray-600 dark:text-gray-400">
Minors in Business Administration, Mathematics
<b>Minors:</b> Business Administration, Mathematics
</p>
<p className="text-gray-600 dark:text-gray-400">
<b>GPA:</b> 3.97/4.00 (Summa Cum Laude)
</p>
</div>
</div>
Expand All @@ -161,15 +55,15 @@ export default function Home() {
<div className="md:text-sm text-xs">
<LineWithHeading
heading="Programming Languages"
description="C++, Python, TypeScript, Rust"
description="C++, Python"
/>
<LineWithHeading
heading="Tools and Software"
description="Linux, (Neo)vim, Valgrind, Docker, Wireshark, CMake"
heading="Operating Systems:"
description="Linux, MacOS, (some) Windows"
/>
<LineWithHeading
heading="Other Skills"
description="Machine Learning, Operating Systems, Web Development (Full Stack)"
heading="Tools and Software"
description="(Neo)vim, VSCode, Git, Docker, CMake, Figma"
/>
</div>
</Dropdown>
Expand Down
18 changes: 6 additions & 12 deletions app/posts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readFile, readdir } from "fs/promises";
import path from "path";
import Link from "next/link";
import { dateComparator } from "@/app/utils";
import { PostMetadata } from "@/components/post";
import { PostMetadata } from "@/components/client/post";
import matter from "gray-matter";

interface RawPostMetadata {
Expand All @@ -21,18 +21,18 @@ async function getPosts() {
.map((entry) => {
return {
fullpath: path.join(entry.parentPath, entry.name),
slug: entry.name
slug: entry.name,
};
});

const raw_metadata: RawPostMetadata[] = await Promise.all(
folders.map(async ({fullpath, slug}) => {
folders.map(async ({ fullpath, slug }) => {
const filename = `${fullpath}/page.mdx`;
const contents = {
...matter(await readFile(filename)).data,
slug
slug,
} as RawPostMetadata;
return contents;
return contents;
})
);

Expand All @@ -53,13 +53,7 @@ async function getPosts() {
});
}

function PostInfo({
title,
date,
editDate,
slug,
description,
}: PostMetadata) {
function PostInfo({ title, date, editDate, slug, description }: PostMetadata) {
return (
<div className="block py-2">
<Link
Expand Down
3 changes: 2 additions & 1 deletion components/dropdown.tsx → components/client/dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import { useState, useRef } from "react";
import Icon from "./icon";
import Icon from "../server/icon";
import { useGSAP } from "@gsap/react";
import gsap from "gsap";

Expand Down
69 changes: 69 additions & 0 deletions components/client/hero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"use client";
import { useGSAP } from "@gsap/react";
import gsap from "gsap";
import { useEffect, useRef } from "react";

function generateNoise(width: number, height: number, opacity: number): string {
const canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext("2d");
if (ctx) {
const imageData = ctx.createImageData(width, height);
const data = imageData.data;
for (let i = 0; i < data.length; i += 4) {
const value = Math.floor(Math.random() * 256);
data[i] = value;
data[i + 1] = value;
data[i + 2] = value;
data[i + 3] = Math.floor(opacity * 255);
}
ctx.putImageData(imageData, 0, 0);
return canvas.toDataURL();
}
return "";
}


export default function Hero() {
const hero = useRef<HTMLDivElement>(null);
const heroContent = useRef<HTMLDivElement>(null);

useGSAP(() => {
gsap.fromTo(
hero.current,
{ xPercent: 100 },
{
opacity: 1,
duration: 2,
xPercent: 0,
ease: "power1.out",
}
);
gsap.to(heroContent.current, {
opacity: 1,
duration: 1,
delay: 2.2,
});
});

useEffect(() => {
if (heroContent.current) {
const noiseImage = generateNoise(
heroContent.current.offsetWidth,
heroContent.current.offsetHeight,
0.02
);
heroContent.current.style.backgroundImage = `url(${noiseImage})`;
}
}, []);

return (
<div
className="opacity-0 bg-gradient-to-l from-blue-500 text-center w-full sm:h-52 h-40 mt-5 relative"
ref={hero}
>
<div ref={heroContent} className="opacity-0 w-full h-full"></div>
</div>
);
}
Loading

0 comments on commit 0a94be3

Please sign in to comment.