Drag and drop fileuploading (janky).

This commit is contained in:
Gabriel Simmer 2019-02-28 22:27:13 -08:00
parent 8b49d75077
commit c252f1bf77
No known key found for this signature in database
GPG key ID: 0394452F45EF2817
2 changed files with 27 additions and 2 deletions

View file

@ -6,8 +6,13 @@
<head> <head>
<title>{{ $path }} | PiNas</title> <title>{{ $path }} | PiNas</title>
<link rel="stylesheet" href="/assets/styles.css"> <link rel="stylesheet" href="/assets/styles.css">
<script type="text/javascript" src="/assets/fileListing.js"></script>
</head> </head>
<body> <body ondragenter="dragEnter(event)" ondragexit="dragExit(event)">
<div id="uploadoverlay" class="fileupload hidden">
<p><img src="/assets/svgs/newfile.svg" alt="">Upload</p>
</div>
<header> <header>
<a href="/" class="back-button"> <a href="/" class="back-button">
<img src="/assets/svgs/back.svg" alt=""> <img src="/assets/svgs/back.svg" alt="">
@ -21,7 +26,7 @@
<div class="content"> <div class="content">
{{ if eq $prefix "files" }} {{ if eq $prefix "files" }}
<form action="/upload" method="post" enctype="multipart/form-data"> <form action="/upload" method="post" enctype="multipart/form-data">
<input type="value" value="{{$path}}" name="path"> <input id="path" type="value" value="{{$path}}" name="path">
<input type="file" data-multiple-caption="{count} files selected" multiple name="file"> <input type="file" data-multiple-caption="{count} files selected" multiple name="file">
<input type="submit" value="Upload"> <input type="submit" value="Upload">
</form> </form>

View file

@ -5,6 +5,26 @@ body {
background-color: #fefefe; background-color: #fefefe;
} }
.fileupload {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 2;
cursor: pointer;
text-align: center;
color: white;
font-size: 70px;
}
.hidden {
display: none;
}
h1, h2, h3 { h1, h2, h3 {
padding: 0; padding: 0;
margin: 0; margin: 0;