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
This commit is contained in:
24
src/components/providers/AnalyticsProvider.tsx
Normal file
24
src/components/providers/AnalyticsProvider.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
const OpenPanelComponent = dynamic(
|
||||
() => import("@openpanel/nextjs").then((mod) => mod.OpenPanelComponent),
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
interface AnalyticsProviderProps {
|
||||
clientId: string;
|
||||
}
|
||||
|
||||
export default function AnalyticsProvider({ clientId }: AnalyticsProviderProps) {
|
||||
return (
|
||||
<OpenPanelComponent
|
||||
clientId={clientId}
|
||||
trackScreenViews={true}
|
||||
trackOutgoingLinks={true}
|
||||
apiUrl="/api/op"
|
||||
scriptUrl="/api/op1"
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user