Skip to content

Commit

Permalink
feat: add hamburger menu and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoudham committed Aug 13, 2023
1 parent d857b73 commit a25b564
Show file tree
Hide file tree
Showing 22 changed files with 328 additions and 102 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Set Short SHA
id: short_sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Build/Push Image
uses: docker/build-push-action@v4
with:
context: .
push: true
build-args:
NEXT_PUBLIC_BUILD_SHA=${{ steps.short_sha.outputs.short_sha }}
NEXT_PUBLIC_BUILD_ID=${{ github.run_id }}
NEXT_PUBLIC_BUILD_NUM=${{ github.run_number }}
secrets: |
REPOS_READ_ONLY=${{ secrets.REPOS_READ_ONLY }}
tags: ${{ secrets.DOCKER_USERNAME }}/website:${{ github.ref_name }}
57 changes: 33 additions & 24 deletions app/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
import { FancyUnderline, Text } from "./utils/Text";
import { Text } from "./utils/Text";
import {
GitHubSvg,
InstagramSvg,
LinkedInSvg,
TwitterSvg,
GitHub,
Gitea,
Instagram,
LinkedIn,
Twitter,
} from "./icons/SocialMedia";
import Link from "next/link";
import { Heart } from "./icons/Heart";

export const Footer = () => {
console.log(process.env.NEXT_PUBLIC_IS_PREVIEW);
return (
<footer className="border-t-2 border-surface1 w-full text-subtext1">
<div className="flex flex-col justify-center items-center gap-y-6 pt-10 pb-20">
<div className="gap-y-3 text-center">
<div className="flex flex-col justify-center items-center space-y-6 pt-10 pb-20">
<div className="text-center">
<p className="text-lg lg:text-xl xl:text-2xl">
Designed With <Heart />
</p>
<Text>&copy; {new Date().getFullYear()} Goudham Suresh</Text>
</div>
{process.env.NEXT_PUBLIC_IS_PREVIEW && <PreviewBuild />}
<BuildInfo />
<SocialMediaRow />
</div>
</footer>
);
};

