Skip to content

Commit 0874a1a

Browse files
HyteqHyteq
authored andcommitted
feat: improve demo and fullscreen option
1 parent a4ec3f6 commit 0874a1a

1 file changed

Lines changed: 40 additions & 8 deletions

File tree

apps/docs/app/demo/page.tsx

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

33
import Link from "next/link";
4-
import { Play, BarChart3, Users, Zap, Eye, ArrowRight } from 'lucide-react';
4+
import { Play, BarChart3, Users, Zap, Eye, ArrowRight, Maximize2, Minimize2 } from 'lucide-react';
55
import Squares from "@/components/bits/squares";
66
import Image from "next/image";
7+
import { useState } from 'react';
78

89
export default function DemoPage() {
10+
const [isFullscreen, setIsFullscreen] = useState(false);
11+
12+
const toggleFullscreen = () => {
13+
setIsFullscreen(!isFullscreen);
14+
};
15+
916
return (
1017
<div className="min-h-screen bg-black">
1118
{/* Hero Section */}
@@ -41,9 +48,12 @@ export default function DemoPage() {
4148
Watch how our privacy-first analytics provides powerful insights without compromising your visitors' privacy or your site's performance.
4249
</p>
4350

44-
{/* Video Container */}
45-
<div className="mx-auto max-w-5xl">
46-
<div className="relative overflow-hidden rounded-xl border border-neutral-800 bg-neutral-900 shadow-2xl">
51+
{/* Demo Container */}
52+
<div className={`transition-all duration-300 ${isFullscreen
53+
? 'fixed inset-0 z-50 bg-black p-4'
54+
: 'mx-auto max-w-[95vw]'
55+
}`}>
56+
<div className="relative overflow-hidden rounded-xl border border-neutral-800 bg-neutral-900 shadow-2xl h-full">
4757
<div className="flex items-center justify-between border-b border-neutral-700 bg-neutral-800/50 px-6 py-4">
4858
<div className="flex items-center gap-3">
4959
<div className="flex gap-2">
@@ -55,13 +65,35 @@ export default function DemoPage() {
5565
Databuddy Analytics Dashboard
5666
</span>
5767
</div>
58-
<div className="flex items-center gap-2">
59-
<div className="h-2 w-2 animate-pulse rounded-full bg-green-500" />
60-
<span className="text-xs text-neutral-400">Live Demo</span>
68+
<div className="flex items-center gap-4">
69+
<div className="flex items-center gap-2">
70+
<div className="h-2 w-2 animate-pulse rounded-full bg-green-500" />
71+
<span className="text-xs text-neutral-400">Live Demo</span>
72+
</div>
73+
<button
74+
onClick={toggleFullscreen}
75+
className="flex items-center gap-2 px-3 py-1.5 text-xs text-neutral-400 hover:text-white hover:bg-neutral-700 rounded-md transition-colors"
76+
data-track="demo-fullscreen-toggle"
77+
data-section="demo"
78+
data-action={isFullscreen ? 'exit-fullscreen' : 'enter-fullscreen'}
79+
>
80+
{isFullscreen ? (
81+
<>
82+
<Minimize2 className="h-3 w-3" />
83+
Exit Fullscreen
84+
</>
85+
) : (
86+
<>
87+
<Maximize2 className="h-3 w-3" />
88+
Fullscreen
89+
</>
90+
)}
91+
</button>
6192
</div>
6293
</div>
6394

64-
<div className="aspect-video bg-black">
95+
<div className={`bg-black ${isFullscreen ? 'h-[calc(100vh-80px)]' : ''
96+
}`} style={!isFullscreen ? { height: '70vh', width: '100%' } : {}}>
6597
<iframe
6698
src="https://app.databuddy.cc/demo/OXmNQsViBT-FOS_wZCTHc"
6799
className="h-full w-full border-0"

0 commit comments

Comments
 (0)