P1: Login-Seite gruppiert + Passwort-Anzeigen-Toggle
- Karte und BGG-Logo in einer Spalte gruppiert (vorher Flex-Zeile — Logo stand neben der Karte) - Alpine-Toggle 'Passwort anzeigen/verbergen' (statisch type=password, funktioniert ohne JS sicher) - Fokus-Ringe auf Feldern und Button
This commit is contained in:
@@ -5,9 +5,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Anmelden — {{ app_name }}</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.9/dist/cdn.min.js"></script>
|
||||
<style>[x-cloak] { display: none !important; }</style>
|
||||
</head>
|
||||
<body class="bg-slate-100 text-slate-800 min-h-screen flex items-center justify-center px-4">
|
||||
<div class="bg-white shadow-md rounded-xl p-8 w-full max-w-sm">
|
||||
<body class="bg-slate-100 text-slate-800 min-h-screen flex items-center justify-center px-4 py-8">
|
||||
<div class="w-full max-w-sm flex flex-col items-center">
|
||||
<div class="bg-white shadow-md rounded-xl p-8 w-full">
|
||||
<h1 class="text-xl font-bold mb-1 flex items-center gap-2">{% from "icons.html" import icon_wuerfelbecher %}{{ icon_wuerfelbecher("h-6 w-6 text-emerald-700") }} {{ app_name }}</h1>
|
||||
<p class="text-sm text-slate-500 mb-6">Bitte anmelden.</p>
|
||||
{% if fehler %}
|
||||
@@ -15,21 +18,29 @@
|
||||
{{ fehler }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<form method="post" action="/login" class="space-y-4">
|
||||
<form method="post" action="/login" class="space-y-4" x-data="{ passwortSichtbar: false }">
|
||||
<div>
|
||||
<label for="username" class="block text-sm font-medium mb-1">Benutzername</label>
|
||||
<input id="username" name="username" value="{{ username }}" required autocomplete="username"
|
||||
{% if fehler %}aria-invalid="true" aria-describedby="login-fehler"{% endif %}
|
||||
class="w-full border border-slate-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500">
|
||||
class="w-full border border-slate-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
|
||||
</div>
|
||||
<div>
|
||||
<label for="password" class="block text-sm font-medium mb-1">Passwort</label>
|
||||
<input id="password" name="password" type="password" required autocomplete="current-password"
|
||||
<div class="relative">
|
||||
<input id="password" name="password" type="password" :type="passwortSichtbar ? 'text' : 'password'" required autocomplete="current-password"
|
||||
{% if fehler %}aria-invalid="true" aria-describedby="login-fehler"{% endif %}
|
||||
class="w-full border border-slate-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500">
|
||||
class="w-full border border-slate-300 rounded-lg px-3 py-2 pr-16 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
|
||||
<button type="button" @click="passwortSichtbar = !passwortSichtbar"
|
||||
:aria-pressed="passwortSichtbar.toString()"
|
||||
class="absolute inset-y-0 right-0 my-1 mr-1 px-3 rounded-lg text-xs font-medium text-slate-500 hover:bg-slate-100 hover:text-slate-700">
|
||||
<span x-show="!passwortSichtbar">Anzeigen</span>
|
||||
<span x-show="passwortSichtbar" x-cloak>Verbergen</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit"
|
||||
class="w-full min-h-[44px] bg-emerald-600 hover:bg-emerald-700 active:bg-emerald-800 text-white font-medium rounded-lg px-3 py-2">
|
||||
class="w-full min-h-[44px] bg-emerald-600 hover:bg-emerald-700 active:bg-emerald-800 text-white font-medium rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2">
|
||||
Anmelden
|
||||
</button>
|
||||
</form>
|
||||
@@ -40,5 +51,6 @@
|
||||
width="120" height="35" class="inline-block opacity-80 hover:opacity-100">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user