Improve look of auth pages

This commit is contained in:
Peter Stockings
2025-12-17 23:36:13 +11:00
parent 049c875bc2
commit 717a18fa3c
3 changed files with 149 additions and 86 deletions

View File

@@ -9,6 +9,7 @@ show_refresh=False,
show_logs=False,
show_client=False,
show_link=False,
show_tests=False,
dashboardUrl=url_for('http.overview'),
cancel_url=url_for('http.overview'),
title='New HTTP Function')

View File

@@ -2,55 +2,86 @@
{% block content %}
<div class="w-full h-screen flex items-center justify-center" data-id="1">
<div class="rounded-lg border bg-card text-card-foreground shadow-sm w-full max-w-md mx-4 bg-gray-100" data-id="2"
data-v0-t="card">
<div class="flex flex-col space-y-1.5 p-6" data-id="3">
<h1 class="text-3xl font-bold text-center" data-id="4">
Login
<div
class="min-h-screen w-full flex items-center justify-center bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-950 px-4 py-12">
<div class="w-full max-w-md">
<!-- Logo/Branding Section -->
<div class="text-center mb-8">
<div
class="inline-flex items-center justify-center w-16 h-16 bg-gradient-to-br from-blue-500 to-blue-700 rounded-2xl shadow-lg mb-4">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none"
stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"></path>
</svg>
</div>
<h1 class="text-3xl font-bold text-gray-900 dark:text-white mb-2">
Welcome Back
</h1>
{% if error %}
<h2 class="text-2xl font-bold text-center text-red-500" data-id="4">
{{ error }}
</h2>
{% endif %}
<p class="text-gray-600 dark:text-gray-400">Sign in to your Function account</p>
</div>
<form method="POST" class="p-4 space-y-4" data-id="5">
<div class="space-y-2" data-id="6">
<label
class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 {% if error %}text-red-500 {% endif %}"
for="username" data-id="7">
Username
</label>
<input
class="flex h-10 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 w-full {% if error %}border-red-500 {% endif %}"
name="username" placeholder="Enter your username" required="" data-id="8" type="text">
<!-- Login Card -->
<div
class="bg-white dark:bg-gray-800 rounded-2xl shadow-xl border border-gray-200 dark:border-gray-700 overflow-hidden">
{% if error %}
<div class="bg-red-50 dark:bg-red-900/20 border-b border-red-200 dark:border-red-800 px-6 py-4">
<div class="flex items-center text-red-700 dark:text-red-300">
<svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span class="text-sm font-medium">{{ error }}</span>
</div>
</div>
<div class="space-y-2" data-id="9">
<label
class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 {% if error %}text-red-500 {% endif %}"
for="password" data-id="10">Password</label>
<input
class="flex h-10 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 w-full {% if error %}border-red-500 {% endif %}"
name="password" placeholder="Enter your password" required="" data-id="11" type="password">
</div>
<div class="flex justify-between items-center" data-id="12">
<a class="text-sm underline text-gray-500" data-id="13" href="#" rel="ugc">
Forgot password?
</a>
<button
class="inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-primary/90 h-10 px-6 py-2 bg-blue-500 text-white rounded-md"
type="submit" data-id="14">
Login
{% endif %}
<form method="POST" class="p-8 space-y-6">
<!-- Username Field -->
<div class="space-y-2">
<label for="username" class="block text-sm font-semibold text-gray-700 dark:text-gray-300">
Username
</label>
<input id="username" name="username" type="text" required autocomplete="username"
class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 {% if error %}border-red-500 dark:border-red-500 focus:ring-red-500{% endif %}"
placeholder="Enter your username">
</div>
<!-- Password Field -->
<div class="space-y-2">
<label for="password" class="block text-sm font-semibold text-gray-700 dark:text-gray-300">
Password
</label>
<input id="password" name="password" type="password" required autocomplete="current-password"
class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 {% if error %}border-red-500 dark:border-red-500 focus:ring-red-500{% endif %}"
placeholder="Enter your password">
</div>
<!-- Forgot Password Link -->
<div class="flex items-center justify-end">
<a href="#"
class="text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 transition-colors">
Forgot password?
</a>
</div>
<!-- Submit Button -->
<button type="submit"
class="w-full bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white font-semibold py-3 px-6 rounded-lg shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800">
Sign In
</button>
</div>
<hr class="my-4" data-id="15">
<div class="text-center" data-id="16">
<p class="text-gray-500" data-id="17">Don't have an account? <a class="underline text-blue-500"
data-id="18" href="{{ url_for('auth.signup') }}" rel="ugc">Sign up</a>
</p>
</div>
</form>
</form>
</div>
<!-- Sign Up Link -->
<div class="mt-6 text-center">
<p class="text-sm text-gray-600 dark:text-gray-400">
Don't have an account?
<a href="{{ url_for('auth.signup') }}"
class="font-semibold text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 transition-colors">
Sign up for free
</a>
</p>
</div>
</div>
</div>

