purr/views/gen.hamlet

51 lines
1.4 KiB
Plaintext

<div #generators .column>
<h2>Generators
<h3>Random, Classic, XKCD
<form id="genForm">
<div .generators">
<input type="radio" id="gibberish" name="newSec" value="#{show genGibberish}">
<label for="gibberish" .genResult>#{show genGibberish}
<br />
<input type="radio" id="oldschool" name="newSec" value="#{show genOldschool}">
<label for="oldschool" .genResult>#{show genOldschool}
<br />
<input type="radio" id="xkcd" name="newSec" value="#{show genXkcd}">
<label for="xkcd" .genResult>#{show genXkcd}
<button .genButton
hx-get="/gen"
hx-target="#generators"
hx-swap="outerHTML"
/>
Generate New
<br />
<div .validForm>
<h3>Share Generated Password
Valid for:
<br />
<input .numberInput
name="newSecDuration"
type="number"
min="1"
max="90"
value="20"
onkeyup="if (value < 1 || value > 90) { value = 0 }"
/> days
<input .numberInput
name="newSecViews"
type="number"
min="1"
max="60"
value="20"
onkeyup="if (value < 1 || value > 60) { value = 0 }"
/> views
<button .genButton
hx-post="/new"
hx-target="#requestedPw"
hx-swap="outerHTML"
hx-include="[name='newSec']"
/>
Share Password
<img class="htmx-indicator" src="/loading.svg" />