From de37a5a3c4160f03e3159c6c53b32d541290d2a9 Mon Sep 17 00:00:00 2001 From: simonweigold Date: Mon, 3 Aug 2026 22:41:17 +0200 Subject: [PATCH 1/2] Implement SplashProvider and useSplash hook; refactor LandingPage and Layout for splash state management --- apps/website/src/App.tsx | 63 +++++++------- apps/website/src/components/Layout.tsx | 22 ++++- .../src/components/LifecycleAnimation.tsx | 85 +++++++++++++++++-- apps/website/src/contexts/SplashContext.ts | 11 +++ apps/website/src/contexts/SplashProvider.tsx | 11 +++ apps/website/src/hooks/useSplash.ts | 7 ++ apps/website/src/index.css | 11 +++ apps/website/src/pages/LandingPage.tsx | 25 +++++- 8 files changed, 194 insertions(+), 41 deletions(-) create mode 100644 apps/website/src/contexts/SplashContext.ts create mode 100644 apps/website/src/contexts/SplashProvider.tsx create mode 100644 apps/website/src/hooks/useSplash.ts diff --git a/apps/website/src/App.tsx b/apps/website/src/App.tsx index 8378b18..bb0d72a 100644 --- a/apps/website/src/App.tsx +++ b/apps/website/src/App.tsx @@ -2,6 +2,7 @@ import { BrowserRouter, Routes, Route } from "react-router-dom"; import { Analytics } from "@vercel/analytics/react"; import { AuthProvider } from "./hooks/useAuth"; import { ToastProvider } from "./hooks/useToast"; +import { SplashProvider } from "./contexts/SplashProvider"; import Layout from "./components/Layout"; import AuthGuard from "./components/AuthGuard"; import LandingPage from "./pages/LandingPage"; @@ -15,39 +16,41 @@ import DocsPage from "./pages/DocsPage"; export default function App() { return ( - - - - }> - {/* Public landing page */} - } /> + + + + + }> + {/* Public landing page */} + } /> - {/* Documentation */} - } /> - } /> + {/* Documentation */} + } /> + } /> - {/* Auth */} - } /> - } /> - } - /> - } /> + {/* Auth */} + } /> + } /> + } + /> + } /> - {/* Early Access page - requires auth */} - - - - } - /> - - - - + {/* Early Access page - requires auth */} + + + + } + /> + + + + + ); diff --git a/apps/website/src/components/Layout.tsx b/apps/website/src/components/Layout.tsx index 371f62a..cd913f4 100644 --- a/apps/website/src/components/Layout.tsx +++ b/apps/website/src/components/Layout.tsx @@ -1,10 +1,12 @@ import { Link, Outlet, useLocation } from "react-router-dom"; import { useAuth } from "../hooks/useAuth"; +import { useSplash } from "../hooks/useSplash"; import { ToastContainer } from "../hooks/useToast"; import { LogOut, Github } from "lucide-react"; export default function Layout() { const { user, supabaseConfigured, loading } = useAuth(); + const { isSplashActive } = useSplash(); const location = useLocation(); // Determine if we're on a landing page route @@ -23,16 +25,30 @@ export default function Layout() { return (
{/* Navigation — frosted glass */} -
+
- + -