From 3b93e5fe6a96a05f41736aebe057bab2fd18070e Mon Sep 17 00:00:00 2001 From: bender Date: Sat, 7 Mar 2026 16:47:59 +0000 Subject: [PATCH 1/2] Update src/app/layout.tsx --- src/app/layout.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 8298523..0d885c7 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -33,6 +33,11 @@ export default function RootLayout({ }>) { return ( + + + + + Date: Sat, 7 Mar 2026 16:47:59 +0000 Subject: [PATCH 2/2] Update src/app/page.tsx --- src/app/page.tsx | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/app/page.tsx b/src/app/page.tsx index cc5c9ec..5b9210c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -10,8 +10,56 @@ import TestimonialCardFifteen from '@/components/sections/testimonial/Testimonia import ContactCTA from '@/components/sections/contact/ContactCTA'; import FooterBase from '@/components/sections/footer/FooterBase'; import { Car, Wrench, CheckCircle, Phone } from 'lucide-react'; +import { useEffect } from 'react'; + +declare global { + interface Window { + __performanceMetrics?: { + navigationStart?: number; + pageLoadTime?: number; + firstContentfulPaint?: number; + largestContentfulPaint?: number; + }; + } +} export default function LandingPage() { + useEffect(() => { + // Initialize performance monitoring + if (typeof window !== 'undefined' && 'performance' in window) { + const navigationStart = performance.timing?.navigationStart || 0; + const pageLoadTime = performance.timing?.loadEventEnd - navigationStart || 0; + + // Store performance metrics + if (!window.__performanceMetrics) { + window.__performanceMetrics = {}; + } + window.__performanceMetrics.navigationStart = navigationStart; + window.__performanceMetrics.pageLoadTime = pageLoadTime; + + // Log metrics for monitoring + if (process.env.NODE_ENV === 'development') { + console.log('[Performance] Page Load Time:', pageLoadTime, 'ms'); + } + + // Monitor Core Web Vitals using PerformanceObserver + try { + if ('PerformanceObserver' in window) { + const observer = new PerformanceObserver((list) => { + for (const entry of list.getEntries()) { + if (entry.name.includes('navigation')) { + window.__performanceMetrics!.navigationStart = (entry as any).startTime; + } + } + }); + observer.observe({ entryTypes: ['navigation', 'paint', 'largest-contentful-paint'] }); + } + } catch (e) { + // Gracefully handle PerformanceObserver not supported + } + } + }, []); + return (