feat: add a white theme

This commit is contained in:
Pierre Ryssen
2026-03-11 16:02:55 +01:00
parent 9642f2511a
commit d5d7b15f16
22 changed files with 297 additions and 241 deletions

View File

@@ -8,13 +8,11 @@ import DragonEye from "@/components/DragonEye";
export default function AuthPage() {
const [tab, setTab] = useState<"login" | "register">("login");
// Login state
const [loginEmail, setLoginEmail] = useState("");
const [loginPassword, setLoginPassword] = useState("");
const [loginError, setLoginError] = useState("");
const [loginLoading, setLoginLoading] = useState(false);
// Register state
const [regName, setRegName] = useState("");
const [regEmail, setRegEmail] = useState("");
const [regPassword, setRegPassword] = useState("");
@@ -85,61 +83,64 @@ export default function AuthPage() {
}
};
const inputStyle: React.CSSProperties = {
background: "var(--surface)",
color: "var(--text-primary)",
borderColor: "var(--border)",
};
const inputClass = (hasError: boolean) =>
`w-full bg-wy-surface border px-4 py-3 text-sm font-mono text-wy-text-primary placeholder-wy-text-secondary outline-none rounded-md transition-all duration-200 ${
hasError ? "border-red-500/60" : "border-wy-border focus:border-acid-green/60"
`w-full px-4 py-3 text-sm font-mono outline-none rounded-md transition-all duration-200 border ${
hasError ? "border-red-500/60" : "focus:border-[color:var(--accent)]"
}`;
return (
<main className="min-h-screen bg-wy-dark flex flex-col items-center justify-center relative overflow-hidden">
<main className="min-h-screen flex flex-col items-center justify-center relative overflow-hidden"
style={{ background: "var(--bg)", color: "var(--text-primary)" }}>
<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)`,
backgroundImage: `linear-gradient(var(--accent-border) 1px, transparent 1px), linear-gradient(90deg, var(--accent-border) 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-acid-green/[0.02] blur-3xl pointer-events-none" />
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[500px] h-[500px] rounded-full blur-3xl pointer-events-none"
style={{ background: "var(--accent-dim)" }} />
<div className="relative z-10 flex flex-col items-center gap-8 w-full max-w-sm px-6">
{/* Header */}
<div className="flex flex-col items-center gap-5">
<DragonEye size={80} />
<div className="text-center">
<div className="text-[9px] tracking-[0.45em] text-acid-green/70 uppercase mb-2 font-mono">
<div className="text-[9px] tracking-[0.45em] uppercase mb-2 font-mono" style={{ color: "var(--accent)" }}>
Analytics Dashboard
</div>
<h1 className="text-4xl font-black tracking-[0.15em] uppercase text-wy-text-primary">
<h1 className="text-4xl font-black tracking-[0.15em] uppercase" style={{ color: "var(--text-primary)" }}>
WYVIEW
</h1>
</div>
</div>
{/* Tabs */}
<div className="w-full flex border border-wy-border rounded-md overflow-hidden">
<div className="w-full flex rounded-md overflow-hidden" style={{ border: "1px solid var(--border)" }}>
<button
onClick={() => { setTab("login"); setLoginError(""); }}
className={`flex-1 py-2 text-[10px] font-mono tracking-[0.3em] uppercase transition-all duration-200 ${
tab === "login"
? "bg-acid-green/10 text-acid-green border-r border-wy-border"
: "text-wy-text-secondary hover:text-acid-green/80 border-r border-wy-border"
}`}
className="flex-1 py-2 text-[10px] font-mono tracking-[0.3em] uppercase transition-all duration-200"
style={tab === "login"
? { background: "var(--accent-dim)", color: "var(--accent)", borderRight: "1px solid var(--border)" }
: { color: "var(--text-secondary)", borderRight: "1px solid var(--border)" }}
>
CONNEXION
</button>
<button
onClick={() => { setTab("register"); setRegError(""); setRegSuccess(""); }}
className={`flex-1 py-2 text-[10px] font-mono tracking-[0.3em] uppercase transition-all duration-200 ${
tab === "register"
? "bg-acid-green/10 text-acid-green"
: "text-wy-text-secondary hover:text-acid-green/80"
}`}
className="flex-1 py-2 text-[10px] font-mono tracking-[0.3em] uppercase transition-all duration-200"
style={tab === "register"
? { background: "var(--accent-dim)", color: "var(--accent)" }
: { color: "var(--text-secondary)" }}
>
INSCRIPTION
</button>
</div>
{/* Login Form */}
{tab === "login" && (
<form onSubmit={handleLogin} className="w-full flex flex-col gap-3">
<input
@@ -149,6 +150,7 @@ export default function AuthPage() {
autoComplete="email"
onChange={(e) => { setLoginEmail(e.target.value); setLoginError(""); }}
className={inputClass(!!loginError)}
style={inputStyle}
/>
<input
type="password"
@@ -157,6 +159,7 @@ export default function AuthPage() {
autoComplete="current-password"
onChange={(e) => { setLoginPassword(e.target.value); setLoginError(""); }}
className={inputClass(!!loginError)}
style={inputStyle}
/>
{loginError && (
<p className="text-red-400/80 text-[11px] font-mono tracking-widest"> {loginError}</p>
@@ -164,14 +167,16 @@ export default function AuthPage() {
<button
type="submit"
disabled={loginLoading || !loginEmail || !loginPassword}
className="w-full py-3 text-[11px] font-mono tracking-[0.3em] uppercase font-bold border border-acid-green text-acid-green hover:bg-acid-green/10 transition-all duration-200 rounded-md disabled:opacity-50 disabled:cursor-not-allowed"
className="w-full py-3 text-[11px] font-mono tracking-[0.3em] uppercase font-bold rounded-md border transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed"
style={{ borderColor: "var(--accent)", color: "var(--accent)" }}
onMouseEnter={e => (e.currentTarget.style.background = "var(--accent-dim)")}
onMouseLeave={e => (e.currentTarget.style.background = "transparent")}
>
{loginLoading ? "CONNEXION..." : "ACCÉDER"}
</button>
</form>
)}
{/* Register Form */}
{tab === "register" && (
<form onSubmit={handleRegister} className="w-full flex flex-col gap-3">
<input
@@ -181,6 +186,7 @@ export default function AuthPage() {
autoComplete="name"
onChange={(e) => { setRegName(e.target.value); setRegError(""); }}
className={inputClass(false)}
style={inputStyle}
/>
<input
type="email"
@@ -189,6 +195,7 @@ export default function AuthPage() {
autoComplete="email"
onChange={(e) => { setRegEmail(e.target.value); setRegError(""); }}
className={inputClass(!!regError)}
style={inputStyle}
/>
<input
type="password"
@@ -197,6 +204,7 @@ export default function AuthPage() {
autoComplete="new-password"
onChange={(e) => { setRegPassword(e.target.value); setRegError(""); }}
className={inputClass(!!regError)}
style={inputStyle}
/>
<input
type="password"
@@ -205,24 +213,28 @@ export default function AuthPage() {
autoComplete="new-password"
onChange={(e) => { setRegConfirm(e.target.value); setRegError(""); }}
className={inputClass(!!regError && regPassword !== regConfirm)}
style={inputStyle}
/>
{regError && (
<p className="text-red-400/80 text-[11px] font-mono tracking-widest"> {regError}</p>
)}
{regSuccess && (
<p className="text-acid-green/80 text-[11px] font-mono tracking-widest"> {regSuccess}</p>
<p className="text-[11px] font-mono tracking-widest" style={{ color: "var(--accent)" }}> {regSuccess}</p>
)}
<button
type="submit"
disabled={regLoading || !regEmail || !regPassword || !regConfirm}
className="w-full py-3 text-[11px] font-mono tracking-[0.3em] uppercase font-bold border border-acid-green text-acid-green hover:bg-acid-green/10 transition-all duration-200 rounded-md disabled:opacity-50 disabled:cursor-not-allowed"
className="w-full py-3 text-[11px] font-mono tracking-[0.3em] uppercase font-bold rounded-md border transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed"
style={{ borderColor: "var(--accent)", color: "var(--accent)" }}
onMouseEnter={e => (e.currentTarget.style.background = "var(--accent-dim)")}
onMouseLeave={e => (e.currentTarget.style.background = "transparent")}
>
{regLoading ? "CRÉATION..." : "CRÉER UN COMPTE"}
</button>
</form>
)}
<div className="text-[9px] font-mono text-wy-text-secondary/50 tracking-[0.3em]">
<div className="text-[9px] font-mono tracking-[0.3em]" style={{ color: "var(--text-secondary)" }}>
WYVIEW v1.0 /// CROWMATE
</div>
</div>