diff --git a/src/app/(auth)/layout.tsx b/src/app/(auth)/layout.tsx index a38e345..af1a31f 100644 --- a/src/app/(auth)/layout.tsx +++ b/src/app/(auth)/layout.tsx @@ -1,12 +1,12 @@ import Header from "#/components/header"; export default function AuthLayout({ children }: { children: React.ReactNode }) { - return( -
-
-
- {children} -
-
- ) + return ( +
+
+
+ {children} +
+
+ ) } \ No newline at end of file diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx index 5246d7c..935c3a8 100644 --- a/src/app/(auth)/login/page.tsx +++ b/src/app/(auth)/login/page.tsx @@ -50,34 +50,34 @@ export default function LoginPage() { return (
-
-
} - /> -
-
-

Version 0.0.1

-
- +
+
} + /> + +
+

Version 0.0.1

+
+ ) } \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index 23a2526..0c964dd 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -203,6 +203,34 @@ input[type="checkbox"]:checked::before { } +/* Splash Screnn */ + +.splash-screen { + position: fixed; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + background-color: var(--bluegray); + z-index: 99; +} +.splash-screen p{ + width: max-content; + font-size: 32px; + margin: auto; + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; +} +.splash-screen span { + /* font-family: "Inter 200"; */ + font-weight: 100 !important; +} + + + /* Scroll Bar */ ::-webkit-scrollbar { @@ -268,6 +296,13 @@ input[type="checkbox"]:checked::before { left: 22px; animation: bounce 1s infinite ease-in-out; } +.splash-screen .dot{ + font-size: 48px; + top: -28px; + left: 28px; + animation: bounce 1s infinite ease-in-out; +} + @keyframes bounce { @@ -304,6 +339,9 @@ input[type="checkbox"]:checked::before { @media (max-width: 768px) { + .splash-screen p{ + font-size: 24px; + } .login-main{ width: 100%; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6f913f0..f27540f 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -4,6 +4,7 @@ import NextTopLoader from "nextjs-toploader"; import "../assets/css/ruben-ui.css" import { AuthProvider } from "#/components/provider/authProvider"; import { QueryClientProvide } from "#/components/provider/queryClient"; +import SplashScreen from "#/components/splashScreen"; export const metadata: Metadata = { title: "Private Docs", @@ -15,20 +16,21 @@ export default function RootLayout({ }: Readonly<{ children: React.ReactNode; }>) { - + return ( - + - - {children} + + + {children} diff --git a/src/components/header.tsx b/src/components/header.tsx index f691ca1..c2e5822 100644 --- a/src/components/header.tsx +++ b/src/components/header.tsx @@ -11,7 +11,6 @@ export default function Header() { className="text-red-500 h-auto" height={30} /> - {/*

Private Docs

*/}

Prıvate Docs

diff --git a/src/components/splashScreen.tsx b/src/components/splashScreen.tsx new file mode 100644 index 0000000..5c9146e --- /dev/null +++ b/src/components/splashScreen.tsx @@ -0,0 +1,63 @@ +"use client" +import Image from "next/image"; +import { icons } from "#/assets/icons"; +import { ReactNode, useEffect, useState } from "react"; + +interface Props { + name: string + label: string + timer: number, +} + +export default function SplashScreen({ name, label, timer }: Props) { + + const [showSplash, setShowSplash] = useState(false); + + + useEffect(() => { + + const timeout = setTimeout(() => setShowSplash(false), timer); + + if (typeof window !== undefined) { + + if (!sessionStorage.getItem('sessionInitialized')) { + setShowSplash(true); + // Set session + } else { + setShowSplash(false); + //console.log('Session already exists'); + } + const handleUnload = () => sessionStorage.removeItem('sessionInitialized') + + window.addEventListener("beforeunload", handleUnload); + + return () => { + clearTimeout(timeout) + handleUnload + } // Clean up the timeout on unmount + + } + + }, [timer]); + + + + return ( + <> + {showSplash && +
+
+ Private Docs +

Prıvate Docs

+
+
+ + } + + ) +} \ No newline at end of file