This repository has been archived on 2021-01-15. You can view files and clone it, but cannot push or open issues or pull requests.
goBug/template/Interfaccia.html

113 lines
2.3 KiB
HTML

<html>
<head>
<title>GoBug</title>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Hammersmith+One" rel="stylesheet">
<style type="text/css">
body {
font-family: 'Hammersmith One', sans-serif;
}
h1,h2,h3,h4 {
color: white;
text-align: center;
}
p {
color: white;
}
body {
background: #009999;
}
table {
table-layout: fixed;
empty-cells: show;
font-size: .6em;
}
div {
float: left;
}
.clearfix:after {
content: "";
display: table;
clear: both;
}
main {
background-color: #00bbbb;
}
tr, td {
}
td {
background: white;
text-align: center;
vertical-align: middle;
width: calc((70vw / {{.larghezza}}) - 3px);
height: calc(((100vh - 8em) / {{.altezza}}) - 8px);
}
.cibo {
background: #FFFF33;
padding: 0px;
}
.razza1 {
background: #00ff00;
padding: 0px;
}
.razza2 {
background: #FF0000;
padding: 0px;
}
div.tabella {
float:left;
display:block;
width: 70vw;
}
div.legenda {
margin-left: 1em;
float:left;
display:block;
width: calc(100% - 70vw - 1em);
}
@media screen and (max-width: 800px) {
div.tabella, div.legenda {
margin-left: 0;
width: 100%;
}
td {
width: calc((100vw / {{.larghezza}}) - 3px);
}
}
div.colorsample {
width: 1em;
height: 1em;
display: inline-block;
}
</style>
<script>
reload = function() {
var xhr = new XMLHttpRequest()
xhr.open('GET', '/tabella')
xhr.send(null)
xhr.onreadystatechange = function () {
var DONE = 4, OK = 200
if (xhr.readyState === DONE) {
if (xhr.status === OK)
document.getElementById("tb").innerHTML = xhr.responseText
else console.log('Error: ' + xhr.status)
}
}
}
window.setInterval(reload, 1000 * {{ .tempoAggiorna }})
reload()
</script>
</head>
<body>
<h1>Go bug</h1>
<main class="clearfix">
<div id="tb" class="tabella"></div>
<div class="legenda">
<h1>legenda</h1>
<div class="colorsample" style="background-color:#FFFF33"></div>&nbsp;Cibo<br>
<div class="colorsample" style="background-color:#00ff00"></div>&nbsp;Razza 1<br>
<div class="colorsample" style="background-color:#F00"></div>&nbsp;Razza 2
</div>
</main>
</body>
</html>