From 87f6585a78bc01be0b1291722d064e00e27bef1a Mon Sep 17 00:00:00 2001 From: Poyraz Avsever Date: Mon, 30 Mar 2026 11:30:12 +0300 Subject: [PATCH] feat(ui): add staggered entry animations using framer-motion and fix typography nesting --- components/about-content.tsx | 59 +++++++++++----------- components/blog-content.tsx | 32 ++++++------ components/home-hero.tsx | 86 ++++++++++++++++----------------- components/motion-wrapper.tsx | 64 ++++++++++++++++++++++++ components/projects-content.tsx | 24 ++++----- 5 files changed, 170 insertions(+), 95 deletions(-) create mode 100644 components/motion-wrapper.tsx diff --git a/components/about-content.tsx b/components/about-content.tsx index 7409c3b..a489530 100644 --- a/components/about-content.tsx +++ b/components/about-content.tsx @@ -1,9 +1,10 @@ -"use client"; +"use client"; import Image from "next/image"; import Link from "next/link"; import { Badge, Card, Typography } from "poyraz-ui/atoms"; import { Sheet, SheetContent, SheetTitle, SheetTrigger } from "poyraz-ui/molecules"; +import { StaggerContainer, StaggerItem } from "@/components/motion-wrapper"; import { BOOKMARKS } from "@/data/bookmarks"; import { certificates } from "@/data/certificates"; import { EDUCATION } from "@/data/education"; @@ -25,21 +26,23 @@ export function AboutContent() {
-
+ {EDUCATION.map((item) => ( - - - {item.title} - - - {item.institution} - - - {item.period} - - + + + + {item.title} + + + {item.institution} + + + {item.period} + + + ))} -
+
@@ -106,21 +109,23 @@ export function AboutContent() {
-
+ {EXPERIENCE.map((item) => ( - - - {item.role} - - - {item.company} - - - {item.period} - - + + + + {item.role} + + + {item.company} + + + {item.period} + + + ))} -
+
diff --git a/components/blog-content.tsx b/components/blog-content.tsx index b2a5813..09dd4b6 100644 --- a/components/blog-content.tsx +++ b/components/blog-content.tsx @@ -1,3 +1,5 @@ +"use client"; + import Link from "next/link"; import { Badge, Card, Typography } from "poyraz-ui/atoms"; import { @@ -10,6 +12,7 @@ import { PaginationNext, PaginationPrevious, } from "poyraz-ui/molecules"; +import { StaggerContainer, StaggerItem } from "@/components/motion-wrapper"; import type { BlogPageData } from "@/data/blog"; type BlogContentProps = { @@ -118,22 +121,23 @@ export function BlogContent({ data }: BlogContentProps) {
{hasArticles ? ( -
+ {data.articles.map((post) => ( - + + + ))} -
+ ) : ( diff --git a/components/home-hero.tsx b/components/home-hero.tsx index 0ee2988..2275606 100644 --- a/components/home-hero.tsx +++ b/components/home-hero.tsx @@ -4,6 +4,7 @@ import Image from "next/image"; import { useRef, useState } from "react"; import { Card, Typography } from "poyraz-ui/atoms"; import { NewsCard } from "poyraz-ui/molecules"; +import { StaggerContainer, StaggerItem, FadeIn } from "@/components/motion-wrapper"; type HomeHeroProps = { news: { @@ -38,52 +39,51 @@ export function HomeHero({ news }: HomeHeroProps) { return (
-
+ {news.map((item) => ( - - ))} -
- - -
-
- - Poyraz - - - {" "} - Avsever - -
- - Teknolojiyi merak eden bir genç. Yazılım geliştirme, yapay zeka ve teknoloji dünyasındaki gelişmeleri takip ediyor. - -
- -
-
- Poyraz Avsever + + + ))} + + + + +
+
+ + Poyraz Avsever + +
+ + Teknolojiyi merak eden bir genç. Yazılım geliştirme, yapay zeka ve teknoloji dünyasındaki gelişmeleri takip ediyor. +
-
- + +
+
+ Poyraz Avsever +
+
+ +
); } diff --git a/components/motion-wrapper.tsx b/components/motion-wrapper.tsx new file mode 100644 index 0000000..9c7aca4 --- /dev/null +++ b/components/motion-wrapper.tsx @@ -0,0 +1,64 @@ +"use client"; + +import { motion } from "framer-motion"; +import type { ReactNode } from "react"; + +type FadeInProps = { + children: ReactNode; + className?: string; + delay?: number; +}; + +export function FadeIn({ children, className, delay = 0 }: FadeInProps) { + return ( + + {children} + + ); +} + +type StaggerContainerProps = { + children: ReactNode; + className?: string; + stagger?: number; +}; + +export function StaggerContainer({ children, className, stagger = 0.06 }: StaggerContainerProps) { + return ( + + {children} + + ); +} + +type StaggerItemProps = { + children: ReactNode; + className?: string; +}; + +export function StaggerItem({ children, className }: StaggerItemProps) { + return ( + + {children} + + ); +} diff --git a/components/projects-content.tsx b/components/projects-content.tsx index d7db257..269f291 100644 --- a/components/projects-content.tsx +++ b/components/projects-content.tsx @@ -3,6 +3,7 @@ import Link from "next/link"; import { Icon } from "@iconify/react"; import { Badge, Card, Typography } from "poyraz-ui/atoms"; import { ImageCard } from "poyraz-ui/molecules"; +import { StaggerContainer, StaggerItem } from "@/components/motion-wrapper"; import { FIGMA_TEMPLATES, MOBILE_APPS, WEB_APPS, type ProjectItem } from "@/data/projects"; import { getGithubRepos, getNpmPackages } from "@/lib/project-feeds"; @@ -43,19 +44,20 @@ function ProjectSection({ title, items }: { title: string; items: ProjectItem[] {title} -
+ {items.map((item) => ( - + + + ))} -
+ ); }