purr/views/index.hamlet
2022-12-24 11:35:36 -06:00

99 lines
2.8 KiB
Plaintext

$doctype 5
<html>
<head>
<title>purr
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://unpkg.com/htmx.org@1.7.0" integrity="sha384-EzBXYPt0/T6gxNp0nuPtLkmRpmDBbjg6WmCUZRLXBBwYYmwAUxzlSGej0ARHX0Bo" crossorigin="anonymous">
<link rel="stylesheet" href="/style.css">
<body>
<header>
<a href="https://git.eversole.co/purr">
Made with &#9829;
| <a href="mailto:#{email}">Contact
<div #title .title>
<h1>
<a #titleLink .titleLink href="/">purr
<div #content .content>
<div #shareUtils .column>
<h2>Sharing Tools
$if (link == "/")
<div #requestedPw .requestedPw>
<p .emptyReq>
$else
<div #requestedPw .requestedPw
hx-trigger="load"
hx-post="/pw"
hx-target="#requestedPw"
hx-swap="outerHTML"
*{hsUserLink}
>
Loading... <img class="htmx-indicator" src="/loading.svg" />
<div #shareNew .shareNew>
<h3>Share New Secret
<p>
<input .mainInput
name="newSec"
type="text"
placeholder="Enter a Secret to Share"
/>
<div .validForm>
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 .mainButton
hx-post="/new"
hx-target="#requestedPw"
hx-swap="outerHTML"
hx-include="[id='shareNew']"
/>
Share Secret
<img class="htmx-indicator" src="/loading.svg" />
<div #requestNew .requestNew>
<h3>Lookup
<p>
<input .mainInput
name="userLink"
type="text"
placeholder="Enter a Link to View Secret"
/>
<button .mainButton
hx-post="/pw"
hx-target="#requestedPw"
hx-swap="outerHTML"
hx-include="[name='userLink']"
/>
Get Secret
<img class="htmx-indicator" src="/loading.svg" />
<div #generators .column>
<h2>Generators
<button .mainButton
hx-get="/gen"
hx-target="#generators"
hx-swap="outerHTML"
/>
Load Generators