diff --git a/src/App.tsx b/src/App.tsx
index a141dd3..58a79a8 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -5,6 +5,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
import { AuthProvider } from "@/contexts/AuthContext";
import { ProtectedRoute } from "@/components/auth/ProtectedRoute";
+import { PageLoader } from "@/components/ui/PageLoader"; // Added import for PageLoader
import Login from "./pages/Login";
import Dashboard from "./pages/Dashboard";
import PartnerDirectory from "./features/partners/PartnerDirectory";
@@ -24,6 +25,7 @@ const App = () => (
+ {/* Rendered PageLoader here */}
} />
{
+ const textFill = document.querySelector(".text-fill") as HTMLElement;
+
+ if (textFill) {
+ let progress = 0;
+ const mapProgressToClipPath = transform(
+ [0, 1],
+ ["inset(0 100% 0 0)", "inset(0 0% 0 0)"]
+ );
+
+ const interval = setInterval(() => {
+ progress = progress + Math.random() * 0.2;
+ if (progress > 1) progress = 1;
+
+ animate(
+ textFill,
+ { clipPath: mapProgressToClipPath(progress) },
+ { type: "spring", stiffness: 100, damping: 10 }
+ );
+
+ if (progress >= 1) {
+ clearInterval(interval);
+ setTimeout(() => setIsLoaded(true), 500); // Wait a bit before hiding
+ }
+ }, 500);
+
+ return () => clearInterval(interval);
+ }
+ }, []);
+
+ if (isLoaded) return null;
+
+ return (
+
+ );
+}