A complete, production-quality static authentication UI built with vanilla HTML, CSS, and JavaScript.
-
Download the project
# Using Git git clone https://github.com/Samuel-025/Login.github.io.git # Or download ZIP from GitHub # https://github.com/Samuel-025/Login.github.io/archive/main.zip
-
Open in browser
# Navigate to the folder cd Login.github.io # Open index.html directly in your browser # Double-click the file, or: open index.html # macOS start index.html # Windows xdg-open index.html # Linux
-
Live preview (optional but recommended)
# Using Python (built-in, no install needed) python -m http.server 8000 # Visit: http://localhost:8000 # Using Node.js npm install -g http-server http-server -p 8000 # Visit: http://localhost:8000
The site is already live β no setup needed:
π https://samuel-025.github.io/Login.github.io/
-
Copy the files
cp -r Login.github.io/ your-new-project/
-
Reference shared CSS & JS in your HTML
<link rel="stylesheet" href="css/style.css"> <script src="js/app.js"></script>
-
Link pages together
<a href="index.html">Login</a> <a href="register.html">Register</a> <a href="forgot.html">Forgot Password</a> <a href="dashboard.html">Dashboard</a>
- Fork this repository (click Fork on GitHub)
- Rename the repo to
yourusername.github.iofor a root site, or keep any name for a sub-path site - Go to Settings β Pages
- Set Source to
mainbranch β Save - Your site will be live at
https://yourusername.github.io/Login.github.io/
Login.github.io/
βββ index.html # Login page
βββ register.html # Registration page
βββ forgot.html # Forgot password page
βββ dashboard.html # Protected dashboard
βββ 404.html # Custom not-found page
βββ css/
β βββ style.css # Shared design system (tokens, layout, components)
βββ js/
β βββ app.js # Shared utilities (auth store, toast, validation, theme)
βββ README.md # This file
- β
Persistent auth via
localStorage(survives page refresh) - β Route guards β dashboard redirects to login if not signed in
- β Real-time form validation with inline error messages
- β Password show/hide toggle on all password fields
- β Password strength meter on registration (Weak β Fair β Good β Strong β)
- β Loading spinner on all submit buttons
- β Toast notifications β success / info / error
- β
Dark / Light mode toggle (respects
prefers-color-scheme, persists in localStorage) - β Social sign-in placeholders (Google, GitHub)
- β Profile editing on dashboard (name + phone)
- β Animated gradient mesh background
- β Fully responsive β mobile-first (375px+)
- β
Accessible: semantic HTML,
aria-label,:focus-visible,aria-livetoast
To run locally:
- Any modern web browser β Chrome, Firefox, Safari, Edge
- No Node, npm, or build tools required
To deploy:
- GitHub account (for GitHub Pages, free)
- OR any static host: Netlify, Vercel, Cloudflare Pages
- Register β account saved to
localStorage(auth_usersarray) - Login β credentials checked against stored users; current user saved to
auth_user - Dashboard β reads
auth_user, blocks access if missing - Logout β clears
auth_user, redirects to login
localStorage.setItem('auth_users', JSON.stringify([...users])); // All registered accounts
localStorage.setItem('auth_user', JSON.stringify(user)); // Active session
localStorage.setItem('theme', 'dark'); // Theme preference// Top of dashboard.html β redirect if not logged in
if (!localStorage.getItem('auth_user')) {
window.location.href = 'index.html';
}All colors are CSS variables in css/style.css:
[data-theme="dark"] {
--color-primary: #4f98a3; /* buttons, links, focus rings */
--color-bg: #0f0e0d; /* page background */
--color-surface: #1c1b19; /* card background */
--color-text: #cdccca; /* body text */
--color-error: #d163a7; /* validation errors */
--color-success: #6daa45; /* success toasts */
}Replace the Google Fonts link in every HTML <head>:
<!-- Current: Inter -->
<link href="https://fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap" rel="stylesheet">
<!-- Example: Poppins -->
<link href="https://fonts.googleapis.com/css2?family=Poppins:[email protected]&display=swap" rel="stylesheet">Then update in css/style.css:
--font-body: 'Poppins', system-ui, sans-serif;Each HTML file has an SVG logo inside .auth-header. Replace with your own:
<svg class="logo" viewBox="0 0 40 40">
<!-- Paste your SVG path here -->
</svg>
<!-- Or use an image -->
<img class="logo" src="logo.png" alt="Your brand" width="48" height="48">| Problem | Solution |
|---|---|
| Styles/scripts not loading locally | Use a local server: python -m http.server 8000 |
| Opened from ZIP and nothing works | Extract the ZIP first, then open |
| Theme not persisting | Check that browser allows localStorage (no private/incognito restrictions) |
| Dashboard shows stale data | Hard refresh: Ctrl+Shift+R (Win) / Cmd+Shift+R (Mac) |
| Want to reset all accounts | Run localStorage.clear() in browser DevTools console |
MIT License β free to use, modify, and distribute for personal or commercial projects.
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add my feature' - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
- Project: Samuel-025/Login.github.io
- Live site: https://samuel-025.github.io/Login.github.io/