diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 9184e86..7687345 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -4,6 +4,7 @@ import Navbar from './components/Navbar' import PortfolioBuilder from './components/PortfolioBuilder' import Dashboard from './pages/Dashboard' import LandingPage from './pages/LandingPage' +import LoginPage from './pages/LoginPage' import { usePortfolioStore } from './store/portfolio' function useNexusFavicon() { @@ -103,17 +104,24 @@ function useNexusFavicon() { export default function App() { const { fromURL } = usePortfolioStore() + const [authed, setAuthed] = useState(() => sessionStorage.getItem('qfx-auth') === '1') const [inApp, setInApp] = useState(() => sessionStorage.getItem('qfx-v') === '1') useNexusFavicon() useEffect(() => { fromURL() }, []) + function handleLogin() { + sessionStorage.setItem('qfx-auth', '1') + setAuthed(true) + } + function enterApp() { sessionStorage.setItem('qfx-v', '1') setInApp(true) } + if (!authed) return if (!inApp) return return ( diff --git a/frontend/src/pages/LoginPage.jsx b/frontend/src/pages/LoginPage.jsx new file mode 100644 index 0000000..eb74a5c --- /dev/null +++ b/frontend/src/pages/LoginPage.jsx @@ -0,0 +1,225 @@ +import { useState } from 'react' +import { NexusIcon } from '../components/NexusLogo' + +const USER = 'mihir.kansara' +const PASS = 'nexus@2026' + +export default function LoginPage({ onLogin }) { + const [u, setU] = useState('') + const [p, setP] = useState('') + const [err, setErr] = useState('') + const [shake, setShake] = useState(false) + const [loading, setLoading] = useState(false) + + function handleSubmit(e) { + e.preventDefault() + setLoading(true) + setTimeout(() => { + if (u === USER && p === PASS) { + onLogin() + } else { + setErr('Invalid credentials. DM for access.') + setShake(true) + setTimeout(() => setShake(false), 600) + } + setLoading(false) + }, 800) + } + + return ( +
+ + + {/* Scanline effect */} +
+ + {/* Grid bg */} +
+ + {/* Glow orb */} +
+ + {/* Login card */} +
+ + {/* Logo */} +
+ +
+
NEXUS
+
+ TERMINAL · RESTRICTED ACCESS +
+
+
+ + {/* Divider */} +
+ + {/* Form */} +
+
+
+ USER ID +
+ { setU(e.target.value); setErr('') }} + autoComplete="off" + spellCheck={false} + /> +
+
+
+ ACCESS KEY +
+ { setP(e.target.value); setErr('') }} + /> +
+ + {err && ( +
+ ⚠ {err} +
+ )} + + +
+ + {/* DM section */} + +
+
+ ) +}