diff options
| author | ewy <ewy0@protonmail.com> | 2026-03-31 18:14:56 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-03-31 18:14:56 +0200 |
| commit | 4b082851542cf8b546e3fbacaf0b27a7db5b80eb (patch) | |
| tree | 93e1e94eb31a7b8ad7273272e680ccd5d2d0948a | |
| parent | d4e6d4905b1074ebcb6d082fadf50cc2ed80493d (diff) | |
fix layout and info
| -rw-r--r-- | pages/create.gohtml | 7 | ||||
| -rw-r--r-- | pages/landing.gohtml | 55 | ||||
| -rw-r--r-- | storage/link.go | 5 |
3 files changed, 51 insertions, 16 deletions
diff --git a/pages/create.gohtml b/pages/create.gohtml index ac9890c..5d402cb 100644 --- a/pages/create.gohtml +++ b/pages/create.gohtml @@ -5,7 +5,7 @@ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> - <link rel="icon" href="data:," /> + <link rel="icon" href="data:,"/> <title>delayed.link: created</title> </head> <body> @@ -13,7 +13,10 @@ <a href="/l/{{.Id}}">This link will unlock at {{.OpensFrom}}</a> </p> <p> - It will be able to be opened {{ .OpensLeft }} times. + This will occur in approximately {{ .MinutesLeft }} minute{{ if gt .MinutesLeft 1 }}s{{end}}. +</p> +<p> + It will be able to be opened {{ .OpensLeft }} time{{ if gt .OpensLeft 1 }}s{{end}}. </p> <p> This page is completely ephemeral. Once you close it, you cannot access the link again. diff --git a/pages/landing.gohtml b/pages/landing.gohtml index ceb55d9..40f5ae3 100644 --- a/pages/landing.gohtml +++ b/pages/landing.gohtml @@ -2,30 +2,57 @@ <html lang="en"> <head> <meta charset="UTF-8"> - <link rel="icon" href="data:," /> + <link rel="icon" href="data:,"/> <title>delayed.link</title> <style> main { min-height: 105vh; } + + label { + display: flex; + justify-content: space-between; + max-width: 500px; + } + + input[type="number"] { + width: 64px; + } + + form { + display: flex; + flex-direction: column; + gap: 4px; + } </style> </head> <body> <main> <form method="POST" action="/"> - <label> - Lock time in minutes - <input type="number" name="minutes_in_future"/> - </label> - <label> - Maximum times the link can be opened - <input type="number" name="number_of_opens" min="1" max="100"/> - </label> - <label> - URL to save for later - <input type="text" name="payload"/> - </label> - <input type="submit" value="Create"/> + <div> + <label> + Lock time in minutes + <input type="number" name="minutes_in_future" value="10"/> + </label> + </div> + <div> + <label> + Maximum times the link can be opened + <input type="number" name="number_of_opens" min="1" max="100" value="8"/> + </label> + </div> + <div> + <label> + URL to save for later + <input type="text" name="payload"/> + </label> + </div> + <div> + <label> + <span></span> + <input type="submit" value="Create"/> + </label> + </div> </form> </main> <footer> diff --git a/storage/link.go b/storage/link.go index f334f42..6f0a0c3 100644 --- a/storage/link.go +++ b/storage/link.go @@ -61,3 +61,8 @@ func (l Link) Valid() error { return nil } + +func (l Link) MinutesLeft() int { + return int(l.OpensFrom.Sub(time.Now()).Minutes()) + +} |
