CSS fixes, cleaned out custom icons
@@ -4,7 +4,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
|
||||
<title>NS StatusBoard</title>
|
||||
<title>Nightscout</title>
|
||||
|
||||
<link href="/images/round1.png" rel="icon" id="favicon" type="image/png" />
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/images/apple-touch-icon-57x57.png">
|
||||
@@ -21,38 +21,50 @@
|
||||
@import url("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,300,400,600,700,800");
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
margin: 0 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
font-family: 'Open Sans';
|
||||
font-weight: 700;
|
||||
color: white;
|
||||
}
|
||||
.main {
|
||||
display: inline-flex; height: 100vmax; // My CSS is super rusty; this is the best
|
||||
} // I could manage. Needs work to support
|
||||
.inner { // landscape better, at the very least.
|
||||
margin: 30vmin auto;
|
||||
main {
|
||||
display: -webkit-box; // Lots of vertical centering redundancy here
|
||||
display: -ms-flexbox; // to accommodate different/old browsers.
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-webkit-flex-align: center;
|
||||
-ms-flex-align: center;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
margin: 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
.inner {
|
||||
width: 100%;
|
||||
-webkit-transform: translateY(-5%);
|
||||
}
|
||||
.bgnow {
|
||||
font-size: 40vmin;
|
||||
width: 100%;
|
||||
font-family: 'Open Sans';
|
||||
font-weight: 700;
|
||||
font-size: 40vmin;
|
||||
color: white;
|
||||
}
|
||||
.stale {
|
||||
text-decoration: line-through;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="main">
|
||||
<main>
|
||||
<div class="inner">
|
||||
<div class="bgnow"></div>
|
||||
<div class="arrow"><img id="arrow" src="" width="" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
|
||||
<script src="/api/v1/status.js"></script>
|
||||
@@ -91,34 +103,32 @@
|
||||
|
||||
$('#arrow').attr('src', 'images/'+direction+'.png');
|
||||
|
||||
switch (direction) {
|
||||
case "DoubleUp":
|
||||
$('#arrow').attr('width', '153');
|
||||
break;
|
||||
case "SingleUp":
|
||||
$('#arrow').attr('width', '77');
|
||||
break;
|
||||
case "FortyFiveUp":
|
||||
$('#arrow').attr('width', '85');
|
||||
break;
|
||||
case "Flat":
|
||||
$('#arrow').attr('width', '107');
|
||||
break;
|
||||
case "FortyFiveDown":
|
||||
$('#arrow').attr('width', '85');
|
||||
break;
|
||||
case "SingleDown":
|
||||
$('#arrow').attr('width', '77');
|
||||
break;
|
||||
case "DoubleDown":
|
||||
$('#arrow').attr('width', '153');
|
||||
break;
|
||||
var arrowWidth = '100';
|
||||
|
||||
switch (direction) { // Arrow images are different widths.
|
||||
case "DoubleUp":
|
||||
case "DoubleDown":
|
||||
arrowWidth = '153';
|
||||
break;
|
||||
case "SingleUp":
|
||||
case "SingleDown":
|
||||
arrowWidth = '77';
|
||||
break;
|
||||
case "FortyFiveUp":
|
||||
case "FortyFiveDown":
|
||||
arrowWidth = '85';
|
||||
break;
|
||||
case "Flat":
|
||||
arrowWidth = '107';
|
||||
break;
|
||||
}
|
||||
|
||||
$('#arrow').attr('width', arrowWidth); // Set the correct arrow width.
|
||||
|
||||
$('.bgnow').text(rec.sgv);
|
||||
$('.bgnow').text(rec.sgv); // Insert the BG value text.
|
||||
|
||||
if (bgNum < LowThresh) {
|
||||
$('body').css('background-color', red);
|
||||
$('body').css('background-color', red); // Threshold background coloring.
|
||||
}
|
||||
if ((LowThresh <= bgNum) && (bgNum < MedThresh)) {
|
||||
$('body').css('background-color', green);
|
||||
@@ -130,9 +140,10 @@
|
||||
$('body').css('background-color', red);
|
||||
}
|
||||
|
||||
var threshold = 1000 * 60 * 13;
|
||||
$('.bgnow').toggleClass('stale', (now - last > threshold));
|
||||
}
|
||||
var threshold = 1000 * 60 * 13; // Time before data considered stale.
|
||||
|
||||
$('.bgnow').toggleClass('stale', (now - last > threshold)); // Restyle BG if stale.
|
||||
}
|
||||
|
||||
function init ( ) {
|
||||
console.log('init');
|
||||
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 23 KiB |