diff --git a/src/app/projects/[slug]/layout.tsx b/src/app/projects/[slug]/layout.tsx index e67c1e5..b8ba8f2 100644 --- a/src/app/projects/[slug]/layout.tsx +++ b/src/app/projects/[slug]/layout.tsx @@ -1,5 +1,5 @@ import { Footer } from "@/components/Footer"; -import { ProjectNavbar } from "@/components/Project/Navbar"; +import { Navbar } from "@/components/Navbar"; export default function ProjectsLayout({ children, @@ -8,7 +8,7 @@ export default function ProjectsLayout({ }) { return ( <> - +
{children}
diff --git a/src/components/Home/Projects/Project.tsx b/src/components/Home/Projects/Project.tsx index f82d2d4..3fd409e 100644 --- a/src/components/Home/Projects/Project.tsx +++ b/src/components/Home/Projects/Project.tsx @@ -43,7 +43,7 @@ export const Project: React.FC = ({ project }) => { className="mb-20 lg:mb-24 last:mb-0 flex flex-col" initial="offscreen" whileInView="onscreen" - viewport={{ once: true, amount: 0.5 }} + viewport={{ once: true, amount: 0.3 }} transition={{ staggerChildren: 0.3 }} > {project.comingSoon ? ( diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar.tsx similarity index 92% rename from src/components/Navbar/index.tsx rename to src/components/Navbar.tsx index 9096708..3859557 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar.tsx @@ -4,7 +4,7 @@ import { CONTRA_LINK } from "@/utils/constants"; export const Navbar: React.FC = () => { return ( -
+
diff --git a/src/components/Project/Block/CarouselBlock/index.tsx b/src/components/Project/Block/CarouselBlock/index.tsx index 7c4298c..0c45632 100644 --- a/src/components/Project/Block/CarouselBlock/index.tsx +++ b/src/components/Project/Block/CarouselBlock/index.tsx @@ -1,20 +1,9 @@ -import { - BaseBlock, - CarouselBlock as ICarouselBlock, - ProjectBlock, - ProjectBlockType, -} from "@/types/global"; +import { CarouselBlock as ICarouselBlock } from "@/types/global"; import { Carousel } from "./Carousel"; import "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a loader -export function blockIsCarouselBlock( - block: Partial | ProjectBlock -): block is ICarouselBlock { - return block.type === ProjectBlockType.CAROUSEL; -} - interface CarouselBlockProps { block: ICarouselBlock; } diff --git a/src/components/Project/Block/FullScreenBlock.tsx b/src/components/Project/Block/FullScreenBlock.tsx index 272bc2a..f4a9c8b 100644 --- a/src/components/Project/Block/FullScreenBlock.tsx +++ b/src/components/Project/Block/FullScreenBlock.tsx @@ -1,17 +1,6 @@ import Image from "next/image"; -import { - BaseBlock, - FullScreenBlock as IFullScreenBlock, - ProjectBlock, - ProjectBlockType, -} from "@/types/global"; - -export function blockIsFullScreenBlock( - block: Partial | ProjectBlock -): block is IFullScreenBlock { - return block.type === ProjectBlockType.FULL_SCREEN; -} +import { FullScreenBlock as IFullScreenBlock } from "@/types/global"; interface FullScreenBlockProps { block: IFullScreenBlock; diff --git a/src/components/Project/Block/GridBlock/index.tsx b/src/components/Project/Block/GridBlock/index.tsx index 42d169c..8cc47a0 100644 --- a/src/components/Project/Block/GridBlock/index.tsx +++ b/src/components/Project/Block/GridBlock/index.tsx @@ -1,19 +1,7 @@ import classnames from "classnames"; import Image from "next/image"; -import { - BaseBlock, - GridBlock as IGridBlock, - GridBlockSpacing, - ProjectBlock, - ProjectBlockType, -} from "@/types/global"; - -export function blockIsGridBlock( - block: Partial | ProjectBlock -): block is IGridBlock { - return block.type === ProjectBlockType.GRID_BLOCK; -} +import { GridBlock as IGridBlock, GridBlockSpacing } from "@/types/global"; interface FullScreenBlockProps { block: IGridBlock; diff --git a/src/components/Project/Block/ProjectInfoBlock.tsx b/src/components/Project/Block/ProjectInfoBlock.tsx index 177a908..c7fc612 100644 --- a/src/components/Project/Block/ProjectInfoBlock.tsx +++ b/src/components/Project/Block/ProjectInfoBlock.tsx @@ -1,16 +1,30 @@ +"use client"; + +import { motion, Variants } from "framer-motion"; + import { RichText } from "@/components/Richtext"; -import { - BaseBlock, - ProjectBlock, - ProjectBlockType, - ProjectInfoBlock as IProjectInfoBlock, -} from "@/types/global"; - -export function blockIsProjectInfoBlock( - block: Partial | ProjectBlock -): block is IProjectInfoBlock { - return block.type === ProjectBlockType.PROJECT_INFO; -} +import { ProjectInfoBlock as IProjectInfoBlock } from "@/types/global"; + +const variants: Variants = { + offscreen: { + y: 50, + opacity: 0, + }, + onscreen: { + y: 0, + opacity: 1, + transition: { + delay: 3.3, + y: { + type: "spring", + duration: 1.3, + }, + opacity: { + duration: 0.3, + }, + }, + }, +}; interface LineProps { title: string; @@ -18,10 +32,13 @@ interface LineProps { } const Line: React.FC = ({ title, value }) => ( -
+ {title} {value} -
+ ); interface ProjectInfoBlockProps { @@ -33,26 +50,34 @@ export const ProjectInfoBlock: React.FC = ({ }) => { return (
-
-

{block.title}

- + + + {block.title} + + - + -
- {block.info.team && } + {block.info.team && } - {block.info.client && ( - - )} + {block.info.client && } - {block.info.role && } + {block.info.role && } - {block.info.skills && ( - - )} -
-
+ {block.info.skills && } +
); }; diff --git a/src/components/Project/Block/TitleAndTextBlock.tsx b/src/components/Project/Block/TitleAndTextBlock.tsx index 0c31e21..88470e5 100644 --- a/src/components/Project/Block/TitleAndTextBlock.tsx +++ b/src/components/Project/Block/TitleAndTextBlock.tsx @@ -1,16 +1,5 @@ import { RichText } from "@/components/Richtext"; -import { - BaseBlock, - ProjectBlock, - ProjectBlockType, - TitleAndTextBlock as ITitleAndTextBlock, -} from "@/types/global"; - -export function blockIsTitleAndTextBlock( - block: Partial | ProjectBlock -): block is ITitleAndTextBlock { - return block.type === ProjectBlockType.TITLE_AND_TEXT; -} +import { TitleAndTextBlock as ITitleAndTextBlock } from "@/types/global"; interface TitleAndTextBlockProps { block: ITitleAndTextBlock; diff --git a/src/components/Project/Block/TwoTitlesAndParagraphBlock.tsx b/src/components/Project/Block/TwoTitlesAndParagraphBlock.tsx index 4567e06..8e520a9 100644 --- a/src/components/Project/Block/TwoTitlesAndParagraphBlock.tsx +++ b/src/components/Project/Block/TwoTitlesAndParagraphBlock.tsx @@ -1,9 +1,4 @@ -import { - BaseBlock, - ProjectBlock, - ProjectBlockType, - TwoTitlesAndParagraphBlock as ITwoTitlesAndParagraphBlock, -} from "@/types/global"; +import { TwoTitlesAndParagraphBlock as ITwoTitlesAndParagraphBlock } from "@/types/global"; interface ParagraphProps { mb?: string; @@ -24,12 +19,6 @@ const Paragraph: React.FC = ({ paragraph, mb = "" }) => (
); -export function blockIsTwoTitlesAndParagraphBlock( - block: Partial | ProjectBlock -): block is ITwoTitlesAndParagraphBlock { - return block.type === ProjectBlockType.TWO_TITLES_AND_PARAGRAPH; -} - interface TwoTitlesAndParagraphBlockProps { block: ITwoTitlesAndParagraphBlock; } diff --git a/src/components/Project/Block/index.tsx b/src/components/Project/Block/index.tsx index f7afeeb..7c89b31 100644 --- a/src/components/Project/Block/index.tsx +++ b/src/components/Project/Block/index.tsx @@ -1,44 +1,60 @@ -import { BaseBlock, ProjectBlock } from "@/types/global"; - -import { blockIsCarouselBlock, CarouselBlock } from "./CarouselBlock"; -import { blockIsFullScreenBlock, FullScreenBlock } from "./FullScreenBlock"; -import { blockIsGridBlock, GridBlock } from "./GridBlock"; -import { blockIsProjectInfoBlock, ProjectInfoBlock } from "./ProjectInfoBlock"; -import { - blockIsTitleAndTextBlock, - TitleAndTextBlock, -} from "./TitleAndTextBlock"; import { - blockIsTwoTitlesAndParagraphBlock, - TwoTitlesAndParagraphBlock, -} from "./TwoTitlesAndParagraphBlock"; + BaseBlock, + CarouselBlock as ICarouselBlock, + FullScreenBlock as IFullScreenBlock, + GridBlock as IGridBlock, + ProjectBlock, + ProjectBlockType, + ProjectInfoBlock as IProjectInfoBlock, + TitleAndTextBlock as ITitleAndTextBlock, + TwoTitlesAndParagraphBlock as ITwoTitlesAndParagraphBlock, +} from "@/types/global"; + +import { CarouselBlock } from "./CarouselBlock"; +import { FullScreenBlock } from "./FullScreenBlock"; +import { GridBlock } from "./GridBlock"; +import { ProjectInfoBlock } from "./ProjectInfoBlock"; +import { TitleAndTextBlock } from "./TitleAndTextBlock"; +import { TwoTitlesAndParagraphBlock } from "./TwoTitlesAndParagraphBlock"; interface BlockProps { block: Partial | ProjectBlock; } +function blockIs( + block: Partial, + type: T["type"] +): block is T { + return block.type === type; +} + const Block: React.FC = ({ block }) => { - if (blockIsProjectInfoBlock(block)) { + if (blockIs(block, ProjectBlockType.PROJECT_INFO)) { return ; } - if (blockIsTwoTitlesAndParagraphBlock(block)) { + if ( + blockIs( + block, + ProjectBlockType.TWO_TITLES_AND_PARAGRAPH + ) + ) { return ; } - if (blockIsTitleAndTextBlock(block)) { + if (blockIs(block, ProjectBlockType.TITLE_AND_TEXT)) { return ; } - if (blockIsGridBlock(block)) { + if (blockIs(block, ProjectBlockType.GRID_BLOCK)) { return ; } - if (blockIsCarouselBlock(block)) { + if (blockIs(block, ProjectBlockType.CAROUSEL)) { return ; } - if (blockIsFullScreenBlock(block)) { + if (blockIs(block, ProjectBlockType.FULL_SCREEN)) { return ; } diff --git a/src/components/Project/Navbar/BurgerMenu.tsx b/src/components/Project/Navbar/BurgerMenu.tsx deleted file mode 100644 index 80e9148..0000000 --- a/src/components/Project/Navbar/BurgerMenu.tsx +++ /dev/null @@ -1,17 +0,0 @@ -interface BurgerMenuProps { - color: string; - isOpen: boolean; - onClick: VoidFunction; -} - -export const BurgerMenu: React.FC> = ({ - color, - isOpen, - onClick, -}) => ( -
-
-
-
-
-); diff --git a/src/components/Project/Navbar/index.tsx b/src/components/Project/Navbar/index.tsx deleted file mode 100644 index 695fae9..0000000 --- a/src/components/Project/Navbar/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import Link from "next/link"; - -import { CONTRA_LINK } from "@/utils/constants"; - -export const ProjectNavbar: React.FC = ({}) => { - return ( -
-
- - - Beatrice Duguid Cox - - -
- - -
- ); -};