From 3dcdd52eb75a83ea4beb7a8eb47f9e15ad78c955 Mon Sep 17 00:00:00 2001 From: George Ruinelli Date: Tue, 30 Aug 2022 21:23:05 +0200 Subject: [PATCH] added separate stylesheet and moved common js to a file. --- sd-card/html/common.js | 31 +++++++++++++ sd-card/html/style.css | 98 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 sd-card/html/common.js create mode 100644 sd-card/html/style.css diff --git a/sd-card/html/common.js b/sd-card/html/common.js new file mode 100644 index 00000000..0804cce6 --- /dev/null +++ b/sd-card/html/common.js @@ -0,0 +1,31 @@ + +var basepath = "http://192.168.178.22"; + +function LoadHostname() { + _basepath = getbasepath(); + + + var xhttp = new XMLHttpRequest(); + xhttp.addEventListener('load', function(event) { + if (xhttp.status >= 200 && xhttp.status < 300) { + hostname = xhttp.responseText; + document.title = hostname + " - jomjol - AI on the edge"; + document.getElementById("id_title").innerHTML = "Digitizer - AI on the edge - " + hostname; + } + else { + console.warn(request.statusText, request.responseText); + } + }); + +// var xhttp = new XMLHttpRequest(); + try { + url = _basepath + '/version?type=Hostname'; + xhttp.open("GET", url, true); + xhttp.send(); + + } + catch (error) + { +// alert("Loading Hostname failed"); + } +} diff --git a/sd-card/html/style.css b/sd-card/html/style.css new file mode 100644 index 00000000..e8e8e1b3 --- /dev/null +++ b/sd-card/html/style.css @@ -0,0 +1,98 @@ +body, html { + width: 100%; + height: 100%; + margin: 0px 0px 0px 2px; + padding: 0; + font-family: arial; + width: fit-content; +} + +.main { + display: flex; + width: 100%; + height: 100%; + flex-direction: column; + overflow: hidden; +} + +.iframe { + flex-grow: 1; + margin: 5px 7px 4px 0px; + padding: 0; + border: 2px solid black +} + +h1 { + font-size: 2em; + margin-block-end: 0.3em; +} + +h2 { + font-size: 1.5em; + margin-block-start: 0.3em; +} + +h3 { + font-size: 1.2em; +} + +p { + font-size: 1em; +} + +ul { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + background-color: #333; + width:1000px; +} + +li { + float: left; + font-family: arial; + font-size: 18px; +} + +li a, .dropbtn { + display: inline-block; + color: white; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +li a:hover, .dropdown:hover .dropbtn { + background-color: red; +} + +li.dropdown { + display: inline-block; +} + +.dropdown-content { + display: none; + position: absolute; + background-color: #f9f9f9; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; + font-family: arial; +} + +.dropdown-content a { + color: black; + padding: 12px 16px; + text-decoration: none; + display: block; + text-align: left; +} + +.dropdown-content a:hover { + background-color: #f1f1f1; +} + +.dropdown:hover .dropdown-content { + display: block; +}