From 27af03ba3ada5dd450fb2c6183af7f4997ecd593 Mon Sep 17 00:00:00 2001 From: Unchained Date: Wed, 1 Apr 2026 06:14:49 +0200 Subject: [PATCH] feat(performance): optimize Core Web Vitals with CSS animations and lazy analytics - Replace framer-motion with CSS animations in TrustBadges, AsSeenIn, ProblemSection - Create AnalyticsProvider client component for OpenPanel lazy-loading - Fix HeroVideo CLS with explicit aspect-ratio (4/3) - Remove deprecated swcMinify from next.config (enabled by default) - Add optimizePackageImports for better tree-shaking --- next.config.ts | 2 +- src/app/[locale]/layout.tsx | 11 +-- src/components/home/AsSeenIn.tsx | 54 ++++++------- src/components/home/HeroVideo.tsx | 2 +- src/components/home/ProblemSection.tsx | 59 +++++++++----- src/components/home/TrustBadges.tsx | 76 +++++++------------ .../providers/AnalyticsProvider.tsx | 24 ++++++ 7 files changed, 122 insertions(+), 106 deletions(-) create mode 100644 src/components/providers/AnalyticsProvider.tsx diff --git a/next.config.ts b/next.config.ts index 63b7117..7526f98 100644 --- a/next.config.ts +++ b/next.config.ts @@ -69,7 +69,7 @@ const nextConfig: NextConfig = { ], }, experimental: { - optimizePackageImports: ["lucide-react", "framer-motion"], + optimizePackageImports: ["lucide-react", "framer-motion", "clsx", "motion"], }, }; diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index fdd8c66..a80fb97 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -2,10 +2,9 @@ import { Metadata } from "next"; import { NextIntlClientProvider } from "next-intl"; import { getMessages, setRequestLocale } from "next-intl/server"; import { SUPPORTED_LOCALES, DEFAULT_LOCALE, isValidLocale } from "@/lib/i18n/locales"; -import { OpenPanelComponent } from "@openpanel/nextjs"; import Script from "next/script"; +import AnalyticsProvider from "@/components/providers/AnalyticsProvider"; -// Rybbit configuration const RYBBIT_SITE_ID = process.env.NEXT_PUBLIC_RYBBIT_SITE_ID || "1"; const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://manoonoils.com"; @@ -50,13 +49,7 @@ export default async function LocaleLayout({ return ( <> - +