Skip to content

Commit b270855

Browse files
committed
fix: clickable icon for logo, github star count
1 parent 0c9f242 commit b270855

File tree

8 files changed

+99
-35
lines changed

8 files changed

+99
-35
lines changed

apps/docs/app/(home)/layout.tsx

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,38 @@ import type { ReactNode } from 'react';
33
import { baseOptions } from '@/app/layout.config';
44
import { Navbar } from '@/components/navbar';
55

6-
export default function Layout({ children }: { children: ReactNode }) {
6+
async function getGithubStars(): Promise<number | null> {
7+
try {
8+
const response = await fetch(
9+
'https://api.github.com/repos/databuddy-analytics/databuddy',
10+
{
11+
headers: {
12+
Accept: 'application/vnd.github+json',
13+
},
14+
next: { revalidate: 3600 },
15+
}
16+
);
17+
18+
if (!response.ok) {
19+
return null;
20+
}
21+
22+
const data = (await response.json()) as { stargazers_count?: number };
23+
return typeof data.stargazers_count === 'number'
24+
? data.stargazers_count
25+
: null;
26+
} catch {
27+
return null;
28+
}
29+
}
30+
31+
export default async function Layout({ children }: { children: ReactNode }) {
32+
const stars = await getGithubStars();
33+
734
return (
835
<HomeLayout {...baseOptions}>
936
<div className="flex min-h-screen flex-col font-manrope">
10-
<Navbar />
37+
<Navbar stars={stars} />
1138
<main>{children}</main>
1239
</div>
1340
</HomeLayout>

apps/docs/components/landing/hero.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
'use client';
22

3+
import dynamic from 'next/dynamic';
34
import DemoContainer from './demo';
4-
import { WorldMap } from './map';
55
import { SciFiButton } from './scifi-btn';
66
import { Spotlight } from './spotlight';
77

8+
const WorldMap = dynamic(() => import('./map').then((m) => m.WorldMap), {
9+
ssr: false,
10+
loading: () => null,
11+
});
12+
813
export default function Hero() {
914
const handleGetStarted = () => {
1015
const newWindow = window.open(
@@ -22,26 +27,31 @@ export default function Hero() {
2227
};
2328

2429
return (
25-
<section className="relative flex min-h-screen w-full flex-col items-center overflow-hidden">
30+
<section className="relative flex min-h-[100svh] w-full flex-col items-center overflow-hidden">
2631
<Spotlight transform="translateX(-60%) translateY(-50%)" />
2732

2833
<div className="mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8">
29-
<div className="grid grid-cols-1 items-center gap-8 pt-16 pb-8 lg:grid-cols-2 lg:gap-12 lg:pt-20 lg:pb-12 xl:gap-16">
34+
<div className="grid grid-cols-1 items-center gap-8 pt-12 pb-6 sm:pt-16 sm:pb-8 lg:grid-cols-2 lg:gap-12 lg:pt-20 lg:pb-12 xl:gap-16">
3035
{/* Text Content */}
31-
<div className="order-2 flex flex-col gap-6 lg:order-1 lg:gap-8">
32-
<h1 className="font-semibold text-3xl leading-tight tracking-tight sm:text-5xl md:text-6xl lg:text-7xl xl:text-[72px]">
36+
<div className="order-2 flex flex-col items-center gap-6 text-center lg:order-1 lg:items-start lg:gap-8 lg:text-left">
37+
<h1 className="text-balance font-semibold text-3xl leading-tight tracking-tight sm:text-5xl md:text-6xl lg:text-7xl xl:text-[72px]">
3338
Privacy <span className="text-muted-foreground">first</span>
3439
<br />
3540
Analytics for <span className="text-muted-foreground">devs</span>
3641
</h1>
3742

38-
<p className="max-w-prose font-medium text-muted-foreground text-sm leading-relaxed tracking-tight sm:text-base lg:text-lg">
43+
<p className="max-w-prose text-balance font-medium text-muted-foreground text-sm leading-relaxed tracking-tight sm:text-base lg:text-lg">
3944
Track users, not identities. Get fast, accurate insights with zero
4045
cookies and 100% GDPR compliance.
4146
</p>
4247

43-
<div className="pt-2">
44-
<SciFiButton onClick={handleGetStarted}>GET STARTED</SciFiButton>
48+
<div className="flex w-full justify-center pt-2 lg:justify-start">
49+
<SciFiButton
50+
className="w-full sm:w-auto"
51+
onClick={handleGetStarted}
52+
>
53+
GET STARTED
54+
</SciFiButton>
4555
</div>
4656
</div>
4757

apps/docs/components/landing/map.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ export const WorldMap = () => {
44
return (
55
<Image
66
alt="World map visualization"
7+
draggable={false}
78
height={327}
8-
priority={false}
9+
priority={true}
910
src={'/world.svg'}
1011
width={559}
1112
/>

apps/docs/components/landing/scifi-btn.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const SciFiButton = forwardRef<HTMLButtonElement, SciFiButtonProps>(
2727
className
2828
)}
2929
ref={ref}
30-
// Ensure non-submit default when used in forms
3130
{...(asChild
3231
? {}
3332
: {

apps/docs/components/logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function Logo() {
4040
<div className="relative flex-shrink-0">
4141
<Image
4242
alt="DataBuddy Logo"
43-
className="drop-shadow-sm"
43+
className="drop-shadow-sm invert dark:invert-0"
4444
height={32}
4545
priority
4646
src="/logo.svg"

apps/docs/components/navbar.tsx

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ import { Menu, X } from 'lucide-react';
44
import Link from 'next/link';
55
import { useState } from 'react';
66
import { ThemeToggle } from '@/components/theme-toggle';
7-
import { LogoContent } from './logo';
7+
import { Logo } from './logo';
88
import { NavLink } from './nav-link';
99

10-
export const Navbar = () => {
10+
export type NavbarProps = {
11+
stars?: number | null;
12+
};
13+
14+
export const Navbar = ({ stars }: NavbarProps) => {
1115
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
1216

1317
const toggleMobileMenu = () => {
@@ -21,7 +25,7 @@ export const Navbar = () => {
2125
<div className="flex h-16 items-center justify-between">
2226
{/* Logo Section */}
2327
<div className="flex-shrink-0">
24-
<LogoContent />
28+
<Logo />
2529
</div>
2630

2731
{/* Desktop Navigation */}
@@ -36,20 +40,33 @@ export const Navbar = () => {
3640
{menu.name}
3741
</NavLink>
3842
))}
39-
<NavLink external href="https://github.com/databuddy-analytics">
40-
<svg
41-
className="transition-transform duration-200 hover:scale-110"
42-
height="1.4em"
43-
viewBox="0 0 496 512"
44-
width="1.4em"
45-
xmlns="http://www.w3.org/2000/svg"
46-
>
47-
<title>GitHub</title>
48-
<path
49-
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6c-3.3.3-5.6-1.3-5.6-3.6c0-2 2.3-3.6 5.2-3.6c3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9c2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9c.3 2 2.9 3.3 5.9 2.6c2.9-.7 4.9-2.6 4.6-4.6c-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2c12.8 2.3 17.3-5.6 17.3-12.1c0-6.2-.3-40.4-.3-61.4c0 0-70 15-84.7-29.8c0 0-11.4-29.1-27.8-36.6c0 0-22.9-15.7 1.6-15.4c0 0 24.9 2 38.6 25.8c21.9 38.6 58.6 27.5 72.9 20.9c2.3-16 8.8-27.1 16-33.7c-55.9-6.2-112.3-14.3-112.3-110.5c0-27.5 7.6-41.3 23.6-58.9c-2.6-6.5-11.1-33.3 2.6-67.9c20.9-6.5 69 27 69 27c20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27c13.7 34.7 5.2 61.4 2.6 67.9c16 17.7 25.8 31.5 25.8 58.9c0 96.5-58.9 104.2-114.8 110.5c9.2 7.9 17 22.9 17 46.4c0 33.7-.3 75.4-.3 83.6c0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252C496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2c1.6 1.6 3.9 2.3 5.2 1c1.3-1 1-3.3-.7-5.2c-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9c1.6 1 3.6.7 4.3-.7c.7-1.3-.3-2.9-2.3-3.9c-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2c2.3 2.3 5.2 2.6 6.5 1c1.3-1.3.7-4.3-1.3-6.2c-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2c-1.4-2.3-4-3.3-5.6-2"
50-
fill="currentColor"
51-
/>
52-
</svg>
43+
<NavLink
44+
external
45+
href="https://github.com/databuddy-analytics/Databuddy"
46+
>
47+
<span className="inline-flex items-center gap-2">
48+
<svg
49+
className="transition-transform duration-200 hover:scale-110"
50+
height="1.4em"
51+
viewBox="0 0 496 512"
52+
width="1.4em"
53+
xmlns="http://www.w3.org/2000/svg"
54+
>
55+
<title>GitHub</title>
56+
<path
57+
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6c-3.3.3-5.6-1.3-5.6-3.6c0-2 2.3-3.6 5.2-3.6c3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9c2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9c.3 2 2.9 3.3 5.9 2.6c2.9-.7 4.9-2.6 4.6-4.6c-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2c12.8 2.3 17.3-5.6 17.3-12.1c0-6.2-.3-40.4-.3-61.4c0 0-70 15-84.7-29.8c0 0-11.4-29.1-27.8-36.6c0 0-22.9-15.7 1.6-15.4c0 0 24.9 2 38.6 25.8c21.9 38.6 58.6 27.5 72.9 20.9c2.3-16 8.8-27.1 16-33.7c-55.9-6.2-112.3-14.3-112.3-110.5c0-27.5 7.6-41.3 23.6-58.9c-2.6-6.5-11.1-33.3 2.6-67.9c20.9-6.5 69 27 69 27c20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27c13.7 34.7 5.2 61.4 2.6 67.9c16 17.7 25.8 31.5 25.8 58.9c0 96.5-58.9 104.2-114.8 110.5c9.2 7.9 17 22.9 17 46.4c0 33.7-.3 75.4-.3 83.6c0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252C496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2c1.6 1.6 3.9 2.3 5.2 1c1.3-1 1-3.3-.7-5.2c-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9c1.6 1 3.6.7 4.3-.7c.7-1.3-.3-2.9-2.3-3.9c-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2c2.3 2.3 5.2 2.6 6.5 1c1.3-1.3.7-4.3-1.3-6.2c-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2c-1.4-2.3-4-3.3-5.6-2"
58+
fill="currentColor"
59+
/>
60+
</svg>
61+
{typeof stars === 'number' && (
62+
<span
63+
className="rounded border border-border/40 bg-muted/40 px-2 py-0.5 text-foreground/80 text-xs"
64+
title="GitHub stars"
65+
>
66+
{stars.toLocaleString()}
67+
</span>
68+
)}
69+
</span>
5370
</NavLink>
5471
<li className="ml-2">
5572
<ThemeToggle />
@@ -145,7 +162,17 @@ export const Navbar = () => {
145162
fill="currentColor"
146163
/>
147164
</svg>
148-
<span>GitHub</span>
165+
<span className="flex items-center gap-2">
166+
GitHub
167+
{typeof stars === 'number' && (
168+
<span
169+
className="rounded border border-border/40 bg-muted/40 px-2 py-0.5 text-foreground/80 text-xs"
170+
title="GitHub stars"
171+
>
172+
{stars.toLocaleString()}
173+
</span>
174+
)}
175+
</span>
149176
</Link>
150177
</div>
151178
</div>
@@ -155,10 +182,6 @@ export const Navbar = () => {
155182
};
156183

157184
export const navMenu = [
158-
{
159-
name: 'Home',
160-
path: '/',
161-
},
162185
{
163186
name: 'Docs',
164187
path: '/docs',
@@ -171,6 +194,10 @@ export const navMenu = [
171194
name: 'Privacy',
172195
path: '/privacy',
173196
},
197+
{
198+
name: 'Pricing',
199+
path: '/pricing',
200+
},
174201
{
175202
name: 'Dashboard',
176203
path: 'https://app.databuddy.cc',
-12.6 KB
Binary file not shown.

apps/docs/public/scifi-hover.mp3

-16 KB
Binary file not shown.

0 commit comments

Comments
 (0)