const PreviewBuild = () => {
const BuildInfo = () => {
return (
<div className="text-center text-md lg:text-lg xl:text-xl">
<FancyUnderline decoration="decoration-peach">
Preview Build
</FancyUnderline>
<p className="text-lavender font-semibold">
{process.env.NEXT_PUBLIC_IS_PREVIEW ? "Preview" : "Release"} Build
</p>
<p>
GitHub SHA:{" "}
<Link
className="hover:underline"
className="hocus:underline hocus:decoration-solid hocus:decoration-blue hocus:decoration-2"
aria-label="View the GitHub commit for this build"
href={`https://github.com/sgoudham/website/commit/${process.env.NEXT_PUBLIC_BUILD_SHA}`}
>
{process.env.NEXT_PUBLIC_BUILD_SHA}
Expand All @@ -44,7 +45,8 @@ const PreviewBuild = () => {
<p>
Build ID:{" "}
<Link
className="hover:underline"
className="hocus:underline hocus:decoration-solid hocus:decoration-blue hocus:decoration-2"
aria-label="View the GitHub Actions run for this build"
href={`https://github.com/sgoudham/website/actions/runs/${process.env.NEXT_PUBLIC_BUILD_ID}`}
>
{process.env.NEXT_PUBLIC_BUILD_ID}
Expand All @@ -57,34 +59,41 @@ const PreviewBuild = () => {

const SocialMediaRow = () => {
return (
<div className="flex gap-3">
<div className="flex gap-3 items-center">
<a
className="group"
className="group focus:ring-2 focus:ring-blue ring-offset-0"
aria-label="Follow Me On GitHub"
href="https://github.com/sgoudham"
>
<GitHubSvg />
<GitHub />
</a>
<a
className="group focus:ring-2 focus:ring-blue ring-offset-0"
aria-label="Visit My Gitea Instance"
href="https://gitea.goudham.com"
>
<Gitea />
</a>
<a
className="group"
className="group focus:ring-2 focus:ring-blue ring-offset-0"
aria-label="Follow Me On LinkedIn"
href="https://linkedin.com/in/sgoudham"
>
<LinkedInSvg />
<LinkedIn />
</a>
<a
className="group"
className="group focus:ring-2 focus:ring-blue ring-offset-0"
aria-label="Follow Me On Twitter"
href="https://twitter.com/RealGoudham"
>
<TwitterSvg />
<Twitter />
</a>
<a
className="group"
className="group focus:ring-2 focus:ring-blue ring-offset-0"
aria-label="Follow Me On Instagram"
href="https://instagram.com/sgoudham"
>
<InstagramSvg />
<Instagram />
</a>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion app/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const Header = () => {
return (
<H1>
Hiya{" "}
<div className="inline-block animate-waving-hand">
<div className="inline-block motion-safe:animate-waving-hand">
<Wave />
</div>
, I&#39;m Goudham
Expand Down
83 changes: 65 additions & 18 deletions app/components/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,76 @@
import Link from "next/link";
"use client";

import { useState } from "react";
import { ProfilePicture } from "./images/ProfilePicture";
import { Hamburger } from "./nav/Hamburger";
import { Links } from "./nav/Links";
import { Close } from "./icons/Close";
import Link from "next/link";
import { Dialog } from "@headlessui/react";
import { usePathname } from "next/navigation";

export const NavBar = () => {
const path = usePathname();
const [isOpen, setIsOpen] = useState(false);
const checkPath = (href: string) => {
if (href === path) {
setIsOpen(false);
}
};

return (
<nav className="border-b-2 border-surface1">
<div className="flex flex-row items-center justify-center text-lg lg:text-xl xl:text-2xl">
<div className="p-2 flex flex-row gap-x-4 items-center tracking-tight font-bold">
<>
<nav className="self-center w-full max-w-xl lg:max-w-3xl xl:max-w-6xl">
<div className="p-4 flex flex-row items-center justify-between text-md lg:text-lg xl:text-xl">
<ProfilePicture />
<Link href="/" className="transition duration-300 group">
<span className="group-hover:text-blue transition-all duration-300">
&lt; Home /&gt;
</span>
<span className="block max-w-0 group-hover:max-w-full transition-all h-0.5 bg-blue duration-300"></span>
<div className="hidden md:flex flex-row gap-x-4 font-bold tracking-tight">
<Links />
</div>
<div
className="md:hidden px-4 py-2 hover:bg-crust dark:hover:bg-base rounded-lg"
onClick={() => setIsOpen((prev) => !prev)}
>
<Hamburger />
</div>
</div>
</nav>

<Dialog
className={
isOpen
? "block w-full h-screen absolute overflow-hidden inset-0 bg-crust z-10 flex-col items-center"
: "hidden"
}
open={isOpen}
onClose={() => setIsOpen(false)}
// initialFocus={focusedRef}
>
<div className="p-4 w-full flex flex-row items-center justify-between">
<ProfilePicture />
<div
className="px-4 py-2 hover:bg-crust dark:hover:bg-base rounded-lg"
onClick={() => setIsOpen((prev) => !prev)}
>
<Close />
</div>
</div>
<ul className="flex flex-col space-y-6 items-center text-2xl font-semibold justify-center">
<Link
href="/"
// ref={focusedRef}
onClick={() => checkPath("/")}
>
&lt; Home /&gt;
</Link>
<Link
href="/projects"
className="transition duration-300 group"
// ref={focusedRef}
onClick={() => checkPath("/projects")}
>
<span className="group-hover:text-blue transition-all duration-300">
&lt; Projects /&gt;
</span>
<span className="block max-w-0 group-hover:max-w-full transition-all h-0.5 bg-blue duration-300"></span>
&lt; Projects /&gt;
</Link>
</div>
</div>
</nav>
</ul>
</Dialog>
</>
);
};
};
24 changes: 18 additions & 6 deletions app/components/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { fetchUserRepositories } from "@/app/lib/api";
import { Star } from "./icons/Star";
import Link from "next/link";
import { H2 } from "./utils/Titles";
import { ExternalLink } from "./icons/ExternalLink";
import { Archived } from "./icons/Archived";

export const Projects = async () => {
const projects = await fetchUserRepositories().then((res) =>
Expand All @@ -18,10 +20,10 @@ export const Projects = async () => {
);

return (
<section className="flex flex-col items-center gap-y-3 px-5">
<section className="flex flex-col items-center space-y-3 px-5">
<H2>Favourite Projects</H2>
<div className="rounded-lg text-md lg:text-lg xl:text-xl">
<div className="flex flex-col gap-y-4">
<div className="flex flex-col space-y-4">
{projects.map((project) => (
<Project key={project.name} project={project} />
))}
Expand All @@ -34,19 +36,29 @@ export const Projects = async () => {
export const Project = ({ project }: { project: RepositoryData }) => {
return (
<Link
rel="noopener noreferrer"
target="_blank"
href={project.html_url}
className="bg-base w-full rounded-xl border-2 border-mantle focus:outline-none focus:ring-1 focus:ring-blue ring-offset-0 shadow-lg hover:scale-105 duration-300 p-3"
className="bg-base w-full rounded-xl outline-2 outline-mantle focus:ring-2 focus:ring-blue ring-offset-0 shadow-lg hover:scale-105 motion-safe:duration-300 p-3"
>
<div className="flex flex-col gap-y-1 h-full justify-between">
<div className="flex flex-col space-y-1 h-full justify-between">
<div>
<span className="font-semibold hover:underline">{project.name}</span>
<span className="font-semibold hover:underline">
{project.name}&#8201;
<ExternalLink />
</span>
{project.description && (
<div className="text-sm lg:text-md xl:text-lg text-subtext1">
{project.description}
</div>
)}
</div>
<div className="self-end">
<div className="self-end flex flex-row gap-x-1">
{project.archived && (
<p className="text-md font-medium bg-mantle rounded-xl px-3">
<Archived />
</p>
)}
<p className="text-md font-medium bg-mantle rounded-xl px-3">
{project.stargazers_count} <Star />
</p>
Expand Down
13 changes: 13 additions & 0 deletions app/components/icons/Archived.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const Archived = () => {
return (
<svg
className="h-5 w-5 xl:h-6 xl:w-6 inline align-text-bottom fill-yellow"
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
viewBox="0 0 256 256"
>
<path d="M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"></path>
</svg>
);
};
13 changes: 13 additions & 0 deletions app/components/icons/Close.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const Close = () => {
return (
<svg
className="h-8 w-8 fill-overlay0 group-hover:bg-subtext1"
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
viewBox="0 0 256 256"
>
<path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
</svg>
);
};
13 changes: 13 additions & 0 deletions app/components/icons/ExternalLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const ExternalLink = () => {
return (
<svg
className="h-4 w-4 inline-block align-text-top fill-text opacity-50"
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
viewBox="0 0 256 256"
>
<path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"></path>
</svg>
);
};
28 changes: 24 additions & 4 deletions app/components/icons/SocialMedia.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
const socialMediaColours: string =
"h-8 w-8 lg:h-9 lg:w-9 xl:h-10 xl:w-10 fill-surface2 transition group-hover:fill-blue";

export const GitHubSvg = () => {
export const Gitea = () => {
return (
<svg
className="h-10 w-10 lg:h-11 lg:w-11 xl:h-12 xl:w-12 transition group-hover:fill-blue"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 640 640"
>
<path
className="fill-base"
d="M395.9 484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5 21.2-17.9 33.8-11.8 17.2 8.3 27.1 13 27.1 13l-.1-109.2 16.7-.1.1 117.1s57.4 24.2 83.1 40.1c3.7 2.3 10.2 6.8 12.9 14.4 2.1 6.1 2 13.1-1 19.3l-61 126.9c-6.2 12.7-21.4 18.1-33.9 12z"
/>
<g className="fill-surface2 group-hover:fill-blue">
<path d="M622.7 149.8c-4.1-4.1-9.6-4-9.6-4s-117.2 6.6-177.9 8c-13.3.3-26.5.6-39.6.7v117.2c-5.5-2.6-11.1-5.3-16.6-7.9 0-36.4-.1-109.2-.1-109.2-29 .4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5c-9.8-.6-22.5-2.1-39 1.5-8.7 1.8-33.5 7.4-53.8 26.9C-4.9 212.4 6.6 276.2 8 285.8c1.7 11.7 6.9 44.2 31.7 72.5 45.8 56.1 144.4 54.8 144.4 54.8s12.1 28.9 30.6 55.5c25 33.1 50.7 58.9 75.7 62 63 0 188.9-.1 188.9-.1s12 .1 28.3-10.3c14-8.5 26.5-23.4 26.5-23.4S547 483 565 451.5c5.5-9.7 10.1-19.1 14.1-28 0 0 55.2-117.1 55.2-231.1-1.1-34.5-9.6-40.6-11.6-42.6zM125.6 353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6 321.8 60 295.4c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5 38.5-30c13.8-3.7 31-3.1 31-3.1s7.1 59.4 15.7 94.2c7.2 29.2 24.8 77.7 24.8 77.7s-26.1-3.1-43-9.1zm300.3 107.6s-6.1 14.5-19.6 15.4c-5.8.4-10.3-1.2-10.3-1.2s-.3-.1-5.3-2.1l-112.9-55s-10.9-5.7-12.8-15.6c-2.2-8.1 2.7-18.1 2.7-18.1L322 273s4.8-9.7 12.2-13c.6-.3 2.3-1 4.5-1.5 8.1-2.1 18 2.8 18 2.8L467.4 315s12.6 5.7 15.3 16.2c1.9 7.4-.5 14-1.8 17.2-6.3 15.4-55 113.1-55 113.1z" />
<path d="M326.8 380.1c-8.2.1-15.4 5.8-17.3 13.8-1.9 8 2 16.3 9.1 20 7.7 4 17.5 1.8 22.7-5.4 5.1-7.1 4.3-16.9-1.8-23.1l24-49.1c1.5.1 3.7.2 6.2-.5 4.1-.9 7.1-3.6 7.1-3.6 4.2 1.8 8.6 3.8 13.2 6.1 4.8 2.4 9.3 4.9 13.4 7.3.9.5 1.8 1.1 2.8 1.9 1.6 1.3 3.4 3.1 4.7 5.5 1.9 5.5-1.9 14.9-1.9 14.9-2.3 7.6-18.4 40.6-18.4 40.6-8.1-.2-15.3 5-17.7 12.5-2.6 8.1 1.1 17.3 8.9 21.3 7.8 4 17.4 1.7 22.5-5.3 5-6.8 4.6-16.3-1.1-22.6 1.9-3.7 3.7-7.4 5.6-11.3 5-10.4 13.5-30.4 13.5-30.4.9-1.7 5.7-10.3 2.7-21.3-2.5-11.4-12.6-16.7-12.6-16.7-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3 4.7-9.7 9.4-19.3 14.1-29-4.1-2-8.1-4-12.2-6.1-4.8 9.8-9.7 19.7-14.5 29.5-6.7-.1-12.9 3.5-16.1 9.4-3.4 6.3-2.7 14.1 1.9 19.8l-24.6 50.4z" />
</g>
</svg>
);
};

export const GitHub = () => {
return (
<svg viewBox="0 0 24 24" aria-hidden="true" className={socialMediaColours}>
<path
Expand All @@ -13,23 +33,23 @@ export const GitHubSvg = () => {
);
};

export const TwitterSvg = () => {
export const Twitter = () => {
return (
<svg viewBox="0 0 24 24" aria-hidden="true" className={socialMediaColours}>
<path d="M20.055 7.983c.011.174.011.347.011.523 0 5.338-3.92 11.494-11.09 11.494v-.003A10.755 10.755 0 0 1 3 18.186c.308.038.618.057.928.058a7.655 7.655 0 0 0 4.841-1.733c-1.668-.032-3.13-1.16-3.642-2.805a3.753 3.753 0 0 0 1.76-.07C5.07 13.256 3.76 11.6 3.76 9.676v-.05a3.77 3.77 0 0 0 1.77.505C3.816 8.945 3.288 6.583 4.322 4.737c1.98 2.524 4.9 4.058 8.034 4.22a4.137 4.137 0 0 1 1.128-3.86A3.807 3.807 0 0 1 19 5.274a7.657 7.657 0 0 0 2.475-.98c-.29.934-.9 1.729-1.713 2.233A7.54 7.54 0 0 0 22 5.89a8.084 8.084 0 0 1-1.945 2.093Z"></path>
</svg>
);
};

export const LinkedInSvg = () => {
export const LinkedIn = () => {
return (
<svg viewBox="0 0 24 24" aria-hidden="true" className={socialMediaColours}>
<path d="M18.335 18.339H15.67v-4.177c0-.996-.02-2.278-1.39-2.278-1.389 0-1.601 1.084-1.601 2.205v4.25h-2.666V9.75h2.56v1.17h.035c.358-.674 1.228-1.387 2.528-1.387 2.7 0 3.2 1.778 3.2 4.091v4.715zM7.003 8.575a1.546 1.546 0 01-1.548-1.549 1.548 1.548 0 111.547 1.549zm1.336 9.764H5.666V9.75H8.34v8.589zM19.67 3H4.329C3.593 3 3 3.58 3 4.297v15.406C3 20.42 3.594 21 4.328 21h15.338C20.4 21 21 20.42 21 19.703V4.297C21 3.58 20.4 3 19.666 3h.003z"></path>
</svg>
);
};

export const InstagramSvg = () => {
export const Instagram = () => {
return (
<svg viewBox="0 0 24 24" aria-hidden="true" className={socialMediaColours}>
<path d="M12 3c-2.444 0-2.75.01-3.71.054-.959.044-1.613.196-2.185.418A4.412 4.412 0 0 0 4.51 4.511c-.5.5-.809 1.002-1.039 1.594-.222.572-.374 1.226-.418 2.184C3.01 9.25 3 9.556 3 12s.01 2.75.054 3.71c.044.959.196 1.613.418 2.185.23.592.538 1.094 1.039 1.595.5.5 1.002.808 1.594 1.038.572.222 1.226.374 2.184.418C9.25 20.99 9.556 21 12 21s2.75-.01 3.71-.054c.959-.044 1.613-.196 2.185-.419a4.412 4.412 0 0 0 1.595-1.038c.5-.5.808-1.002 1.038-1.594.222-.572.374-1.226.418-2.184.044-.96.054-1.267.054-3.711s-.01-2.75-.054-3.71c-.044-.959-.196-1.613-.419-2.185A4.412 4.412 0 0 0 19.49 4.51c-.5-.5-1.002-.809-1.594-1.039-.572-.222-1.226-.374-2.184-.418C14.75 3.01 14.444 3 12 3Zm0 1.622c2.403 0 2.688.009 3.637.052.877.04 1.354.187 1.67.31.421.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.671.043.95.052 1.234.052 3.637s-.009 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.421-.358.72-.673 1.036a2.79 2.79 0 0 1-1.035.673c-.317.123-.794.27-1.671.31-.95.043-1.234.052-3.637.052s-2.688-.009-3.637-.052c-.877-.04-1.354-.187-1.67-.31a2.789 2.789 0 0 1-1.036-.673 2.79 2.79 0 0 1-.673-1.035c-.123-.317-.27-.794-.31-1.671-.043-.95-.052-1.234-.052-3.637s.009-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.421.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.671-.31.95-.043 1.234-.052 3.637-.052Z"></path>
Expand Down
Loading

0 comments on commit a25b564

Please sign in to comment.