uploader/assets/index.html

39 lines
1.1 KiB
HTML
Raw Normal View History

<html>
<head>
<link rel="stylesheet" type="" href="./style.css">
<script src="https://unpkg.com/htmx.org@1.9.4/dist/htmx.min.js"></script>
</head>
<body>
<div class="container">
<div id="main">
<h1>Raul's file uploader</h1>
<h3>Find the source <a href="https://git.bulgariu.xyz/raul/uploader" target="_blank">here!</a></h3>
<form id='form' hx-encoding='multipart/form-data' hx-post='/api/upload'>
<input type="file" name="file" value="">
<br>
<br>
<button id="but">
Upload
</button>
2024-05-01 08:42:54 +02:00
<progress id="progress" value="0" max="100">Upload progress:</progress>
</form>
2024-05-01 08:42:54 +02:00
<script>
htmx.on('#form', 'htmx:xhr:progress', function(evt) {
htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)
});
</script>
<p class="centered">
<!-- <img src="https://bulgariu.xyz/avatar.gif" alt="" width=200px height=200px > -->
</p>
<!-- <footer> -->
<!-- Licensed under the GPL v3.0 -->
<!-- </footer> -->
</div>
</div>
</body>
</html>