Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
Sage Vaillancourt 2022-09-23 11:36:24 -04:00
commit 178656c929
2 changed files with 56 additions and 9 deletions

View File

@ -142,7 +142,7 @@ textarea {
color: #a40f0f; color: #a40f0f;
} }
.submit { .wipe {
margin-left: auto; margin-left: auto;
padding: 0.5em 1em 0.5em 1em; padding: 0.5em 1em 0.5em 1em;
} }
@ -150,3 +150,44 @@ textarea {
#body { #body {
flex-grow: 1; flex-grow: 1;
} }
.wipe {
padding: 10px 25px;
font-family: "Roboto", sans-serif;
font-weight: 500;
background: black;
outline: none !important;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
display: inline-block;
text-decoration: none;
}
.up-wipe {
border: 2px solid rgb(255, 255, 255);
z-index: 1;
color: white;
}
.up-wipe:after {
position: absolute;
content: "";
width: 100%;
height: 0;
top: 0;
left: 0;
z-index: -1;
background: rgb(255, 255, 255);
transition: all 0.3s ease;
}
.up-wipe:hover {
color: rgb(0, 0, 0);
}
.up-wipe:hover:after {
top: auto;
bottom: 0;
height: 100%;
}

View File

@ -18,7 +18,13 @@
} }
decodeURIComponent(document.cookie).split(';').forEach(cookie => { decodeURIComponent(document.cookie).split(';').forEach(cookie => {
[id, value] = cookie.trim().split('=') [id, value] = cookie.trim().split('=')
document.getElementById(id).value = value if (!id || !value) {
return
}
const e = document.getElementById(id)
if (e) {
e.value = value
}
}) })
} }
@ -36,7 +42,7 @@
<h2>The secret cover letter generator</h2> <h2>The secret cover letter generator</h2>
{% from "_formhelpers.jinja2" import render_field %} {% from "_formhelpers.jinja2" import render_field %}
<form method=post> <form method=post id="letter-form">
<dl> <dl>
{{ render_field(form.username) }} {{ render_field(form.username) }}
{{ render_field(form.company) }} {{ render_field(form.company) }}
@ -62,14 +68,14 @@
</div> </div>
{% endif %} {% endif %}
<input <a href="javascript:void(0)"
class=submit class="wipe up-wipe"
type=submit
value="Generate PDF"
{% if errors %} {% if errors %}
onclick="clearErrors()" onclick="clearErrors();document.getElementById('letter-form').submit()"
{% else %}
onclick="document.getElementById('letter-form').submit()"
{% endif %} {% endif %}
> >Generate PDF</a>
</form> </form>
</body> </body>