diff --git a/components/layout/site-header.tsx b/components/layout/site-header.tsx
index ff3d8ac..1f5e1ba 100644
--- a/components/layout/site-header.tsx
+++ b/components/layout/site-header.tsx
@@ -24,47 +24,24 @@ const navItems = [
{ key: "contact", path: "/contact" },
];
-const brandTitleCharacters = [
- ...Array.from("MOH").map((character) => ({ character, tone: "base" as const })),
- { character: " ", tone: "space" as const },
- ...Array.from("FARAWATI").map((character) => ({ character, tone: "accent" as const })),
-];
-const brandShellVariants = {
- hidden: {},
- visible: {
- transition: {
- staggerChildren: 0.035,
- delayChildren: 0.18,
- },
- },
-} as const;
-const brandCharacterVariants = {
- hidden: {
- opacity: 0,
- y: 18,
- rotateX: -80,
- filter: "blur(8px)",
- },
- visible: {
- opacity: 1,
- y: 0,
- rotateX: 0,
- filter: "blur(0px)",
- transition: {
- type: "spring" as const,
- stiffness: 280,
- damping: 20,
- mass: 0.8,
- },
- },
-} as const;
-
type SiteHeaderProps = {
isAdmin?: boolean;
lightLogoUrl?: string | null;
darkLogoUrl?: string | null;
};
+function getDirectionalReveal(direction: "rtl" | "ltr") {
+ return direction === "rtl"
+ ? {
+ initial: { opacity: 0, x: -16, clipPath: "inset(0 0 0 100%)", filter: "blur(10px)" },
+ animate: { opacity: 1, x: 0, y: 0, clipPath: "inset(0 0 0 0)", filter: "blur(0px)" },
+ }
+ : {
+ initial: { opacity: 0, x: 16, clipPath: "inset(0 100% 0 0)", filter: "blur(10px)" },
+ animate: { opacity: 1, x: 0, y: 0, clipPath: "inset(0 0 0 0)", filter: "blur(0px)" },
+ };
+}
+
function isNavItemActive(currentPath: string, itemPath: string) {
if (itemPath === "/") {
return currentPath === "/";
@@ -134,6 +111,29 @@ export function SiteHeader({
const t = useTranslations("navigation");
const reducedMotion = useReducedMotion();
const isArabic = locale === "ar";
+ const languageDirection = isArabic ? "rtl" : "ltr";
+ const titleMotion = getDirectionalReveal(languageDirection);
+ const subtitleMotion = getDirectionalReveal(languageDirection);
+ const navEntranceInitial = reducedMotion ? false : { opacity: 0, y: -14, scale: 0.985, filter: "blur(8px)" };
+ const navEntranceVisible = { opacity: 1, y: 0, scale: 1, filter: "blur(0px)" };
+ const controlEntranceInitial = reducedMotion
+ ? false
+ : {
+ opacity: 0,
+ x: languageDirection === "rtl" ? -18 : 18,
+ scale: 0.98,
+ filter: "blur(8px)",
+ };
+ const controlEntranceVisible = { opacity: 1, x: 0, scale: 1, filter: "blur(0px)" };
+ const mobileMenuInitial = reducedMotion
+ ? false
+ : {
+ opacity: 0,
+ x: languageDirection === "rtl" ? -14 : 14,
+ scale: 0.94,
+ filter: "blur(8px)",
+ };
+ const mobileMenuVisible = { opacity: 1, x: 0, scale: 1, filter: "blur(0px)" };
const brandSubtitle = isArabic
? "مــــــطـــــــــــــور ويــــــــــب | فــــــــــــريــــــلانــــــســــــر"
: "Webdesigner Bremen | Freelancer";
@@ -182,51 +182,39 @@ export function SiteHeader({
priority
className="relative h-10 opacity-95"
replayKey={logoReplayKey}
+ direction={languageDirection}
/>
-