]> git.ekhem.eu.org Git - gdrive_proxy.git/commitdiff
Use CSS viewport.
authorJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:01:18 +0000 (19:01 +0100)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:04:22 +0000 (19:04 +0100)
delete.sh
download.sh
gdrive_proxy.sh
upload.sh

index 5aee38c3de20e709b679399f244116b76d896557..49298b21fc417e914f6fd68e28407d8903f54b4d 100755 (executable)
--- a/delete.sh
+++ b/delete.sh
@@ -12,6 +12,7 @@ echo "Content-Type: text/html"
 echo "
 <!DOCTYPE html>
 <html>
+<meta name='viewport' content='width=device-width'>
 <head>
   <style>
     body {
index 420d4e701a6f0c8e29b2f9deea9aa4219adf2d0e..f0d0f533979475e6a92b5322b48d79408aee8308 100755 (executable)
@@ -19,8 +19,9 @@ echo "Content-Type: text/html"
 echo "
 <!DOCTYPE html>
 <html>
+<meta name='viewport' content='width=device-width'>
+<meta http-equiv='Refresh' content='0;URL=/${BASE_NAME}' />
 <head>
-  <meta http-equiv='Refresh' content='0;URL=/${BASE_NAME}' />
   <style>
     body {
       white-space: pre-wrap;
index 031e6d3b94034d23702e3795652e2fb017e612a7..f3cfab1e78a6fe4c530c2ec4fad4a610231847dd 100755 (executable)
@@ -15,61 +15,60 @@ format_files() {
     echo ${FILES} | xargs --replace={} --delimiter=" " echo "${1}"
 }
 
-echo "HTTP/1.1 200 OK"
-echo "Content-type: text/html"
-echo "
+PAGE="
 <!DOCTYPE html>
 <html>
 <head>
   <title>GdriveProxy</title>
+  <meta name='viewport' content='width=device-width'>
   <style>
     body {
-      border: ridge 5px;
-      max-width: max-content;
-    }
-    .container {
-      background-color: PowderBlue;
-      padding: 7px;
+      background-color: #7fa99b;
     }
     form {
+      width: min(400px, 100%);
+    }
+    fieldset {
+      background-color: #f1d18a;
       display: flex;
       flex-direction: column;
       row-gap: 10px;
     }
-    button {
-      align-self: end;
-    }
   </style>
 </head>
 <body>
-  <div class='container'>
-    <h3>Upload</h3>
-    <form action='/upload' method='post' enctype='multipart/form-data'>
+  <form action='/upload' method='post' enctype='multipart/form-data'>
+    <fieldset>
+      <legend>Upload</legend>
       <input type='file' name='file' required />
       <input type='text' name='name' pattern='[a-zA-Z0-9_\/]*' required
           placeholder='Name on drive' />
       <button type='submit'>Upload</button>
-    </form>
+    </fieldset>
+  </form>
 
-    <hr />
-
-    <h3>Download</h3>
-    <form action='/download'>
+  <form action='/download'>
+    <fieldset>
+      <legend>Download</legend>
       <select id='name' name='name'>
         $(format_files "<option value='{}'>{}</option>")
       </select>
       <button type='submit'>Download</button>
-    </form>
-
-    <hr />
+    </fieldset>
+  </form>
 
-    <h3>Delete</h3>
-    <form action='/delete'>
+  <form action='/delete'>
+    <fieldset>
+      <legend>Delete</legend>
       <select id='name' name='name'>
         $(format_files "<option value='{}'>{}</option>")
       </select>
       <button type='submit'>Delete</button>
-    </form>
-  </div>
+    </fieldset>
+  </form>
 </body>
 </html>"
+
+echo "HTTP/1.1 200 OK"
+echo "Content-type: text/html"
+echo "${PAGE}" | sed 's/^[ \t]*//g'
index b6767995d75825d03ed4aca4b85163bac71fa08b..bfe8213b280e9104ae5d479aab19b7d6e98e536d 100755 (executable)
--- a/upload.sh
+++ b/upload.sh
@@ -38,6 +38,7 @@ echo "Content-Type: text/html"
 echo "
 <!DOCTYPE html>
 <html>
+<meta name='viewport' content='width=device-width'>
 <head>
   <style>
     body {