From 814447ae5d01babada119bfe8fc17a75567252b5 Mon Sep 17 00:00:00 2001 From: MOH Date: Tue, 10 Mar 2026 18:38:59 +0100 Subject: [PATCH] Optimize local fonts and remove hero motion --- README.md | 2 +- app/layout.tsx | 21 +--- components/layout/hero-motion-backdrop.tsx | 124 ++------------------- components/layout/home-hero.tsx | 28 +---- components/layout/site-hero.tsx | 85 +++----------- 5 files changed, 31 insertions(+), 229 deletions(-) diff --git a/README.md b/README.md index 3660b7e..859c528 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. +This project uses [`next/font/local`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to load local font assets from `app/fonts` without relying on external font providers. ## Learn More diff --git a/app/layout.tsx b/app/layout.tsx index 724aafa..03db705 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -13,11 +13,6 @@ import "./globals.css"; const museo = localFont({ src: [ - { - path: "./fonts/MuseoSansRounded100.woff2", - weight: "100", - style: "normal", - }, { path: "./fonts/MuseoSansRounded300.woff2", weight: "300", @@ -38,14 +33,12 @@ const museo = localFont({ weight: "900", style: "normal", }, - { - path: "./fonts/MuseoSansRounded1000.woff2", - weight: "1000", - style: "normal", - }, ], variable: "--font-museo", display: "swap", + preload: false, + fallback: ["Arial", "Helvetica", "sans-serif"], + adjustFontFallback: "Arial", }); const dubai = localFont({ @@ -60,11 +53,6 @@ const dubai = localFont({ weight: "400", style: "normal", }, - { - path: "./fonts/Dubai-Medium.woff2", - weight: "500", - style: "normal", - }, { path: "./fonts/Dubai-Bold.woff2", weight: "700", @@ -73,6 +61,9 @@ const dubai = localFont({ ], variable: "--font-dubai", display: "swap", + preload: false, + fallback: ["Tahoma", "Arial", "sans-serif"], + adjustFontFallback: "Arial", }); export const dynamic = "force-dynamic"; diff --git a/components/layout/hero-motion-backdrop.tsx b/components/layout/hero-motion-backdrop.tsx index 2535d47..8c2c44a 100644 --- a/components/layout/hero-motion-backdrop.tsx +++ b/components/layout/hero-motion-backdrop.tsx @@ -1,129 +1,19 @@ "use client"; -import { motion, useReducedMotion } from "framer-motion"; - type HeroMotionBackdropProps = { compact?: boolean; }; -export function HeroMotionBackdrop({ compact = false }: HeroMotionBackdropProps) { - const reducedMotion = useReducedMotion(); - +export function HeroMotionBackdrop({}: HeroMotionBackdropProps) { return (
- - - - - - - - - +
+
+
+
+
+
diff --git a/components/layout/home-hero.tsx b/components/layout/home-hero.tsx index 526a0e2..3fdc535 100644 --- a/components/layout/home-hero.tsx +++ b/components/layout/home-hero.tsx @@ -1,7 +1,5 @@ "use client"; -import { motion, useReducedMotion } from "framer-motion"; - import { HeroBadge } from "@/components/layout/hero-badge"; import { HeroContentMotion, @@ -23,7 +21,6 @@ export function HomeHero({ title, description, }: HomeHeroProps) { - const reducedMotion = useReducedMotion(); const titleLines = title.split("\n").filter(Boolean); const isArabic = locale === "ar"; const lines = isArabic @@ -73,33 +70,12 @@ export function HomeHero({