diff --git a/public/fonts/Inter-Bold.woff2 b/public/fonts/Inter-Bold.woff2 new file mode 100644 index 0000000..0f1b157 Binary files /dev/null and b/public/fonts/Inter-Bold.woff2 differ diff --git a/public/fonts/Inter-Regular.woff2 b/public/fonts/Inter-Regular.woff2 new file mode 100644 index 0000000..b8699af Binary files /dev/null and b/public/fonts/Inter-Regular.woff2 differ diff --git a/public/js/scroll.js b/public/js/scroll.js new file mode 100644 index 0000000..958af13 --- /dev/null +++ b/public/js/scroll.js @@ -0,0 +1,10 @@ +function onScroll() { + const header = document.getElementById("header"); + if (window.scrollY > 0) { + header.classList.add("scrolled"); + } else { + header.classList.remove("scrolled"); + } +} + +document.addEventListener("scroll", onScroll); diff --git a/public/pattern.svg b/public/pattern.svg deleted file mode 100644 index 1fbcc87..0000000 --- a/public/pattern.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro new file mode 100644 index 0000000..82ae633 --- /dev/null +++ b/src/components/BaseHead.astro @@ -0,0 +1,58 @@ +--- +interface Props { + title: string; + description: string; + image?: string; +} + +const canonicalURL = new URL(Astro.url.pathname, Astro.site); + +const { title, description } = Astro.props; +--- + + + + + + + + + + + + + + + + + +{title} + + + + + + + + diff --git a/src/components/Button.astro b/src/components/Button.astro index f2337c4..cfa2679 100644 --- a/src/components/Button.astro +++ b/src/components/Button.astro @@ -4,7 +4,7 @@ const { link, text } = Astro.props; {text} diff --git a/src/components/Container.astro b/src/components/Container.astro new file mode 100644 index 0000000..a21bcf3 --- /dev/null +++ b/src/components/Container.astro @@ -0,0 +1,22 @@ +--- +import { cn } from "@/lib/utils"; + +type Props = { + size: "sm" | "md" | "lg" | "xl" | "2xl"; +}; + +const { size } = Astro.props; +--- + +
+ +
diff --git a/src/components/Drawer.astro b/src/components/Drawer.astro new file mode 100644 index 0000000..5c852fb --- /dev/null +++ b/src/components/Drawer.astro @@ -0,0 +1,38 @@ +--- +import { LINKS } from "@/consts"; +import { cn } from "@/lib/utils"; +const { pathname } = Astro.url; +const subpath = pathname.match(/[^/]+/g); +--- + + + + diff --git a/src/components/Header.astro b/src/components/Header.astro index daae5a7..4d34f6f 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,47 +1,125 @@ --- -import path from "./path.json"; -import { basics } from "@cv"; -import MobileMenu from "./MobileMenu"; -const { nickname } = basics; +import { SITE, LINKS } from "@/consts"; +import { cn } from "@/lib/utils"; +const { pathname } = Astro.url; +const subpath = pathname.match(/[^/]+/g); +import Container from "@/components/Container.astro"; --- - + + + + diff --git a/src/components/MobileMenu.tsx b/src/components/MobileMenu.tsx deleted file mode 100644 index 145296c..0000000 --- a/src/components/MobileMenu.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import React, { useState, useEffect } from "react"; -import { motion, AnimatePresence } from "framer-motion"; - -interface MobileMenuProps { - children: React.ReactNode; -} - -const MobileMenu: React.FC = ({ children }) => { - const [isOpen, setIsOpen] = useState(false); - - const toggleMenu = () => { - setIsOpen(!isOpen); - }; - - useEffect(() => { - if (isOpen) { - window.applyMenuItemClasses(); - } - }, [isOpen]); - - return ( - <> - - - {isOpen && ( - - {children} - - )} - - - ); -}; - -export default MobileMenu; diff --git a/src/consts.ts b/src/consts.ts new file mode 100644 index 0000000..f862960 --- /dev/null +++ b/src/consts.ts @@ -0,0 +1,27 @@ +import type { Site, Links } from "@/types"; + +export const SITE: Site = { + TITLE: "Rxyhn", + DESCRIPTION: "Rxyhn's personal website", + AUTHOR: "Rayhan Pratama", +}; + +// Links +export const LINKS: Links = [ + { + TEXT: "Home", + HREF: "/", + }, + { + TEXT: "Projects", + HREF: "/projects", + }, + { + TEXT: "About", + HREF: "/about", + }, + { + TEXT: "Contacts", + HREF: "/contacts", + }, +]; diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index b4ab595..d9989cf 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,30 +1,24 @@ --- +import "@/styles/global.css"; +import BaseHead from "@/components/BaseHead.astro"; import Header from "@/components/Header.astro"; +import Drawer from "@/components/Drawer.astro"; import Footer from "@/components/Footer.astro"; import Starry from "@/components/Starry"; import Boxes from "@/components/Boxes"; -const { title } = Astro.props; +const { title, description } = Astro.props; +import { SITE } from "@/consts"; --- - - - {title} - - - - + - +
+ -
+