Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

2.9 KB
Raw Blame
import Link from 'next/link';
import { HeroShowcase } from './hero-showcase';
import { GetStartedButton } from '@/components/get-started-button';
import { HeroPill } from '@/components/hero-pill';
import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';

const STAGGER_MS = 90;

function rise(step: number) {
  return { animationDelay: `${step * STAGGER_MS}ms` };
}

export function Hero() {
  return (
    <section className="relative overflow-hidden">
      <div
        aria-hidden
        className="pointer-events-none absolute inset-x-0 top-0 h-[520px] bg-[radial-gradient(70%_60%_at_50%_0%,rgba(0,0,0,0.045),transparent_70%)]"
      />
      <div className="container relative pt-32 md:pt-40">
        <div className="col items-center gap-6 text-center">
          <HeroPill
            className="animate-rise"
            href="/docs/ai-observability"
            label="New"
            shortText="AI observability is here"
            style={rise(0)}
            text="AI observability: cost and traces for every model call"
          />
          <h1
            className="max-w-4xl animate-rise text-balance font-semibold text-5xl leading-[1.02] tracking-[-0.03em] md:text-7xl"
            style={rise(1)}
          >
            One place for your <span className="text-blue-600">web</span>,{' '}
            <span className="text-emerald-600">product</span> and{' '}
            <span className="text-violet-600">AI</span> analytics
          </h1>
          <p
            className="max-w-2xl animate-rise text-balance text-lg text-neutral-600 md:text-xl"
            style={rise(2)}
          >
            See what people do on your site and in your product, what your AI
            calls cost, and ask the questions in plain English. The open-source
            Mixpanel alternative, cookie-less, in our EU cloud or on your own
            servers.
          </p>
          <div
            className="row animate-rise flex-wrap items-center justify-center gap-3"
            style={rise(3)}
          >
            <GetStartedButton />
            <Button asChild className="px-6" size="lg" variant="outline">
              <Link href="/docs/self-hosting/self-hosting">
                Self-host for free
              </Link>
            </Button>
          </div>
        </div>
      </div>
      <div
        className="mx-auto mt-14 max-w-6xl animate-rise px-4 md:mt-20"
        style={rise(4)}
      >
        <HeroShowcase />
      </div>
    </section>
  );
}

// Shared by every page hero so the top of the site feels the same everywhere.
export function HeroContainer({
  children,
  className,
}: {
  children?: React.ReactNode;
  className?: string;
  divider?: boolean;
}): React.ReactElement {
  return (
    <section className="relative">
      <div
        className={cn(
          'container relative pt-32 pb-12 md:pt-44 md:pb-20',
          className
        )}
        data-children
      >
        {children}
      </div>
    </section>
  );
}