purr/views/gen.hamlet

50 lines
1.5 KiB
Plaintext

<div #generators .generators>
<form id="genForm">
<div .generatorRadio">
<label .radioLabel for="xkcd" .genResult>
<input .radioInput type="radio" id="xkcd" name="newSec" value="#{show genXkcd}">
<div .radioDesign>
<div .radioText>#{show genXkcd}
<label .radioLabel for="oldschool" .genResult>
<input .radioInput type="radio" id="oldschool" name="newSec" value="#{show genOldschool}">
<div .radioDesign>
<div .radioText>#{show genOldschool}
<label .radioLabel for="gibberish" .genResult>
<input .radioInput type="radio" id="gibberish" name="newSec" value="#{show genGibberish}">
<div .radioDesign>
<div .radioText>#{show genGibberish}
<div .validForm>
<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 .mainButton
hx-post="/new"
hx-target="#requestedPw"
hx-swap="outerHTML"
hx-include="[name='newSec']"
/>
share selected secret
<img class="htmx-indicator" src="/loading.svg" />
<button .mainButton
hx-get="/gen"
hx-target="#generators"
hx-swap="outerHTML"
/>
regenerate
<br />