"use client";
import { useEffect, useState, useRef, useMemo } from "react";
import { Button } from "@/components/ui/button";
import {
Sparkles,
Rocket,
Lock,
Check,
Zap,
Link2,
FileText,
MessageSquare,
Shield,
TrendingUp,
Bell,
} from "lucide-react";
import Link from "next/link";
import { SignedIn, SignedOut } from "@clerk/nextjs";
// Ripple Effect Component
function BackgroundRipple() {
return (
{/* First set of ripples */}
{/* Additional slower ripples for depth */}
);
}
// Floating Orb Component
function FloatingOrb({
size,
color,
delay,
duration,
left,
top,
}: {
size: number;
color: string;
delay: number;
duration: number;
left: string;
top: string;
}) {
return (
);
}
// Particle Component
function Particle({
delay,
left,
size,
duration,
}: {
delay: number;
left: string;
size: number;
duration: number;
}) {
return (
);
}
// Mockup Card Component
function MockupCard({
icon: Icon,
title,
value,
trend,
delay,
}: {
icon: React.ElementType;
title: string;
value: string;
trend: string;
delay: number;
}) {
return (
);
}
// Chat Message Component
function ChatMessage({
message,
isAI,
delay,
}: {
message: string;
isAI: boolean;
delay: number;
}) {
return (
);
}
export function Hero() {
const [isLoaded] = useState(true);
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });
const heroRef = useRef(null);
const particles = useMemo(
() => [
{ left: "8%", size: 3, duration: 9 },
{ left: "18%", size: 4, duration: 10 },
{ left: "28%", size: 2, duration: 8 },
{ left: "38%", size: 5, duration: 11 },
{ left: "48%", size: 3, duration: 9 },
{ left: "58%", size: 4, duration: 10 },
{ left: "68%", size: 2, duration: 8 },
{ left: "78%", size: 5, duration: 11 },
{ left: "88%", size: 3, duration: 9 },
{ left: "12%", size: 4, duration: 10 },
{ left: "22%", size: 2, duration: 8 },
{ left: "32%", size: 5, duration: 11 },
{ left: "52%", size: 3, duration: 9 },
{ left: "72%", size: 4, duration: 10 },
{ left: "92%", size: 2, duration: 8 },
],
[],
);
useEffect(() => {
const handleMouseMove = (e: MouseEvent) => {
if (!heroRef.current) return;
const rect = heroRef.current.getBoundingClientRect();
const x = (e.clientX - rect.left - rect.width / 2) / rect.width;
const y = (e.clientY - rect.top - rect.height / 2) / rect.height;
setMousePosition({ x: x * 10, y: y * 10 });
};
const heroElement = heroRef.current;
if (heroElement) {
heroElement.addEventListener("mousemove", handleMouseMove);
}
return () => {
if (heroElement) {
heroElement.removeEventListener("mousemove", handleMouseMove);
}
};
}, []);
const trustBadges = [
{ icon: Lock, label: "Bank-Level Security" },
{ icon: Check, label: "GDPR Certified" },
{ icon: Zap, label: "Real-Time AI" },
{ icon: Link2, label: "Blockchain Verified" },
];
return (
{/* Background Layer 1 - Animated Gradient Mesh */}
{/* Background Layer 2 - Ripple Effect */}
{/* Background Layer 3 - Grid Pattern */}
{/* Background Layer 4 - Floating Orbs */}
{/* Background Layer 5 - Spotlight Effect */}
{/* Particles */}
{particles.map((particle, i) => (
))}
{/* Content */}
{/* Announcement Badge */}
Powered by Ai + Blockchain Integration
{/* Main Headline */}
Transform Your Contracts
Into Actionable Intelligence
{/* Subheadline */}
AI-Powered contract analysis meets blockchain verification. The only
platform that truly understands your banking and insurance documents.
{" "}
Secure, transparent, instant.
{/* CTA Buttons */}
{/* Primary CTA */}
{/* Glow background layer */}
{/* Animated gradient shift layer */}
Get Started
Go To Dashboard
{/* Trust Indicators */}
{trustBadges.map((badge, index) => (
{badge.label}
))}
{/* Hero Visual - Dashboard Mockup */}
{/* Main Dashboard Container */}
{/* Dashboard Header */}
{/* Dashboard Content */}
{/* Left Column - Stats */}
{/* Center Column - Chat Interface */}
{/* Right Column - Notifications & Chart (Equal Heights) */}
{/* Notifications - 50% height */}
Recent Activity
{[
{
text: "Contract #4521 verified",
time: "2m ago",
color: "bg-emerald-500",
},
{
text: "New AI analysis complete",
time: "5m ago",
color: "bg-blue-500",
},
{
text: "Blockchain timestamp added",
time: "12m ago",
color: "bg-violet-500",
},
].map((item, i) => (
))}
{/* Mini Chart - 50% height */}
Processing Volume
{[40, 65, 45, 80, 55, 90, 70, 85, 60, 95, 75, 88].map(
(height, i) => (
),
)}
{/* Bottom Gradient Overlay */}
{/* Floating Elements Around Mockup */}
);
}