Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 718868f780 | |||
| 3b93e5fe6a | |||
| b0f2811b42 |
@@ -33,6 +33,11 @@ export default function RootLayout({
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<head>
|
||||
<meta httpEquiv="Cache-Control" content="max-age=3600, must-revalidate" />
|
||||
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
</head>
|
||||
<ServiceWrapper>
|
||||
<body
|
||||
className={`${halant.variable} ${inter.variable} ${openSans.variable} antialiased`}
|
||||
|
||||
@@ -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 (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="hover-bubble"
|
||||
|
||||
Reference in New Issue
Block a user