diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/index.html.template | 1 | ||||
| -rw-r--r-- | templates/wormhole-send.html.template | 14 | ||||
| -rw-r--r-- | templates/wormhole.html.template | 19 |
3 files changed, 34 insertions, 0 deletions
diff --git a/templates/index.html.template b/templates/index.html.template index 3dcf4a7..750f559 100644 --- a/templates/index.html.template +++ b/templates/index.html.template @@ -9,5 +9,6 @@ <img src="/static/index/kanna.webp" alt="A dragon loli" style="border-radius:50%;margin:-145px auto 20px"> </div> + <p><a href="/wormhole">Magic wormhole</a></p> <p><a href="/pong">Games?</a> (Warning: loud)</p> </section> diff --git a/templates/wormhole-send.html.template b/templates/wormhole-send.html.template new file mode 100644 index 0000000..5b06c5f --- /dev/null +++ b/templates/wormhole-send.html.template @@ -0,0 +1,14 @@ +{{define "head"}} + <script src="/static/htmx.min.js"></script> + <script src="/static/htmx-ext-sse.js"></script> + <title>Wormhole</title> +{{end}} + +<form + hx-ext="sse" + sse-connect="/wormhole/{{.Hole}}/ready" + hx-post="/wormhole/{{.Hole}}" + hx-trigger="sse:receiver-ready" + enctype="multipart/form-data"> + <input type="file" name="file"> +</form> diff --git a/templates/wormhole.html.template b/templates/wormhole.html.template new file mode 100644 index 0000000..4d67a98 --- /dev/null +++ b/templates/wormhole.html.template @@ -0,0 +1,19 @@ +{{define "head"}} + <script src="/static/htmx.min.js"></script> + <script src="/static/htmx-ext-sse.js"></script> + <title>Wormhole</title> +{{end}} + +<div + hx-ext="sse" + sse-connect="/wormhole/{{.Hole}}/ready"> + <form + hx-post="/wormhole/{{.Hole}}" + hx-trigger="sse:ready" + enctype="multipart/form-data"> + <label for="file-input">1. Choose file</label> + <input id="file-input" type="file" name="file"> + </form> +</div> + +<p>2. Visit this URL <a href="{{.Self}}/wormhole/{{.Hole}}">{{.Self}}/wormhole/{{.Hole}}</a></p> |
