-
templates/login.html (67 lines, 1.8KB)
- Clean, responsive HTML with proper semantics
- Dark theme, mobile-first card layout
- Email input + password input + "Sign In" button
- Error banner (hidden by default, role="alert")
- Links /rtsport/static/css/login.css and /rtsport/static/js/login.js
- No external dependencies
- Proper viewport, theme-color, and autocomplete attributes
-
static/js/login.js (158 lines, 4.0KB)
- IIFE wrapped, no global leak
- DOMContentLoaded bootstrap with ready-state guard
- Form submit: prevents default, shows loading spinner, POSTs to /api/v1/auth/login/json
- Success: stores access_token, role, school_id in localStorage; redirects by role
- 401: shows "Invalid email or password" in error banner
- Network error: shows "Connection failed. Please try again."
- Client-side validation (empty fields)
-
static/css/login.css (272 lines, 5.0KB)
- Dark theme using CSS variables (--bg-primary, --text-primary, --accent, etc.)
- Centered card layout, max-width 400px
- Loading spinner animation on submit button (CSS keyframes)
- Error banner: red background, slide-in animation
- Mobile-first: full-width below 480px, touch-friendly 44px min-height inputs
- @media (prefers-color-scheme: light) enforcement for consistent dark theme
- Focus states with blue glow