Added loading indicators via htmx-indicator, removed unattributable ASCII art and replaced with the project logo from the README, minor touches on stylesheet and added clickable links in the display.
This commit is contained in:
parent
cb013e5bf7
commit
10e3724a1a
@ -58,6 +58,7 @@ library
|
||||
, text >=1.2
|
||||
, time >=1.9
|
||||
, wai-extra >=3.1.12.1
|
||||
, wai-middleware-static >=0.5
|
||||
default-language: Haskell2010
|
||||
|
||||
executable Purr-exe
|
||||
@ -91,6 +92,7 @@ executable Purr-exe
|
||||
, text >=1.2
|
||||
, time >=1.9
|
||||
, wai-extra >=3.1.12.1
|
||||
, wai-middleware-static >=0.5
|
||||
default-language: Haskell2010
|
||||
|
||||
test-suite Purr-test
|
||||
@ -125,4 +127,5 @@ test-suite Purr-test
|
||||
, text >=1.2
|
||||
, time >=1.9
|
||||
, wai-extra >=3.1.12.1
|
||||
, wai-middleware-static >=0.5
|
||||
default-language: Haskell2010
|
||||
|
@ -42,6 +42,7 @@ dependencies:
|
||||
- time >= 1.9
|
||||
- text >= 1.2
|
||||
- wai-extra >= 3.1.12.1
|
||||
- wai-middleware-static >= 0.5
|
||||
|
||||
library:
|
||||
source-dirs: src
|
||||
|
@ -7,12 +7,14 @@ import Feature.Sharing.HTTP as Sharing
|
||||
|
||||
import Data.Maybe (Maybe (Nothing))
|
||||
import Network.Wai.Middleware.RequestLogger (logStdoutDev)
|
||||
import Network.Wai.Middleware.Static
|
||||
import Web.Scotty.Trans
|
||||
|
||||
app :: PurrApp ()
|
||||
app = do
|
||||
-- Middleware definition
|
||||
middleware logStdoutDev
|
||||
middleware $ staticPolicy (noDots >-> addBase "views/public")
|
||||
|
||||
-- Core Routes
|
||||
get "/" $ do
|
||||
|
@ -15,12 +15,18 @@ body
|
||||
p
|
||||
margin: 0.4em 0 0.4em 0
|
||||
|
||||
a
|
||||
color: #{colorThree}
|
||||
|
||||
.htmx-indicator
|
||||
display: none
|
||||
|
||||
::placeholder
|
||||
color: #{colorOne}
|
||||
opacity: 1
|
||||
|
||||
.asciiCat
|
||||
margin: 2% 3% 0 0
|
||||
.logo
|
||||
margin: 4% 3% 0 0
|
||||
font-size: 1.2vw
|
||||
color: #{colorFour}
|
||||
text-align: center
|
||||
@ -91,16 +97,16 @@ p
|
||||
text-align: center
|
||||
font-size: 16px
|
||||
|
||||
.asciiCat
|
||||
display: none
|
||||
|
||||
.mainInput
|
||||
width: 95%
|
||||
text-align: center
|
||||
|
||||
.title
|
||||
margin: 8% auto
|
||||
margin: 8% auto 2% auto
|
||||
font-size: 3em
|
||||
|
||||
.title h1
|
||||
margin-bottom: 0
|
||||
|
||||
.pwUtils
|
||||
width: 100%
|
||||
|
@ -7,25 +7,24 @@ $doctype 5
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
|
||||
<body>
|
||||
<pre #asciiCat .asciiCat>
|
||||
_._ _,-'""`-._
|
||||
\ (,-.`._,'( |\`-/|
|
||||
\ `-.-' \ )-`( , o o)
|
||||
\ `- \`_`"'-
|
||||
<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 /pw/#{link}:
|
||||
<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 /pw/#{link}
|
||||
<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>
|
||||
@ -41,6 +40,7 @@ $doctype 5
|
||||
hx-include="[name='newSec']"
|
||||
/>
|
||||
Share Secret
|
||||
<img class="htmx-indicator" src="/loading.svg" />
|
||||
|
||||
<div #requestNew .requestNew>
|
||||
<p>
|
||||
@ -56,3 +56,4 @@ $doctype 5
|
||||
hx-include="[name='userLink']"
|
||||
/>
|
||||
Get Secret
|
||||
<img class="htmx-indicator" src="/loading.svg" />
|
||||
|
48
views/public/loading.svg
Normal file
48
views/public/loading.svg
Normal file
@ -0,0 +1,48 @@
|
||||
<!--
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Sam Herbert
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<svg width="14" height="14" viewBox="0 0 44 44" xmlns="http://www.w3.org/2000/svg" stroke="#f0f6f0">
|
||||
<g fill="none" fill-rule="evenodd" stroke-width="2">
|
||||
<circle cx="22" cy="22" r="1">
|
||||
<animate attributeName="r"
|
||||
begin="0s" dur="1.8s"
|
||||
values="1; 20"
|
||||
calcMode="spline"
|
||||
keyTimes="0; 1"
|
||||
keySplines="0.165, 0.84, 0.44, 1"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="stroke-opacity"
|
||||
begin="0s" dur="1.8s"
|
||||
values="1; 0"
|
||||
calcMode="spline"
|
||||
keyTimes="0; 1"
|
||||
keySplines="0.3, 0.61, 0.355, 1"
|
||||
repeatCount="indefinite" />
|
||||
</circle>
|
||||
<circle cx="22" cy="22" r="1">
|
||||
<animate attributeName="r"
|
||||
begin="-0.9s" dur="1.8s"
|
||||
values="1; 20"
|
||||
calcMode="spline"
|
||||
keyTimes="0; 1"
|
||||
keySplines="0.165, 0.84, 0.44, 1"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="stroke-opacity"
|
||||
begin="-0.9s" dur="1.8s"
|
||||
values="1; 0"
|
||||
calcMode="spline"
|
||||
keyTimes="0; 1"
|
||||
keySplines="0.3, 0.61, 0.355, 1"
|
||||
repeatCount="indefinite" />
|
||||
</circle>
|
||||
</g>
|
||||
</svg>
|
BIN
views/public/purrlogo.png
Normal file
BIN
views/public/purrlogo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -1,6 +1,6 @@
|
||||
<div #requestedPw .requestedPw>
|
||||
$maybe pw <- password
|
||||
<p>Here's the secret for /pw/#{link}:
|
||||
<p>Here's the secret for <a href="/pw/#{link}">/pw/#{link}</a>:
|
||||
<h2 .pwResult>#{pw}
|
||||
$nothing
|
||||
<p>No secret available at /pw/#{link}
|
||||
<p>No secret available at <a href="/pw/#{link}">/pw/#{link}</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user