Styling and accessibility tweaks

Add .dark-mode for .errors
Use more correct tags for onClick and form behavior
This commit is contained in:
Sage Vaillancourt 2023-12-17 00:48:40 -05:00
parent f0f19d7d41
commit 09f182fcd0
5 changed files with 23 additions and 11 deletions

View File

@ -131,7 +131,7 @@ def create_account() -> Response:
password = request.form['password'] password = request.form['password']
if password != request.form['confirm-password']: if password != request.form['confirm-password']:
return render_index(error="Password and confirm password must match!", status=400) return render_index(error="Passwords did not match!", status=400)
password_len = len(password) password_len = len(password)
if password_len < 8 or password_len > 64: if password_len < 8 or password_len > 64:
return render_index(error="Password must be between 8 and 64 characters", status=400) return render_index(error="Password must be between 8 and 64 characters", status=400)

View File

@ -236,7 +236,6 @@ input.btn {
flex-direction: row; flex-direction: row;
justify-content: end; justify-content: end;
align-items: center; align-items: center;
font-size: 90%;
} }
.user.logged-in { .user.logged-in {
margin-bottom: 1em; margin-bottom: 1em;
@ -269,6 +268,12 @@ textarea {
.errors { .errors {
color: #a40f0f; color: #a40f0f;
} }
body.dark-mode .errors {
color: white;
background-color: red;
padding: 0.2em;
padding-left: 1em;
}
#body { #body {
flex-grow: 1; flex-grow: 1;
@ -481,3 +486,11 @@ body.dark-mode .text-button:hover {
.scroll-lock { .scroll-lock {
overflow: hidden; overflow: hidden;
} }
.dark-light {
color: white;
}
.dark-light:hover {
color: black;
}

View File

@ -24,9 +24,10 @@
{% endmacro %} {% endmacro %}
{% macro form_submit_button(text, id, action, errors) %} {% macro form_submit_button(text, id, action, errors) %}
<a href="javascript:void(0)" <button type="button"
id="{{ id }}" id="{{ id }}"
class="wipe up-wipe" class="wipe up-wipe"
style="font-size: 1em;"
{% if errors %} {% if errors %}
onclick="/*clearErrors();*/const e = document.getElementById('create-account-form'); e.action = '{{ action }}'; e.submit()" onclick="/*clearErrors();*/const e = document.getElementById('create-account-form'); e.action = '{{ action }}'; e.submit()"
{% else %} {% else %}

View File

@ -86,10 +86,10 @@
{% else %} {% else %}
<div class="user logged-out"> <div class="user logged-out">
<form action="/create_account"> <form action="/create_account">
<div class="btn primary color-fade" style="font-family: 'BarlowMedium'; margin-right: 1em; padding: 0.4em 1em;" onclick="showModal(false, 'Create your account')"> <button type="button" class="btn primary color-fade" style="font-family: 'BarlowMedium'; margin-right: 1em; padding: 0.6em 2em;" onclick="showModal(false, 'Create your account')">
Create account Create account
</div> </button>
<div class="btn secondary color-fade" style="margin: 0; padding: 0.4em 1em;" onclick="showModal(true, 'Login now')">Log in</div> <button type="button" class="btn secondary color-fade" style="margin: 0; padding: 0.6em 2em;" onclick="showModal(true, 'Login now')">Log in</button>
</form> </form>
</div> </div>
{% endif %} {% endif %}

View File

@ -83,11 +83,9 @@
{% endif %} {% endif %}
<div style="text-align: right; margin-bottom: 2em;"> <div style="text-align: right; margin-bottom: 2em;">
<a href="javascript:void(0)" <span class="wipe up-wipe" style="margin-bottom: 1em; padding: 0;">
class="wipe up-wipe" <input type="submit" value="Generate PDF" class="transition dark-light" style="background: rgba(0, 0, 0, 0); border: none; margin: 0; padding: 1em; cursor: pointer;">
style="margin-bottom: 1em;" </span>
onclick="clearErrors();document.getElementById('letter-form').submit()"
>Generate PDF</a>
</div> </div>
</form> </form>
{% endblock content %} {% endblock content %}