From 94ecbea2f1c4310550aa43b40d859b7b2892a5c9 Mon Sep 17 00:00:00 2001 From: Nitin23123 <166863746+Nitin23123@users.noreply.github.com> Date: Tue, 24 Mar 2026 13:40:34 +0530 Subject: [PATCH] fix: resolve CLS on 8 pages caused by Discord stats, Google Translate, and hero stats --- app/(core)/components/FullLandingPage.tsx | 8 ++++---- app/(core)/styles/landing.css | 1 + app/(core)/styles/translator.css | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app/(core)/components/FullLandingPage.tsx b/app/(core)/components/FullLandingPage.tsx index c1ce4b15..33a46692 100644 --- a/app/(core)/components/FullLandingPage.tsx +++ b/app/(core)/components/FullLandingPage.tsx @@ -12,10 +12,10 @@ import ScrollDown from "./ScrollDown"; export default function FullLandingPage() { const [stats, setStats] = useState({ - online: null, - visibleMembers: null, - channels: null, - voiceActive: null, + online: 0, + visibleMembers: 0, + channels: 0, + voiceActive: 0, serverName: "", }); diff --git a/app/(core)/styles/landing.css b/app/(core)/styles/landing.css index fb4deda1..55e9824b 100644 --- a/app/(core)/styles/landing.css +++ b/app/(core)/styles/landing.css @@ -235,6 +235,7 @@ display: block; font-weight: 700; font-variant-numeric: tabular-nums; + min-width: 2ch; } @media (max-width: 640px) { diff --git a/app/(core)/styles/translator.css b/app/(core)/styles/translator.css index bfa2d8f0..d8abd832 100644 --- a/app/(core)/styles/translator.css +++ b/app/(core)/styles/translator.css @@ -75,6 +75,20 @@ display: none; } +/* Prevent Google Translate injected iframe from causing CLS */ +.goog-te-banner-frame, +#goog-gt-tt, +.goog-te-balloon-frame, +.goog-tooltip, +.goog-tooltip-content { + display: none !important; +} + +body { + top: 0 !important; + position: static !important; +} + /* Globe icon */ .globe-icon { position: absolute;