From 98e20269a38c776a0369f34270eb30a3791c8bea Mon Sep 17 00:00:00 2001 From: parsa aghaei Date: Wed, 2 Sep 2026 14:16:07 +0330 Subject: [PATCH] perf(storefront): optimize LCP image delivery, lazy-load scripts, improve WCAG contrast and accessibility --- frontend/application/app/HomeClient.tsx | 16 ++--- frontend/application/app/globals.css | 10 +-- frontend/application/app/layout.tsx | 22 ++++-- .../components/BlogPreviewSection.tsx | 1 + frontend/application/components/Footer.tsx | 6 +- frontend/application/components/Header.tsx | 6 +- frontend/application/components/Hero.tsx | 69 +++++++++++-------- frontend/application/components/SafeImage.tsx | 4 +- 8 files changed, 77 insertions(+), 57 deletions(-) diff --git a/frontend/application/app/HomeClient.tsx b/frontend/application/app/HomeClient.tsx index 9662ee9..2b4841f 100644 --- a/frontend/application/app/HomeClient.tsx +++ b/frontend/application/app/HomeClient.tsx @@ -147,15 +147,15 @@ export default function HomeClient({ initialData }: HomeClientProps) { {toPersian(idx + 1)}
-

{item.title}

-

{item.desc}

+

{item.title}

+

{item.desc}

{idx === 0 && ( - + * تهیه شده با بالاترین استانداردهای دارویی انسان - کاملاً بی‌خطر در صورت لیسیده شدن توسط حیوان. )} {idx === 2 && ( - + * تاییدیه رسمی ایمنی مواد غذایی و دارویی (HACCP & IFS) از اتحادیه اروپا. )} @@ -172,13 +172,7 @@ export default function HomeClient({ initialData }: HomeClientProps) { {/* Call to Action */}
-
-
- {Array.from({ length: 100 }).map((_, i) => ( -
- ))} -
-
+

{getText('cta_title', "می‌خواهید بدانید کدام محصول برای پت شما مناسب‌تر است؟")} diff --git a/frontend/application/app/globals.css b/frontend/application/app/globals.css index d59c18c..37d56cc 100644 --- a/frontend/application/app/globals.css +++ b/frontend/application/app/globals.css @@ -89,11 +89,11 @@ --color-medical-gray-100: #F4F7F6; /* light warm gray for alternate sections */ --color-medical-gray-200: #E5ECE9; /* light box background / border color */ --color-medical-gray-300: #C2D5CE; /* subtle borders */ - --color-medical-gray-400: #9BC8CC; /* card backgrounds / accent borders */ - --color-medical-gray-500: #6B8B8E; /* secondary text */ - --color-medical-gray-600: #4A6366; /* muted dark text */ - --color-medical-gray-700: #2C3E42; /* deep text */ - --color-medical-gray-800: #19272B; /* very dark text */ + --color-medical-gray-400: #7A9B9F; /* card backgrounds / accent borders */ + --color-medical-gray-500: #445D60; /* secondary text - WCAG AA > 5.2:1 contrast */ + --color-medical-gray-600: #33484B; /* muted dark text */ + --color-medical-gray-700: #202F32; /* deep text */ + --color-medical-gray-800: #141F22; /* very dark text */ --color-medical-gray-900: #060709; /* primary font color / logo */ /* Standardized Typography Scale */ diff --git a/frontend/application/app/layout.tsx b/frontend/application/app/layout.tsx index 0432385..481ad87 100644 --- a/frontend/application/app/layout.tsx +++ b/frontend/application/app/layout.tsx @@ -159,6 +159,14 @@ export default async function RootLayout({ return ( + + + + + + + + {/* Google Tag Manager (noscript fallback) */} {isGtmEnabled && ( @@ -192,11 +200,11 @@ export default async function RootLayout({ {children} - {/* Google Tag Manager Script */} + {/* Google Tag Manager Script (Deferred to idle) */} {isGtmEnabled && (