.warn1 { color:#fd0; }
.warn2 { color:#f20; }
.setval { color:#0af; }
-.grey { color: #444 !important; }
.hilite { background-color: #ff0; }
+
+x-bar {
+ display: block;
+ clear: both;
+ width: 100%;
+ padding: 0.2em;
+ margin: 0.1em;
+ border: none;
+ font-size: 150%;
+ visibility: hidden;
+}
+.pause {
+ background-color:#fd0;
+ color : #000;
+}
+.error {
+ background-color:#a00;
+ color : #fff;
+}
+
</style>
</head>
<body>
<x-boxright class="clear"><span class="big" id="speed">--</span><span class="tiny"> km/h</span></x-boxright>
<x-boxright class="clear"><span class="medium setval" id="cctrl">-</span><span class="tiny"> km/h</span></x-boxright>
<x-boxleft class="clear"><span class="small setval" id="gear">x</span><span class="tiny"> </span></x-boxleft>
- <!--<x-boxleft><span class="small" id="clutch">x</span><span class="tiny"> </span></x-boxleft>-->
<x-boxright><span class="small" id="rpm">0</span><span class="tiny"> rpm</span></x-boxright>
<x-boxright class="clear"><span class="small" id="odometer">-</span><span class="tiny"> km</span></x-boxright>
</x-boxleft>
<x-boxleft id="odo" class="cont">
<x-boxright class="clear"><span class="small" id="nav_dist">-</span><span class="tiny"> km</span></x-boxright>
<x-boxright class="clear"><span class="small" id="nav_eta">-</span><span class="tiny"> eta</span></x-boxright>
- <x-boxleft class="clear">
- <!--<span class="small" id="nav_slimit">-</span><span class="tiny"> km/h</span>-->
+ <x-boxright class="clear">
<svg width="50" height="50">
<circle cx="25" cy="25" r="22" stroke="red" stroke-width="6" fill="white" id="nav_slimitsign"/>
<text fill="#000" font-size="24" font-family="sans-serif" font-weight="normal" x="10" y="34" id="nav_slimit">---</text>
</x-boxright>
</x-boxleft>
+<x-bar class="pause" id="pause"> GAME PAUSED </x-bar>
+<x-bar class="error" id="errbar"></x-bar>
+
</x-page>
<script>
function loadDoc() {
xhttp.onreadystatechange = function() {
+ var errbar = document.getElementById("errbar");
if (this.readyState == 4 && this.status == 200) {
var e;
var tele = JSON.parse(this.responseText);
+ errbar.style.visibility = "hidden";
+
e = document.getElementById("speed");
e.innerHTML = Math.round(tele.speed * 3.6);
if ( tele.nav_slimit > 0 && tele.speed > tele.nav_slimit * 1.075 ) {
else
document.getElementById("nav_slimitsign").style.visibility = "hidden";
- e = document.getElementById("page");
- if ( tele.paused )
- e.classList.add("grey");
+ document.getElementById("pause").style.visibility = tele.paused ? "visible" : "hidden";
+ }
+ else if (this.readyState == 4) {
+ if ( this.status )
+ errbar.innerHTML = "Status: " + this.status + "<br>" + this.responseText;
else
- e.classList.remove("grey");
+ errbar.innerHTML = "No response from server.";
+ errbar.style.visibility = "visible";
}
};
xhttp.open("GET", "/json", true);