Skip to content

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

fix(public): the marketing site reads well on phones (#642)

Carl-Gerhard Lindesvärd0f5768980dd4
diff --git a/apps/public/src/app/(content)/compare/[slug]/_components/feature-table.tsx b/apps/public/src/app/(content)/compare/[slug]/_components/feature-table.tsx
index f1198db94..2bc0fcae0 100644
--- a/apps/public/src/app/(content)/compare/[slug]/_components/feature-table.tsx
+++ b/apps/public/src/app/(content)/compare/[slug]/_components/feature-table.tsx
@@ -55,7 +55,7 @@ function GroupRows({
<tbody className="divide-y divide-neutral-100">
<tr>
<th
- className="px-5 pt-6 pb-2 font-medium text-[11px] text-neutral-500 uppercase tracking-wider"
+ className="px-5 pt-6 pb-2 font-medium text-[11px] text-neutral-500 uppercase tracking-wider max-sm:px-4"
colSpan={3}
scope="colgroup"
>
@@ -64,7 +64,7 @@ function GroupRows({
</tr>
{features.map((feature) => (
<tr className="align-top" key={feature.name}>
- <th className="px-5 py-3 font-medium" scope="row">
+ <th className="px-5 py-3 font-medium max-sm:px-4" scope="row">
{feature.name}
{feature.notes && (
<p className="mt-0.5 font-normal text-neutral-500 text-xs">
@@ -72,10 +72,10 @@ function GroupRows({
</p>
)}
</th>
- <td className="bg-blue-50/40 px-5 py-3">
+ <td className="bg-blue-50/40 px-5 py-3 max-sm:px-4">
<Cell value={feature.openpanel} />
</td>
- <td className="px-5 py-3 text-neutral-600">
+ <td className="px-5 py-3 text-neutral-600 max-sm:px-4">
<Cell value={feature.competitor} />
</td>
</tr>
@@ -114,7 +114,7 @@ export function FeatureTable({
<thead>
<tr className="border-neutral-200 border-b">
<th
- className="w-2/5 px-5 py-4 font-medium text-neutral-500"
+ className="px-5 py-4 font-medium text-neutral-500 max-sm:px-4 sm:w-2/5"
scope="col"
>
Feature
@@ -122,6 +122,7 @@ export function FeatureTable({
<ColumnHeads
competitorName={competitorName}
competitorSlug={competitorSlug}
+ logoOnlyOnPhone
/>
</tr>
</thead>
diff --git a/apps/public/src/app/(content)/compare/[slug]/_components/scoreboard.tsx b/apps/public/src/app/(content)/compare/[slug]/_components/scoreboard.tsx
index 5ecac2916..c1b65985b 100644
--- a/apps/public/src/app/(content)/compare/[slug]/_components/scoreboard.tsx
+++ b/apps/public/src/app/(content)/compare/[slug]/_components/scoreboard.tsx
@@ -3,27 +3,50 @@ import { Logo } from '@/components/logo';
import { Reveal } from '@/components/reveal';
import { SectionHeader } from '@/components/section';
import type { CompareHighlights } from '@/lib/compare';
+import { cn } from '@/lib/utils';
+
+// Phones stack the topic above the two answers; three text columns do not
+// fit side by side at that width.
+export const STACKED_TABLE = {
+ table: 'w-full text-left text-sm max-sm:block',
+ section: 'max-sm:block',
+ row: 'align-top max-sm:grid max-sm:grid-cols-2',
+ topicHead: 'w-1/4 px-5 py-4 font-medium text-neutral-500 max-sm:hidden',
+ topic: 'px-5 py-4 font-medium max-sm:col-span-2 max-sm:px-4 max-sm:pb-1',
+ cell: 'px-5 py-4 max-sm:px-4',
+} as const;
// Column heads shared by the scoreboard and the feature table.
export function ColumnHeads({
competitorName,
competitorSlug,
+ logoOnlyOnPhone = false,
}: {
competitorName: string;
competitorSlug: string;
+ logoOnlyOnPhone?: boolean;
}) {
return (
<>
- <th className="bg-blue-50/60 px-5 py-4 text-left" scope="col">
+ <th className="bg-blue-50/60 px-5 py-4 text-left max-sm:px-4" scope="col">
<span className="row items-center gap-2">
<span className="center-center size-6 rounded-md bg-blue-600">
<Logo className="h-2.5 w-auto text-white" />
</span>
- <span className="font-semibold">OpenPanel</span>
+ <span
+ className={cn('font-semibold', logoOnlyOnPhone && 'max-sm:sr-only')}
+ >
+ OpenPanel
+ </span>
</span>
</th>
- <th className="px-5 py-4 text-left" scope="col">
- <CompetitorMark name={competitorName} size="sm" slug={competitorSlug} />
+ <th className="px-5 py-4 text-left max-sm:px-4" scope="col">
+ <CompetitorMark
+ logoOnlyOnPhone={logoOnlyOnPhone}
+ name={competitorName}
+ size="sm"
+ slug={competitorSlug}
+ />
</th>
</>
);
@@ -52,13 +75,12 @@ export function Scoreboard({
</Reveal>
<Reveal className="surface overflow-hidden" delay={80}>
<div className="overflow-x-auto">
- <table className="w-full text-left text-sm">
- <thead>
- <tr className="border-neutral-200 border-b">
- <th
- className="w-1/4 px-5 py-4 font-medium text-neutral-500"
- scope="col"
- >
+ <table className={STACKED_TABLE.table}>
+ <thead className={STACKED_TABLE.section}>
+ <tr
+ className={cn(STACKED_TABLE.row, 'border-neutral-200 border-b')}
+ >
+ <th className={STACKED_TABLE.topicHead} scope="col">
<span className="sr-only">Topic</span>
</th>
<ColumnHeads
@@ -67,16 +89,26 @@ export function Scoreboard({
/>
</tr>
</thead>
- <tbody className="divide-y divide-neutral-100">
+ <tbody
+ className={cn(
+ STACKED_TABLE.section,
+ 'divide-y divide-neutral-100'
+ )}
+ >
{highlights.items.map((item) => (
- <tr className="align-top" key={item.label}>
- <th className="px-5 py-4 font-medium" scope="row">
+ <tr className={STACKED_TABLE.row} key={item.label}>
+ <th className={STACKED_TABLE.topic} scope="row">
{item.label}
</th>
- <td className="bg-blue-50/40 px-5 py-4 font-medium text-neutral-900">
+ <td
+ className={cn(
+ STACKED_TABLE.cell,
+ 'bg-blue-50/40 font-medium text-neutral-900'
+ )}
+ >
{item.openpanel}
</td>
- <td className="px-5 py-4 text-neutral-600">
+ <td className={cn(STACKED_TABLE.cell, 'text-neutral-600')}>
{item.competitor}
</td>
</tr>
diff --git a/apps/public/src/app/(content)/compare/[slug]/_components/technical-comparison.tsx b/apps/public/src/app/(content)/compare/[slug]/_components/technical-comparison.tsx
index 29d82259f..d8e9a4ccd 100644
--- a/apps/public/src/app/(content)/compare/[slug]/_components/technical-comparison.tsx
+++ b/apps/public/src/app/(content)/compare/[slug]/_components/technical-comparison.tsx
@@ -1,7 +1,8 @@
-import { ColumnHeads } from './scoreboard';
+import { ColumnHeads, STACKED_TABLE } from './scoreboard';
import { Reveal } from '@/components/reveal';
import { SectionHeader } from '@/components/section';
import type { CompareTechnicalComparison } from '@/lib/compare';
+import { cn } from '@/lib/utils';
function Value({ value }: { value: string | string[] }) {
if (Array.isArray(value)) {
@@ -43,13 +44,12 @@ export function TechnicalComparison({
</Reveal>
<Reveal className="surface overflow-hidden" delay={80}>
<div className="overflow-x-auto">
- <table className="w-full text-left text-sm">
- <thead>
- <tr className="border-neutral-200 border-b">
- <th
- className="w-1/4 px-5 py-4 font-medium text-neutral-500"
- scope="col"
- >
+ <table className={STACKED_TABLE.table}>
+ <thead className={STACKED_TABLE.section}>
+ <tr
+ className={cn(STACKED_TABLE.row, 'border-neutral-200 border-b')}
+ >
+ <th className={STACKED_TABLE.topicHead} scope="col">
<span className="sr-only">Topic</span>
</th>
<ColumnHeads
@@ -58,16 +58,21 @@ export function TechnicalComparison({
/>
</tr>
</thead>
- <tbody className="divide-y divide-neutral-100">
+ <tbody
+ className={cn(
+ STACKED_TABLE.section,
+ 'divide-y divide-neutral-100'
+ )}
+ >
{technical.items.map((item) => (
- <tr className="align-top" key={item.label}>
- <th className="px-5 py-4 font-medium" scope="row">
+ <tr className={STACKED_TABLE.row} key={item.label}>
+ <th className={STACKED_TABLE.topic} scope="row">
{item.label}
</th>
- <td className="bg-blue-50/40 px-5 py-4">
+ <td className={cn(STACKED_TABLE.cell, 'bg-blue-50/40')}>
<Value value={item.openpanel} />
</td>
- <td className="px-5 py-4 text-neutral-600">
+ <td className={cn(STACKED_TABLE.cell, 'text-neutral-600')}>
<div className="col gap-1.5">
<Value value={item.competitor} />
{item.notes && (
diff --git a/apps/public/src/app/(content)/compare/[slug]/_components/versus-mark.tsx b/apps/public/src/app/(content)/compare/[slug]/_components/versus-mark.tsx
index 79bad714b..f012d122c 100644
--- a/apps/public/src/app/(content)/compare/[slug]/_components/versus-mark.tsx
+++ b/apps/public/src/app/(content)/compare/[slug]/_components/versus-mark.tsx
@@ -30,11 +30,14 @@ export function CompetitorMark({
name,
slug,
size = 'md',
+ logoOnlyOnPhone = false,
className,
}: {
name: string;
slug: string;
size?: 'sm' | 'md';
+ // Narrow table heads drop the name next to the logo on phones
+ logoOnlyOnPhone?: boolean;
className?: string;
}) {
const logo = competitorLogoPath(slug);
@@ -62,7 +65,8 @@ export function CompetitorMark({
<span
className={cn(
'font-semibold tracking-[-0.01em]',
- size === 'sm' ? 'text-sm' : 'text-lg'
+ size === 'sm' ? 'text-sm' : 'text-lg',
+ logoOnlyOnPhone && logo && 'max-sm:sr-only'
)}
>
{name}
diff --git a/apps/public/src/app/(content)/features/page.tsx b/apps/public/src/app/(content)/features/page.tsx
index c7cd9740e..3d1fba3ee 100644
--- a/apps/public/src/app/(content)/features/page.tsx
+++ b/apps/public/src/app/(content)/features/page.tsx
@@ -1,6 +1,7 @@
import type { Metadata } from 'next';
import Link from 'next/link';
import { CtaBanner } from '@/app/(home)/_sections/cta-banner';
+import { DASHBOARD_WINDOW_WIDTH, FitWidth } from '@/components/fit-width';
import { PageHero } from '@/components/page-hero';
import { Reveal } from '@/components/reveal';
import { SectionLabel } from '@/components/section';
@@ -227,10 +228,10 @@ export default function FeaturesIndexPage() {
className="mx-auto mt-14 max-w-6xl animate-rise px-4 md:mt-20"
style={{ animationDelay: '360ms' }}
>
- <div className="relative max-h-[560px] overflow-hidden [mask-image:linear-gradient(to_bottom,black_80%,transparent)] max-md:overflow-x-auto">
- <div className="min-w-[960px]">
+ <div className="relative max-h-[560px] overflow-hidden [mask-image:linear-gradient(to_bottom,black_80%,transparent)]">
+ <FitWidth width={DASHBOARD_WINDOW_WIDTH}>
<VisualMock name="web-overview" />
- </div>
+ </FitWidth>
</div>
</div>
<div className="col container gap-20 py-16 md:py-24">
diff --git a/apps/public/src/app/(content)/open-source/page.tsx b/apps/public/src/app/(content)/open-source/page.tsx
index 2b7fa47f2..fdde1aebf 100644
--- a/apps/public/src/app/(content)/open-source/page.tsx
+++ b/apps/public/src/app/(content)/open-source/page.tsx
@@ -6,6 +6,7 @@ import { CtaBanner } from '@/app/(home)/_sections/cta-banner';
import { Band } from '@/components/band';
import { CountUp } from '@/components/count-up';
import { type FaqEntry, FaqSection } from '@/components/faq';
+import { DASHBOARD_WINDOW_WIDTH, FitWidth } from '@/components/fit-width';
import { PageHero } from '@/components/page-hero';
import { Reveal } from '@/components/reveal';
import { SectionHeader, SectionLabel } from '@/components/section';
@@ -307,7 +308,9 @@ export default function OpenSourcePage() {
description="See who uses your project, where they come from and which docs they read. Free web and product analytics for open source projects, up to 2.5M events a month."
title="Free analytics for open source projects"
>
- <VisualMock name="web-overview" />
+ <FitWidth width={DASHBOARD_WINDOW_WIDTH}>
+ <VisualMock name="web-overview" />
+ </FitWidth>
</PageHero>
<Offer />
<WhatWeAsk />
diff --git a/apps/public/src/app/(content)/pricing/_components/pricing-calculator.tsx b/apps/public/src/app/(content)/pricing/_components/pricing-calculator.tsx
index 99d808d88..d8e0279b6 100644
--- a/apps/public/src/app/(content)/pricing/_components/pricing-calculator.tsx
+++ b/apps/public/src/app/(content)/pricing/_components/pricing-calculator.tsx
@@ -64,7 +64,7 @@ function BillingToggle({
<button
aria-checked={selected}
className={cn(
- 'row items-center gap-1.5 rounded-full px-3.5 py-1.5 font-medium transition-all',
+ 'row items-center gap-1.5 whitespace-nowrap rounded-full px-3.5 py-1.5 font-medium transition-all max-sm:px-2.5',
selected
? 'bg-white text-neutral-900 shadow-sm ring-1 ring-black/5'
: 'text-neutral-500 hover:text-neutral-900'
diff --git a/apps/public/src/app/(home)/_sections/hero-showcase.tsx b/apps/public/src/app/(home)/_sections/hero-showcase.tsx
index 0f530e99d..d13e348bf 100644
--- a/apps/public/src/app/(home)/_sections/hero-showcase.tsx
+++ b/apps/public/src/app/(home)/_sections/hero-showcase.tsx
@@ -1,6 +1,7 @@
'use client';
import { useId, useState } from 'react';
+import { DASHBOARD_WINDOW_WIDTH, FitWidth } from '@/components/fit-width';
import { VisualMock } from '@/components/visual-mock';
import { cn } from '@/lib/utils';
@@ -8,18 +9,21 @@ const VIEWS = [
{
id: 'web',
label: 'Web analytics',
+ shortLabel: 'Web',
dot: 'bg-blue-600',
render: () => <VisualMock name="web-overview" />,
},
{
id: 'product',
label: 'Product analytics',
+ shortLabel: 'Product',
dot: 'bg-emerald-600',
render: () => <VisualMock name="product" />,
},
{
id: 'ai',
label: 'AI observability',
+ shortLabel: 'AI',
dot: 'bg-violet-600',
render: () => <VisualMock name="ai" />,
},
@@ -59,7 +63,7 @@ export function HeroShowcase() {
aria-controls={view.id === activeId ? panelId(view.id) : undefined}
aria-selected={view.id === activeId}
className={cn(
- 'row items-center gap-2 rounded-full py-2 pr-4 pl-3 font-medium text-sm transition-colors',
+ 'row items-center gap-2 whitespace-nowrap rounded-full py-2 pr-4 pl-3 font-medium text-sm transition-colors',
view.id === activeId
? 'bg-neutral-100 text-neutral-900'
: 'text-neutral-500 hover:text-neutral-900'
@@ -79,7 +83,8 @@ export function HeroShowcase() {
view.id === activeId ? 'opacity-100' : 'opacity-40'
)}
/>
- {view.label}
+ <span className="sm:hidden">{view.shortLabel}</span>
+ <span className="max-sm:hidden">{view.label}</span>
</button>
))}
</div>
@@ -89,10 +94,12 @@ export function HeroShowcase() {
id={panelId(active.id)}
role="tabpanel"
>
- <div className="relative max-h-[680px] overflow-hidden [mask-image:linear-gradient(to_bottom,black_80%,transparent)] max-md:overflow-x-auto">
- <div className="min-w-[960px] animate-rise" key={active.id}>
- {active.render()}
- </div>
+ <div className="relative max-h-[680px] overflow-hidden [mask-image:linear-gradient(to_bottom,black_80%,transparent)]">
+ <FitWidth width={DASHBOARD_WINDOW_WIDTH}>
+ <div className="animate-rise" key={active.id}>
+ {active.render()}
+ </div>
+ </FitWidth>
</div>
</div>
</div>
diff --git a/apps/public/src/app/(home)/_sections/hero.tsx b/apps/public/src/app/(home)/_sections/hero.tsx
index 6651582c9..c4f21f453 100644
--- a/apps/public/src/app/(home)/_sections/hero.tsx
+++ b/apps/public/src/app/(home)/_sections/hero.tsx
@@ -1,7 +1,7 @@
-import { ArrowRightIcon } from 'lucide-react';
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';
@@ -20,19 +20,14 @@ export function Hero() {
/>
<div className="container relative pt-32 md:pt-40">
<div className="col items-center gap-6 text-center">
- <Link
- className="row animate-rise items-center gap-2 rounded-full bg-white py-1 pr-3 pl-1 text-sm shadow-sm ring-1 ring-black/6 transition-colors hover:bg-neutral-50"
+ <HeroPill
+ className="animate-rise"
href="/docs/ai-observability"
+ label="New"
+ shortText="AI observability is here"
style={rise(0)}
- >
- <span className="rounded-full bg-neutral-900 px-2 py-0.5 font-medium text-[11px] text-white">
- New
- </span>
- <span className="text-neutral-600">
- AI observability: cost and traces for every model call
- </span>
- <ArrowRightIcon className="size-3.5 text-neutral-400" />
- </Link>
+ 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)}
diff --git a/apps/public/src/app/(home)/_sections/pillars.tsx b/apps/public/src/app/(home)/_sections/pillars.tsx
index d2276340a..f598d008b 100644
--- a/apps/public/src/app/(home)/_sections/pillars.tsx
+++ b/apps/public/src/app/(home)/_sections/pillars.tsx
@@ -1,7 +1,10 @@
import { Pillar } from '@/components/blocks/pillar';
import { ChatMock } from '@/components/dashboard-mock/chat';
+import { FitWidth } from '@/components/fit-width';
import { VisualMock } from '@/components/visual-mock';
+const CHAT_MOCK_WIDTH = 640;
+
export function Pillars() {
return (
<div className="col py-6">
@@ -50,7 +53,9 @@ export function Pillars() {
title="Ask for the numbers instead of building charts"
visual={
<div className="bleed-left max-h-[600px] overflow-hidden rounded-3xl bg-neutral-100 px-6 pt-6 md:px-10 md:pt-10">
- <ChatMock className="rounded-b-none border-b-0" />
+ <FitWidth width={CHAT_MOCK_WIDTH}>
+ <ChatMock className="rounded-b-none border-b-0" />
+ </FitWidth>
</div>
}
/>
diff --git a/apps/public/src/components/blocks/feature-hero.tsx b/apps/public/src/components/blocks/feature-hero.tsx
index b80835095..81ea64eb9 100644
--- a/apps/public/src/components/blocks/feature-hero.tsx
+++ b/apps/public/src/components/blocks/feature-hero.tsx
@@ -1,5 +1,7 @@
import Link from 'next/link';
+import { DASHBOARD_WINDOW_WIDTH, FitWidth } from '@/components/fit-width';
import { GetStartedButton } from '@/components/get-started-button';
+import type { HeroPillProps } from '@/components/hero-pill';
import { PageHero } from '@/components/page-hero';
import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
@@ -22,7 +24,7 @@ export function FeatureHero({
}: {
title: React.ReactNode;
description: React.ReactNode;
- pill?: { label: string; text: string; href: string };
+ pill?: Pick<HeroPillProps, 'label' | 'text' | 'shortText' | 'href'>;
eyebrow?: React.ReactNode;
visual?: React.ReactNode;
wide?: boolean;
@@ -62,12 +64,16 @@ export function FeatureHero({
>
<div
className={cn(
- 'relative overflow-hidden max-md:overflow-x-auto',
+ 'relative overflow-hidden',
fade &&
'max-h-[640px] [mask-image:linear-gradient(to_bottom,black_82%,transparent)]'
)}
>
- <div className={cn(wide && 'min-w-[960px]')}>{visual}</div>
+ {wide ? (
+ <FitWidth width={DASHBOARD_WINDOW_WIDTH}>{visual}</FitWidth>
+ ) : (
+ visual
+ )}
</div>
</div>
)}
diff --git a/apps/public/src/components/fit-width.tsx b/apps/public/src/components/fit-width.tsx
new file mode 100644
index 000000000..0b4dee803
--- /dev/null
+++ b/apps/public/src/components/fit-width.tsx
@@ -0,0 +1,69 @@
+'use client';
+
+import { useLayoutEffect, useRef, useState } from 'react';
+import { cn } from '@/lib/utils';
+
+// The width a full dashboard window is laid out at before it is zoomed down.
+export const DASHBOARD_WINDOW_WIDTH = 960;
+
+// Renders a desktop-sized replica at its own width and zooms it down to fit
+// narrower containers, so phones see the same layout instead of a squashed
+// or sideways-scrolling one.
+export function FitWidth({
+ width,
+ children,
+ className,
+}: {
+ width: number;
+ children: React.ReactNode;
+ className?: string;
+}) {
+ const ref = useRef<HTMLDivElement>(null);
+ // `undefined` until measured, `null` when the replica fits as it is.
+ const [zoom, setZoom] = useState<number | null | undefined>(undefined);
+
+ // Measured before the first client paint so the zoom lands with hydration.
+ useLayoutEffect(() => {
+ const element = ref.current;
+ if (!element) {
+ return;
+ }
+ const fitTo = (available: number) =>
+ setZoom(available < width ? available / width : null);
+ fitTo(element.getBoundingClientRect().width);
+ const observer = new ResizeObserver(([entry]) => {
+ if (entry) {
+ fitTo(entry.contentRect.width);
+ }
+ });
+ observer.observe(element);
+ return () => observer.disconnect();
+ }, [width]);
+
+ const isMeasured = zoom !== undefined;
+ // Unmeasured, the replica keeps its desktop layout and the edge crops it.
+ const innerStyle = (): React.CSSProperties | undefined => {
+ if (!isMeasured) {
+ return { minWidth: width };
+ }
+ if (typeof zoom === 'number') {
+ return { width, zoom };
+ }
+ return undefined;
+ };
+
+ return (
+ <div
+ className={cn(
+ 'overflow-hidden',
+ // Phones would otherwise flash the squashed layout before hydration;
+ // without scripts nothing measures, so the replica stays visible.
+ !isMeasured && 'noscript:visible max-md:invisible',
+ className
+ )}
+ ref={ref}
+ >
+ <div style={innerStyle()}>{children}</div>
+ </div>
+ );
+}
diff --git a/apps/public/src/components/footer.tsx b/apps/public/src/components/footer.tsx
index 406cdce8a..18ce10739 100644
--- a/apps/public/src/components/footer.tsx
+++ b/apps/public/src/components/footer.tsx
@@ -143,7 +143,7 @@ export async function Footer() {
<h3 className="font-medium text-neutral-900">{column.title}</h3>
<ul className="col gap-2 text-neutral-500">
{column.links.map((link) => (
- <li className="truncate" key={link.url}>
+ <li className="sm:truncate" key={link.url}>
<Link
className="transition-colors hover:text-neutral-900"
href={link.url}
diff --git a/apps/public/src/components/github-button.tsx b/apps/public/src/components/github-button.tsx
index be9b9036d..23516114c 100644
--- a/apps/public/src/components/github-button.tsx
+++ b/apps/public/src/components/github-button.tsx
@@ -21,8 +21,8 @@ export function GithubButton() {
});
}, []);
return (
- <Button asChild variant={'secondary'}>
- <Link className="hidden md:flex" href="https://git.new/openpanel">
+ <Button asChild className="max-md:hidden" variant="secondary">
+ <Link href="https://git.new/openpanel">
<svg
aria-hidden="true"
className="h-5 w-5"
diff --git a/apps/public/src/components/hero-pill.tsx b/apps/public/src/components/hero-pill.tsx
new file mode 100644
index 000000000..dca5f0209
--- /dev/null
+++ b/apps/public/src/components/hero-pill.tsx
@@ -0,0 +1,48 @@
+import { ArrowRightIcon } from 'lucide-react';
+import Link from 'next/link';
+import { cn } from '@/lib/utils';
+
+export interface HeroPillProps {
+ label: string;
+ text: string;
+ // Phones get this instead of `text` so the pill stays on one line
+ shortText?: string;
+ href: string;
+ className?: string;
+ style?: React.CSSProperties;
+}
+
+export function HeroPill({
+ label,
+ text,
+ shortText,
+ href,
+ className,
+ style,
+}: HeroPillProps) {
+ return (
+ <Link
+ className={cn(
+ 'row max-w-full items-center gap-2 whitespace-nowrap rounded-full bg-white py-1 pr-3 pl-1 text-sm shadow-sm ring-1 ring-black/6 transition-colors hover:bg-neutral-50',
+ className
+ )}
+ href={href}
+ style={style}
+ >
+ <span className="shrink-0 rounded-full bg-neutral-900 px-2 py-0.5 font-medium text-[11px] text-white">
+ {label}
+ </span>
+ <span className="min-w-0 truncate text-neutral-600">
+ {shortText ? (
+ <>
+ <span className="sm:hidden">{shortText}</span>
+ <span className="max-sm:hidden">{text}</span>
+ </>
+ ) : (
+ text
+ )}
+ </span>
+ <ArrowRightIcon className="size-3.5 shrink-0 text-neutral-400" />
+ </Link>
+ );
+}
diff --git a/apps/public/src/components/navbar.tsx b/apps/public/src/components/navbar.tsx
index 778ddd5e9..f9c10063f 100644
--- a/apps/public/src/components/navbar.tsx
+++ b/apps/public/src/components/navbar.tsx
@@ -2,6 +2,7 @@
import { ArrowRightIcon, ChevronDownIcon, MenuIcon, XIcon } from 'lucide-react';
import Link from 'next/link';
import { useEffect, useRef, useState } from 'react';
+import { GetStartedButton } from './get-started-button';
import { GithubButton } from './github-button';
import { Logo } from './logo';
import { SignUpButton } from './sign-up-button';
@@ -83,8 +84,11 @@ const Navbar = () => {
>
<div
className={cn(
- 'container flex h-16 items-center justify-between transition-all duration-300',
+ 'container relative flex h-16 items-center justify-between transition-all duration-300',
isMobileMenuOpen && 'bg-canvas',
+ !isMobileMenuOpen &&
+ isScrolled &&
+ 'max-md:bg-canvas/95 max-md:shadow-[0_1px_0_rgba(0,0,0,0.06)] max-md:backdrop-blur-md',
!isMobileMenuOpen &&
isScrolled &&
'md:h-14 md:max-w-[1032px] md:rounded-full md:bg-white/80 md:shadow-[0_1px_2px_rgba(0,0,0,0.04),0_12px_32px_-12px_rgba(0,0,0,0.14)] md:ring-1 md:ring-black/5 md:backdrop-blur-md'
@@ -96,7 +100,7 @@ const Navbar = () => {
</Link>
<div className="hidden items-center gap-1 text-sm md:flex">
- <div className="relative" ref={featuresRef}>
+ <div ref={featuresRef}>
<button
aria-expanded={isFeaturesOpen}
aria-haspopup="menu"
@@ -178,7 +182,7 @@ function FeaturesMenu({
return (
<div
className={cn(
- 'absolute top-full left-1/2 w-[720px] -translate-x-1/2 pt-3 transition-all duration-150',
+ 'absolute top-full left-1/2 w-[min(720px,calc(100vw-2rem))] -translate-x-1/2 pt-3 transition-all duration-150',
open
? 'visible translate-y-0 opacity-100'
: 'invisible -translate-y-1 opacity-0'
@@ -242,7 +246,7 @@ function FeaturesMenu({
function MobileMenu({ onNavigate }: { onNavigate: () => void }) {
return (
- <div className="container max-h-[calc(100vh-4rem)] overflow-y-auto border-t bg-canvas pb-6 md:hidden">
+ <div className="col container h-[calc(100dvh-4rem)] overflow-y-auto border-t bg-canvas pb-6 md:hidden">
<p className="mt-5 mb-2 px-1 font-medium text-muted-foreground text-xs uppercase tracking-wider">
Features
</p>
@@ -278,6 +282,14 @@ function MobileMenu({ onNavigate }: { onNavigate: () => void }) {
</Link>
))}
</div>
+ <div className="col mt-auto gap-3 pt-6">
+ <GetStartedButton className="w-full" onClick={onNavigate} />
+ <Button asChild size="lg" variant="outline">
+ <Link href="https://git.new/openpanel" onClick={onNavigate}>
+ Star on GitHub
+ </Link>
+ </Button>
+ </div>
</div>
);
}
diff --git a/apps/public/src/components/page-hero.tsx b/apps/public/src/components/page-hero.tsx
index 8f20baecd..31956941f 100644
--- a/apps/public/src/components/page-hero.tsx
+++ b/apps/public/src/components/page-hero.tsx
@@ -1,5 +1,4 @@
-import { ArrowRightIcon } from 'lucide-react';
-import Link from 'next/link';
+import { HeroPill, type HeroPillProps } from './hero-pill';
import { cn } from '@/lib/utils';
const STAGGER_MS = 90;
@@ -20,7 +19,7 @@ export function PageHero({
className,
children,
}: {
- pill?: { label: string; text: string; href: string };
+ pill?: Pick<HeroPillProps, 'label' | 'text' | 'shortText' | 'href'>;
// Anything that should sit above the headline when it is not a pill
// (the "OpenPanel vs X" lockup on compare pages).
eyebrow?: React.ReactNode;
@@ -56,17 +55,7 @@ export function PageHero({
</div>
)}
{pill && (
- <Link
- className="row animate-rise items-center gap-2 rounded-full bg-white py-1 pr-3 pl-1 text-sm shadow-sm ring-1 ring-black/6 transition-colors hover:bg-neutral-50"
- href={pill.href}
- style={rise(0)}
- >
- <span className="rounded-full bg-neutral-900 px-2 py-0.5 font-medium text-[11px] text-white">
- {pill.label}
- </span>
- <span className="text-neutral-600">{pill.text}</span>
- <ArrowRightIcon className="size-3.5 text-neutral-400" />
- </Link>
+ <HeroPill {...pill} className="animate-rise" style={rise(0)} />
)}
<h1
className="max-w-4xl animate-rise text-balance font-semibold text-4xl leading-[1.05] tracking-[-0.03em] md:text-6xl"
diff --git a/apps/public/src/components/sign-up-button.tsx b/apps/public/src/components/sign-up-button.tsx
index 0df2a7d4a..2a2684e72 100644
--- a/apps/public/src/components/sign-up-button.tsx
+++ b/apps/public/src/components/sign-up-button.tsx
@@ -23,9 +23,8 @@ export function SignUpButton() {
}, []);
return (
- <Button asChild variant="outline">
+ <Button asChild className="max-md:hidden" variant="outline">
<Link
- className="hidden md:flex"
href={`https://dashboard.openpanel.dev${isSignedIn ? '/' : '/onboarding'}`}
>
{isSignedIn ? 'Dashboard' : 'Sign up'}
diff --git a/apps/public/src/components/visual-mock.tsx b/apps/public/src/components/visual-mock.tsx
index e2b8640e2..18592376d 100644
--- a/apps/public/src/components/visual-mock.tsx
+++ b/apps/public/src/components/visual-mock.tsx
@@ -117,7 +117,7 @@ export function Inset({
>
<div
className={cn(
- '@container col shrink-0 gap-3 border-neutral-200 border-t bg-neutral-50/60 p-4 text-left text-neutral-900 shadow-[0_20px_60px_-20px_rgba(0,0,0,0.2)]',
+ '@container col shrink-0 gap-3 border-neutral-200 border-t bg-neutral-50/60 p-4 text-left text-neutral-900 shadow-[0_20px_60px_-20px_rgba(0,0,0,0.2)] max-sm:[zoom:0.75]',
cutBottom ? 'rounded-t-xl border-x' : 'rounded-tl-xl border-l'
)}
style={cutBottom ? undefined : { width }}