added separate stylesheet and moved common js to a file.

This commit is contained in:
George Ruinelli
2022-08-30 21:23:05 +02:00
parent fe17d97a05
commit 3dcdd52eb7
2 changed files with 129 additions and 0 deletions

31
sd-card/html/common.js Normal file
View File

@@ -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");
}
}

98
sd-card/html/style.css Normal file
View File

@@ -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;
}