init: init of the repository with basic connexion page and dashboard
This commit is contained in:
24
app/dashboard/layout.tsx
Normal file
24
app/dashboard/layout.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Sidebar from "@/components/Sidebar";
|
||||
|
||||
export default function AuthLayout({ children }: { children: React.ReactNode }) {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (sessionStorage.getItem("wyview_auth") !== "true") {
|
||||
router.push("/");
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen">
|
||||
<Sidebar />
|
||||
<main className="ml-56 flex-1 p-8">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
9
app/dashboard/page.tsx
Normal file
9
app/dashboard/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
export default function DashboardPage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="text-[9px] font-mono tracking-[0.3em] text-[#4aff8c]/50 uppercase mb-1">Vue générale</div>
|
||||
<h1 className="text-2xl font-black tracking-widest text-white uppercase mb-8">Tableau de bord</h1>
|
||||
<p className="text-[#3a5a3a] font-mono text-sm">Données à venir...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
24
app/finances/layout.tsx
Normal file
24
app/finances/layout.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Sidebar from "@/components/Sidebar";
|
||||
|
||||
export default function AuthLayout({ children }: { children: React.ReactNode }) {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (sessionStorage.getItem("wyview_auth") !== "true") {
|
||||
router.push("/");
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen">
|
||||
<Sidebar />
|
||||
<main className="ml-56 flex-1 p-8">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
0
app/finances/page.tsx
Normal file
0
app/finances/page.tsx
Normal file
7
app/globals.css
Normal file
7
app/globals.css
Normal file
@@ -0,0 +1,7 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
::-webkit-scrollbar { width: 4px; }
|
||||
::-webkit-scrollbar-track { background: transparent; }
|
||||
::-webkit-scrollbar-thumb { background: #1a2a1a; border-radius: 2px; }
|
||||
24
app/instagram/layout.tsx
Normal file
24
app/instagram/layout.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Sidebar from "@/components/Sidebar";
|
||||
|
||||
export default function AuthLayout({ children }: { children: React.ReactNode }) {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (sessionStorage.getItem("wyview_auth") !== "true") {
|
||||
router.push("/");
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen">
|
||||
<Sidebar />
|
||||
<main className="ml-56 flex-1 p-8">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
0
app/instagram/page.tsx
Normal file
0
app/instagram/page.tsx
Normal file
17
app/layout.tsx
Normal file
17
app/layout.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "WYVIEW",
|
||||
description: "Dashboard analytics",
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="fr">
|
||||
<body className="bg-[#0a0d0f] text-white antialiased">
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
78
app/page.tsx
Normal file
78
app/page.tsx
Normal file
@@ -0,0 +1,78 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import DragonEye from "@/components/DragonEye";
|
||||
|
||||
export default function LoginPage() {
|
||||
const [password, setPassword] = useState("");
|
||||
const [error, setError] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const router = useRouter();
|
||||
|
||||
const handleLogin = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
setLoading(true);
|
||||
setError(false);
|
||||
await new Promise((r) => setTimeout(r, 500));
|
||||
|
||||
if (password === process.env.NEXT_PUBLIC_PASSWORD) {
|
||||
sessionStorage.setItem("wyview_auth", "true");
|
||||
router.push("/dashboard");
|
||||
} else {
|
||||
setError(true);
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="min-h-screen bg-[#0a0d0f] flex flex-col items-center justify-center relative overflow-hidden">
|
||||
<div className="absolute inset-0 opacity-20 pointer-events-none" style={{
|
||||
backgroundImage: `linear-gradient(rgba(74,255,140,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(74,255,140,0.05) 1px, transparent 1px)`,
|
||||
backgroundSize: "40px 40px",
|
||||
}} />
|
||||
|
||||
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[500px] h-[500px] rounded-full bg-[#4aff8c]/[0.02] blur-3xl pointer-events-none" />
|
||||
|
||||
<div className="relative z-10 flex flex-col items-center gap-8 w-full max-w-sm px-6">
|
||||
<div className="flex flex-col items-center gap-5">
|
||||
<DragonEye size={80} />
|
||||
<div className="text-center">
|
||||
<div className="text-[9px] tracking-[0.45em] text-[#4aff8c]/50 uppercase mb-2 font-mono">
|
||||
Analytics Dashboard
|
||||
</div>
|
||||
<h1 className="text-4xl font-black tracking-[0.15em] uppercase text-white">
|
||||
WYVIEW
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleLogin} className="w-full flex flex-col gap-3">
|
||||
<input
|
||||
type="password"
|
||||
placeholder="Mot de passe"
|
||||
value={password}
|
||||
onChange={(e) => { setPassword(e.target.value); setError(false); }}
|
||||
className={`w-full bg-[#0d1210] border px-4 py-3 text-sm font-mono text-white placeholder-[#2a3a2a] outline-none rounded-sm transition-all duration-200 ${
|
||||
error ? "border-red-500/50" : "border-[#1a2a1a] focus:border-[#4aff8c]/40"
|
||||
}`}
|
||||
/>
|
||||
{error && (
|
||||
<p className="text-red-400/80 text-[11px] font-mono tracking-widest">— ACCÈS REFUSÉ</p>
|
||||
)}
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading || !password}
|
||||
className="w-full py-3 text-[11px] font-mono tracking-[0.3em] uppercase font-bold border border-[#4aff8c]/30 text-[#4aff8c] hover:bg-[#4aff8c]/8 hover:border-[#4aff8c]/60 transition-all duration-200 rounded-sm disabled:opacity-30 disabled:cursor-not-allowed"
|
||||
>
|
||||
{loading ? "VÉRIFICATION..." : "ACCÉDER"}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div className="text-[9px] font-mono text-[#1a3a1a] tracking-[0.3em]">
|
||||
WYVIEW v1.0 /// CROWMATE
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
24
app/tiktok/layout.tsx
Normal file
24
app/tiktok/layout.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Sidebar from "@/components/Sidebar";
|
||||
|
||||
export default function AuthLayout({ children }: { children: React.ReactNode }) {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (sessionStorage.getItem("wyview_auth") !== "true") {
|
||||
router.push("/");
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen">
|
||||
<Sidebar />
|
||||
<main className="ml-56 flex-1 p-8">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
0
app/tiktok/page.tsx
Normal file
0
app/tiktok/page.tsx
Normal file
24
app/twitch/layout.tsx
Normal file
24
app/twitch/layout.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Sidebar from "@/components/Sidebar";
|
||||
|
||||
export default function AuthLayout({ children }: { children: React.ReactNode }) {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (sessionStorage.getItem("wyview_auth") !== "true") {
|
||||
router.push("/");
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen">
|
||||
<Sidebar />
|
||||
<main className="ml-56 flex-1 p-8">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
0
app/twitch/page.tsx
Normal file
0
app/twitch/page.tsx
Normal file
24
app/youtube/layout.tsx
Normal file
24
app/youtube/layout.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Sidebar from "@/components/Sidebar";
|
||||
|
||||
export default function AuthLayout({ children }: { children: React.ReactNode }) {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (sessionStorage.getItem("wyview_auth") !== "true") {
|
||||
router.push("/");
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen">
|
||||
<Sidebar />
|
||||
<main className="ml-56 flex-1 p-8">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
0
app/youtube/page.tsx
Normal file
0
app/youtube/page.tsx
Normal file
Reference in New Issue
Block a user