Selaa lähdekoodia

www: nicer logo2; clear file input before firmware update

Avoid uploading the same file more than once due to automation.

Slightly improve the "Peter & Per" logo and make it
language-independent.
H. Peter Anvin 2 vuotta sitten
vanhempi
commit
0adadfefce

+ 1 - 1
esp32/max80/httpd.c

@@ -209,7 +209,7 @@ static esp_err_t httpd_send_plain(httpd_req_t *req,
 
     const char * const refresher = refresher_buf ? refresher_buf : "";
     const char * const uncacher = (flags & HSP_UNCACHE)
-      ? "Clear-Site-Data: \"cache\",\"executionContexts\"\r\n" : "";
+      ? "Clear-Site-Data: \"cache\"\r\n" : "";
 
     if (redirect) {
 	/* \0 -> \n so don't include it */

BIN
esp32/output/max80.ino.bin


BIN
esp32/www/Charm-Bold-PoP.woff2


+ 2 - 1
esp32/www/head.html

@@ -15,7 +15,8 @@
     <rect x="0" y="0" width="100%" height="100%" fill="black"
 	  mask="url(#mask)" />
   </svg>
-  <span class="logo2">by Peter &amp; Per</span>
+  <span class="pad"></span>
+  <span class="logo2">Peter &amp; Per</span>
 </div>
 
 <nav class="navbar" role="navigation">

+ 0 - 1
esp32/www/lang/sv

@@ -1,4 +1,3 @@
-.logo2=Peter &amp; Per
 body .status=Status
 body .config=Konfiguration
 body .update=Uppdatera

+ 20 - 17
esp32/www/max80.css

@@ -2,31 +2,39 @@
     font-family: "Prisma";
     src: url(Prisma-MAX.woff2);
 }
+@font-face {
+    font-family: "Charm";
+    font-weight: 700;
+    src: url(Charm-Bold-PoP.woff2);
+}
 body {
     background: #e6c185;
-    font-family: "arial", "sans-serif";
+    font-family: "arial", "helvetica", "sans-serif";
 }
 .mono, pre, output, tt, code {
     font-family: "source code pro", "monospace";
 }
 div.title {
+    display: flex;
     width: 100%;
     white-space: nowrap;
-    padding: 1em;
+    padding: 1em 0em;
     overflow: hidden;
+    align-items: center;
 }
 div.title svg {
-    display: inline;
-    vertical-align: middle;
+    padding: 0 20px;
+}
+div.title *, nav * {
+    display: flex;
+    margin: 0;
 }
 div.title .logo2 {
-    display: inline;
-    vertical-align: middle;
-    text-align: center;
-    margin: 2em;
-    font-weight: bold;
-    font-style: italic;
-    font-size: 25px;
+    text-align: right;
+    padding: 0 25px;
+    font-weight: 700;
+    font-size: 50px;
+    font-family: "Charm","Brush Script MT","cursive";
 }
 nav {
     display: flex;
@@ -37,11 +45,6 @@ nav {
     white-space: nowrap;
     overflow: hidden;
     align-items: stretch;
-
-}
-nav * {
-    display: flex;
-    margin: 0;
 }
 nav a {
     color: black;
@@ -55,7 +58,7 @@ nav a {
 nav a:hover {
     background: #af9365;
 }
-nav .pad {
+.pad {
     flex-grow: 1;
 }
 nav .text {

+ 3 - 3
esp32/www/max80.js

@@ -16,7 +16,7 @@ function sib(me,tag) { return chi(me.parentElement, tag); }
 // each Array will be updated to the current value.
 function classmod(elem,tags) {
     for (var i = 0; i < tags.length; i++)
-	tags[i][1] = elem.classList.toggle(tags[i]);
+	tags[i][1] = elem.classList.toggle(...tags[i]);
     return tags;
 }
 
@@ -150,8 +150,8 @@ function upload(form,data) {
 
 	// Automatically reload the page after successful upload
 	const rf = parseInt(xhr.getResponseHeader('Refresh'));
-	if (rf && ok)
-	    setTimeout(() => window.location.reload(), rf * 1000);
+	//if (rf && ok)
+	//    setTimeout(() => window.location.reload(), rf * 1000);
     }, PassiveListener);
 
     xhr.open(form.method, form.action);

+ 2 - 1
esp32/www/update.html

@@ -13,7 +13,8 @@
       <fieldset class="firmware">
 	<legend>Firmware</legend>
 	<input type="file" name="file" hidden accept=".fw" onchange="uploadfile()" />
-	<button class="submit" type="submit" id="upload.start">Update firmware</button>
+	<button class="submit" type="submit" id="upload.start"
+		onclick="sib(this,'input').value=''">Update firmware</button>
 	<progress value="0"></progress>
       </fieldset>
       <output></output>

BIN
fpga/output/v1.fw


BIN
fpga/output/v2.fw