View File

@@ -2,52 +2,83 @@
{% block content %}
<div class="w-full h-screen flex items-center justify-center" data-id="1">
<div class="rounded-lg border bg-card text-card-foreground shadow-sm w-full max-w-md mx-4 bg-gray-100" data-id="2"
data-v0-t="card">
<div class="flex flex-col space-y-1.5 p-6" data-id="3">
<h1 class="text-3xl font-bold text-center" data-id="4">
Sign up
<div
class="min-h-screen w-full flex items-center justify-center bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-950 px-4 py-12">
<div class="w-full max-w-md">
<!-- Logo/Branding Section -->
<div class="text-center mb-8">
<div
class="inline-flex items-center justify-center w-16 h-16 bg-gradient-to-br from-blue-500 to-blue-700 rounded-2xl shadow-lg mb-4">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none"
stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"></path>
</svg>
</div>
<h1 class="text-3xl font-bold text-gray-900 dark:text-white mb-2">
Create Account
</h1>
{% if error %}
<h2 class="text-2xl font-bold text-center text-red-500" data-id="4">
{{ error }}
</h2>
{% endif %}
<p class="text-gray-600 dark:text-gray-400">Get started with Function today</p>
</div>
<form method="POST" class="p-4 space-y-4" data-id="5">
<div class="space-y-2" data-id="6">
<label
class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 {% if error %}text-red-500 {% endif %}"
for="username" data-id="7">
Username
</label>
<input
class="flex h-10 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 w-full {% if error %}border-red-500 {% endif %}"
name="username" placeholder="Enter your username" required="" data-id="8" type="text">
<!-- Signup Card -->
<div
class="bg-white dark:bg-gray-800 rounded-2xl shadow-xl border border-gray-200 dark:border-gray-700 overflow-hidden">
{% if error %}
<div class="bg-red-50 dark:bg-red-900/20 border-b border-red-200 dark:border-red-800 px-6 py-4">
<div class="flex items-center text-red-700 dark:text-red-300">
<svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span class="text-sm font-medium">{{ error }}</span>
</div>
</div>
<div class="space-y-2" data-id="9">
<label
class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 {% if error %}text-red-500 {% endif %}"
for="password" data-id="10">Password</label>
<input
class="flex h-10 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 w-full {% if error %}border-red-500 {% endif %}"
name="password" placeholder="Enter your password" required="" data-id="11" type="password">
</div>
<div class="flex justify-between items-center" data-id="12">
<button
class="inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-primary/90 h-10 px-6 py-2 bg-blue-500 text-white rounded-md"
type="submit" data-id="14">
Sign up
{% endif %}
<form method="POST" class="p-8 space-y-6">
<!-- Username Field -->
<div class="space-y-2">
<label for="username" class="block text-sm font-semibold text-gray-700 dark:text-gray-300">
Username
</label>
<input id="username" name="username" type="text" required autocomplete="username"
class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 {% if error %}border-red-500 dark:border-red-500 focus:ring-red-500{% endif %}"
placeholder="Choose a username">
</div>
<!-- Password Field -->
<div class="space-y-2">
<label for="password" class="block text-sm font-semibold text-gray-700 dark:text-gray-300">
Password
</label>
<input id="password" name="password" type="password" required autocomplete="new-password"
class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 {% if error %}border-red-500 dark:border-red-500 focus:ring-red-500{% endif %}"
placeholder="Create a strong password">
</div>
<!-- Submit Button -->
<button type="submit"
class="w-full bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white font-semibold py-3 px-6 rounded-lg shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800">
Create Account
</button>
</div>
<hr class="my-4" data-id="15">
<div class="text-center" data-id="16">
<p class="text-gray-500" data-id="17">Already have an accont? <a class="underline text-blue-500"
data-id="18" href="{{ url_for('auth.login') }}" rel="ugc">Login</a>
<!-- Terms & Privacy (Optional) -->
<p class="text-xs text-center text-gray-500 dark:text-gray-400">
By creating an account, you agree to our Terms of Service and Privacy Policy
</p>
</div>
</form>
</form>
</div>
<!-- Login Link -->
<div class="mt-6 text-center">
<p class="text-sm text-gray-600 dark:text-gray-400">
Already have an account?
<a href="{{ url_for('auth.login') }}"
class="font-semibold text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 transition-colors">
Sign in
</a>
</p>
</div>
</div>
</div>