purr/views/index.hamlet

60 lines
2.0 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>
<div #logo .logo>
<img src="/purrlogo.png">
<div #content .content>
<div #title .title>
<h1>
<a #titleLink .titleLink href="/">Purr
<div #pwUtils .pwUtils>
$# Below needs to be replaced with an HTMX onload request to /pw/#{link} to DRY
<div #requestedPw .requestedPw>
$maybe pw <- password
<p>Here's the secret for <a href="/pw/#{link}">/pw/#{link}</a>:
<h2 .pwResult>#{pw}
$nothing
$if (link == "/")
<p .emptyReq>
$else
<p>No secret available at <a href="/pw/#{link}">/pw/#{link}</a>
$# Above needs to be replaced with an HTMX onload request to /pw/#{link} to DRY
<div #shareNew .shareNew>
<p>
<input .mainInput
name="newSec"
type="text"
placeholder="Enter a Secret to Share"
/>
<button .mainButton
hx-post="/new"
hx-target="#requestedPw"
hx-swap="outerHTML"
hx-include="[name='newSec']"
/>
Share Secret
<img class="htmx-indicator" src="/loading.svg" />
<div #requestNew .requestNew>
<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" />