Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Refactor ComparisonPage, FeaturesPage, PricingPage, and SponsorsPage to enhance layout and integrate BackgroundGrid component

Bill Yang0bfecb48f53f
diff --git a/docs/src/app/(home)/compare/components/ComparisonPage.tsx b/docs/src/app/(home)/compare/components/ComparisonPage.tsx
index a42fee346..1f4c02cf8 100644
--- a/docs/src/app/(home)/compare/components/ComparisonPage.tsx
+++ b/docs/src/app/(home)/compare/components/ComparisonPage.tsx
@@ -1,10 +1,12 @@
+import { BackgroundGrid } from "@/components/BackgroundGrid";
+import { CTASection } from "@/components/CTASection";
+import { DEFAULT_EVENT_LIMIT } from "@/lib/const";
import { CheckCircle, CircleMinus } from "lucide-react";
import { Tilt_Warp } from "next/font/google";
import Image from "next/image";
import React from "react";
import { TrackedButton } from "../../../../components/TrackedButton";
import { cn } from "../../../../lib/utils";
-import { DEFAULT_EVENT_LIMIT } from "../../../../lib/const";
const tilt_wrap = Tilt_Warp({
subsets: ["latin"],
@@ -42,16 +44,7 @@ export function ComparisonPage({ competitorName, sections, comparisonContent }:
return (
<div className="flex flex-col items-center justify-center overflow-x-hidden pt-16 md:pt-24">
- <div
- className={cn(
- "absolute inset-0 -top-32 md:-top-48",
- "[background-size:40px_40px]",
- "[background-image:linear-gradient(to_right,#d4d4d4_1px,transparent_1px),linear-gradient(to_bottom,#d4d4d4_1px,transparent_1px)]",
- "dark:[background-image:linear-gradient(to_right,#262626_1px,transparent_1px),linear-gradient(to_bottom,#262626_1px,transparent_1px)]",
- "[mask-image:linear-gradient(to_bottom,black,transparent_80%),linear-gradient(to_right,transparent,black_10%,black_90%,transparent)]",
- "[mask-composite:intersect]"
- )}
- />
+ <BackgroundGrid />
<div className="relative flex flex-col py-8">
{/* Grid background with fade */}
@@ -198,37 +191,10 @@ export function ComparisonPage({ competitorName, sections, comparisonContent }:
</section>
)}
- <section className="py-12 md:py-20 w-full bg-gradient-to-b from-neutral-100 to-neutral-200 dark:from-neutral-900 dark:to-neutral-950">
- <div className="max-w-7xl mx-auto px-4">
- <div className="relative p-6 md:p-12 flex flex-col items-center justify-center text-center">
- <div className="mb-6 md:mb-8">
- <Image src="/rybbit-text.svg" alt="Rybbit" width={150} height={27} className="dark:invert-0 invert" />
- </div>
- <h2 className="text-2xl md:text-4xl font-bold mb-4 md:mb-6">
- It&apos;s time to switch to analytics that&apos;s made for you
- </h2>
- <p className="text-base md:text-xl text-neutral-600 dark:text-neutral-300 mb-6 md:mb-10 max-w-3xl mx-auto font-light">
- The first {DEFAULT_EVENT_LIMIT.toLocaleString()} events a month are free
- </p>
-
- <div className="flex flex-col sm:flex-row items-center justify-center gap-4 md:gap-6 mb-6 md:mb-8 w-full sm:w-auto">
- <TrackedButton
- href="https://app.rybbit.io/signup"
- eventName="signup"
- eventProps={{ location: "bottom_cta", button_text: "Get started" }}
- className="w-full sm:w-auto bg-emerald-600 hover:bg-emerald-500 text-white text-lg font-medium px-6 md:px-8 py-3 md:py-4 rounded-lg shadow-lg shadow-emerald-900/20 transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-opacity-50 cursor-pointer"
- >
- Get started
- </TrackedButton>
- </div>
-
- <p className="text-neutral-500 dark:text-neutral-400 text-xs md:text-sm flex items-center justify-center gap-2">
- <CheckCircle className="w-3 h-3 md:w-4 md:h-4" />
- No credit card required
- </p>
- </div>
- </div>
- </section>
+ <CTASection
+ title="It's time to switch to analytics that's made for you"
+ eventLocation="comparison_bottom_cta"
+ />
</div>
);
}
diff --git a/docs/src/app/(home)/features/page.tsx b/docs/src/app/(home)/features/page.tsx
index 219956cb4..6c79fe8aa 100644
--- a/docs/src/app/(home)/features/page.tsx
+++ b/docs/src/app/(home)/features/page.tsx
@@ -1,3 +1,4 @@
+import { BackgroundGrid } from "@/components/BackgroundGrid";
import { CTASection } from "@/components/CTASection";
import { SectionBadge } from "@/components/SectionBadge";
import { TrackedButton } from "@/components/TrackedButton";
@@ -289,7 +290,7 @@ interface FeatureGridProps {
function FeatureGrid({ title, description, features, bgClassName = "" }: FeatureGridProps) {
return (
- <section className={`py-12 md:py-16 w-full ${bgClassName}`}>
+ <section className={`py-12 md:py-16 w-full relative z-10 ${bgClassName}`}>
<div className="max-w-7xl mx-auto px-4">
<div className="mb-12">
<h2 className="text-3xl md:text-4xl font-bold tracking-tight mb-4">{title}</h2>
@@ -317,11 +318,11 @@ function FeatureGrid({ title, description, features, bgClassName = "" }: Feature
export default function FeaturesPage() {
return (
<div className="flex flex-col items-center justify-center overflow-x-hidden">
+ <BackgroundGrid />
{/* Hero Section */}
- <section className="py-16 md:py-24 w-full">
+ <section className="py-16 md:py-24 w-full relative z-10">
<div className="max-w-7xl mx-auto px-4">
<div className="text-center max-w-4xl mx-auto">
- <SectionBadge className="mb-6">Features</SectionBadge>
<h1 className="text-4xl md:text-6xl font-bold tracking-tight mb-6">
Everything you need to understand your audience
</h1>
diff --git a/docs/src/app/(home)/pricing/components/ComparisonSection.tsx b/docs/src/app/(home)/pricing/components/ComparisonSection.tsx
index 5bb60ee25..fb1222d68 100644
--- a/docs/src/app/(home)/pricing/components/ComparisonSection.tsx
+++ b/docs/src/app/(home)/pricing/components/ComparisonSection.tsx
@@ -255,7 +255,7 @@ function FeatureCell({ value }: FeatureCellProps) {
export function ComparisonSection() {
return (
- <section className="-mt-8 pb-8 w-full">
+ <section className="-mt-8 pb-8 w-full relative z-10">
<div className="max-w-7xl mx-auto px-4 overflow-x-auto">
<div className="w-full border border-neutral-300/50 dark:border-neutral-800/50 rounded-lg min-w-[800px] ">
{/* Table Header */}
diff --git a/docs/src/app/(home)/pricing/page.tsx b/docs/src/app/(home)/pricing/page.tsx
index ee7a7c634..21fe3f14c 100644
--- a/docs/src/app/(home)/pricing/page.tsx
+++ b/docs/src/app/(home)/pricing/page.tsx
@@ -1,3 +1,4 @@
+import { BackgroundGrid } from "@/components/BackgroundGrid";
import { PricingSection } from "@/components/PricingSection";
import { ComparisonSection } from "./components/ComparisonSection";
import type { Metadata } from "next";
@@ -10,6 +11,7 @@ export const metadata: Metadata = {
export default function PricingPage() {
return (
<div className="flex flex-col items-center justify-center overflow-x-hidden">
+ <BackgroundGrid />
<PricingSection />
<ComparisonSection />
</div>
diff --git a/docs/src/app/(home)/sponsors/page.tsx b/docs/src/app/(home)/sponsors/page.tsx
index ef66d54fa..e497d2dcf 100644
--- a/docs/src/app/(home)/sponsors/page.tsx
+++ b/docs/src/app/(home)/sponsors/page.tsx
@@ -1,3 +1,4 @@
+import { BackgroundGrid } from "@/components/BackgroundGrid";
import { CheckCircle } from "lucide-react";
import { Tilt_Warp } from "next/font/google";
import Image from "next/image";
@@ -78,16 +79,7 @@ const sponsors: Sponsor[] = [
export default function SponsorsPage() {
return (
<div className="flex flex-col items-center justify-center overflow-x-hidden pt-16 md:pt-24">
- <div
- className={cn(
- "absolute inset-0 -top-32 md:-top-48",
- "[background-size:40px_40px]",
- "[background-image:linear-gradient(to_right,#d4d4d4_1px,transparent_1px),linear-gradient(to_bottom,#d4d4d4_1px,transparent_1px)]",
- "dark:[background-image:linear-gradient(to_right,#262626_1px,transparent_1px),linear-gradient(to_bottom,#262626_1px,transparent_1px)]",
- "[mask-image:linear-gradient(to_bottom,black,transparent_80%),linear-gradient(to_right,transparent,black_10%,black_90%,transparent)]",
- "[mask-composite:intersect]"
- )}
- />
+ <BackgroundGrid />
<div className="relative flex flex-col py-8">
<h1
className={cn(
diff --git a/docs/src/components/BackgroundGrid.tsx b/docs/src/components/BackgroundGrid.tsx
new file mode 100644
index 000000000..3e6cdee3c
--- /dev/null
+++ b/docs/src/components/BackgroundGrid.tsx
@@ -0,0 +1,21 @@
+import { cn } from "@/lib/utils";
+
+interface BackgroundGridProps {
+ className?: string;
+}
+
+export function BackgroundGrid({ className }: BackgroundGridProps) {
+ return (
+ <div
+ className={cn(
+ "absolute inset-0 -top-32 md:-top-48",
+ "[background-size:40px_40px]",
+ "[background-image:linear-gradient(to_right,#d4d4d4_1px,transparent_1px),linear-gradient(to_bottom,#d4d4d4_1px,transparent_1px)]",
+ "dark:[background-image:linear-gradient(to_right,#262626_1px,transparent_1px),linear-gradient(to_bottom,#262626_1px,transparent_1px)]",
+ "[mask-image:linear-gradient(to_bottom,black,transparent_80%),linear-gradient(to_right,transparent,black_10%,black_90%,transparent)]",
+ "[mask-composite:intersect]",
+ className
+ )}
+ />
+ );
+}
diff --git a/docs/src/components/CTASection.tsx b/docs/src/components/CTASection.tsx
index 9d4ad2602..52de5604a 100644
--- a/docs/src/components/CTASection.tsx
+++ b/docs/src/components/CTASection.tsx
@@ -21,7 +21,7 @@ export function CTASection({
eventLocation = "bottom_cta",
}: CTASectionProps) {
return (
- <section className="py-12 md:py-20 w-full px-4">
+ <section className="py-12 md:py-20 w-full px-4 relative z-10">
<div className="max-w-[1200px] mx-auto">
<div className="relative overflow-hidden rounded-3xl bg-neutral-950 p-10 md:p-16 lg:p-20">
{/* Noise texture overlay */}
diff --git a/docs/src/components/PricingSection.tsx b/docs/src/components/PricingSection.tsx
index 291edac11..a33f99daa 100644
--- a/docs/src/components/PricingSection.tsx
+++ b/docs/src/components/PricingSection.tsx
@@ -129,7 +129,7 @@ export function PricingSection() {
}
return (
- <section className="py-16 md:py-24 w-full">
+ <section className="py-16 md:py-24 w-full relative z-10">
<div className="max-w-[1300px] mx-auto px-4">
<div className="mb-12 text-center max-w-3xl mx-auto">
<h2 className="text-4xl md:text-5xl font-bold tracking-tight pb-4 text-transparent bg-clip-text bg-gradient-to-b from-neutral-900 via-neutral-700 to-neutral-500 dark:from-white dark:via-gray-200 dark:to-gray-400">