daybook/templates/artifacts/login.html
peter 9a3b381f39 Add light/dark mode toggle for the UI
The UI stylesheet already centralized its palette in a :root block, so this
mostly meant (1) migrating the ~30 colors still hardcoded in rules into
variables so they flip in one place, and (2) adding a [data-theme="dark"]
override palette. Artifact rendering is untouched — those use the separate
static/themes/*.css and the preview backdrop stays white by design, since
artifacts (charts, reports) are authored light.

- Toggle lives in the gear-menu dropdown (Dark mode / Light mode), persists
  to localStorage.
- A tiny inline script in each page <head> (feed, settings, login) applies
  the stored theme before first paint, so dark-mode users never see a white
  flash on load.
- color-scheme: dark on the dark palette makes native form controls
  (inputs, buttons) render dark too.
- Semantic accents (kept=green, shared=blue, today, danger) got
  dark-appropriate variants; status/data-viz colors (usage bar, tag chips)
  and the white artifact backdrop are intentionally left as-is.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-02 17:14:56 +01:00

44 lines
1.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Log in — AgentFeed</title>
<link rel="stylesheet" href="/static/daybook.css">
<script>
// Set the theme before first paint so dark-mode users never see a light flash.
(function () {
try {
if (localStorage.getItem("daybook.theme") === "dark") {
document.documentElement.setAttribute("data-theme", "dark");
}
} catch (e) {}
})();
</script>
</head>
<body>
<main class="login-page">
<form method="post" class="login-card">
{% csrf_token %}
<h1>AgentFeed</h1>
{% if form.non_field_errors %}
<p class="login-error">{{ form.non_field_errors|join:" " }}</p>
{% endif %}
<label>
<span>Username</span>
{{ form.username }}
</label>
<label>
<span>Password</span>
{{ form.password }}
</label>
<label class="login-remember">
{{ form.remember_me }}
<span>Remember me</span>
</label>
<button type="submit">Log in</button>
<input type="hidden" name="next" value="{{ next }}">
</form>
</main>
</body>
</html>