From 5e33395a9b16572dd73fad27c1bdc3c6a7b8156e Mon Sep 17 00:00:00 2001 From: MOH Date: Mon, 9 Mar 2026 08:03:57 +0100 Subject: [PATCH] Refine localized header branding --- components/layout/site-header.tsx | 136 +++++++++++++++++++++--------- 1 file changed, 94 insertions(+), 42 deletions(-) diff --git a/components/layout/site-header.tsx b/components/layout/site-header.tsx index 2077456..96f7354 100644 --- a/components/layout/site-header.tsx +++ b/components/layout/site-header.tsx @@ -1,11 +1,11 @@ "use client"; -import { AnimatePresence, motion } from "framer-motion"; +import { AnimatePresence, motion, useReducedMotion } from "framer-motion"; import { LayoutDashboard, Menu, X } from "lucide-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useLocale, useTranslations } from "next-intl"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { Container } from "@/components/layout/container"; import { LocaleToggle } from "@/components/layout/locale-toggle"; @@ -127,10 +127,15 @@ export function SiteHeader({ darkLogoUrl, }: SiteHeaderProps) { const [isOpen, setIsOpen] = useState(false); + const [isScrolled, setIsScrolled] = useState(false); const pathname = usePathname(); const locale = useLocale(); const t = useTranslations("navigation"); + const reducedMotion = useReducedMotion(); const isArabic = locale === "ar"; + const brandSubtitle = isArabic + ? "مــــــطـــــــــــــور ويــــــــــب | فــــــــــــريــــــلانــــــســــــر" + : "Webdesigner Bremen | Freelancer"; const desktopControlRailClassName = "inline-flex items-center gap-1 rounded-pill border border-border/70 bg-background/80 p-1 shadow-panel backdrop-blur-chrome"; const desktopControlButtonClassName = @@ -138,19 +143,40 @@ export function SiteHeader({ const mobileControlButtonClassName = "h-10 w-10 rounded-pill border border-border/70 bg-background text-foreground/80 shadow-xs hover:bg-accent hover:text-foreground"; + useEffect(() => { + const handleScroll = () => { + setIsScrolled(window.scrollY > 24); + }; + + handleScroll(); + window.addEventListener("scroll", handleScroll, { passive: true }); + + return () => { + window.removeEventListener("scroll", handleScroll); + }; + }, []); + return (
-
+ - - {brandTitleCharacters.map(({ character, tone }, index) => ( - - {character === " " ? "\u00A0" : character} - - ))} - + {isArabic ? ( + + مــــحـــمــد + فــــرواتـــي + + ) : ( + + {brandTitleCharacters.map(({ character, tone }, index) => ( + + {character === " " ? "\u00A0" : character} + + ))} + + )} - Webdesigner Bremen | Freelancer + {brandSubtitle} -
+ -
+
@@ -208,13 +257,16 @@ export function SiteHeader({
-
- +
+