From ed264b17e1a4a25a18bb21496f2f24274610d2bf Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Thu, 19 Mar 2015 23:17:26 -0700 Subject: [PATCH 1/9] initial display of noise level when rawbg is enabled --- static/css/main.css | 15 +++++++++++++++ static/js/client.js | 24 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/static/css/main.css b/static/css/main.css index 9e7e36a65..2146d168d 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -227,6 +227,21 @@ body { -webkit-box-shadow: none; } +.bgButton.noise-heavy, .bgButton.noise-error { + border-color: rgba(255, 0, 0, 0.39); + box-shadow: 2px 2px 10px rgba(255, 0, 0, 0.75); +} + +.bgButton.noise-medium { + border-color: rgba(255, 255, 0, 0.39); + box-shadow: 2px 2px 10px rgba(255, 255, 0, 0.75); +} + +.bgButton.noise-light { + border-color: rgba(189, 189, 189, 0.39); + box-shadow: 2px 2px 10px rgba(189, 189, 189, 0.75); +} + .button { text-align: center; background: #ababab; diff --git a/static/js/client.js b/static/js/client.js index 96a39931b..ce60307e2 100644 --- a/static/js/client.js +++ b/static/js/client.js @@ -341,6 +341,28 @@ var app = {}, browserSettings = {}, browserStorage = $.localStorage; currentBG.toggleClass('bg-limit', value == 39 || value > 400); } + function updateCurrentNoise(entry) { + var noise = entry.noise + , noiseType; + + if ((noise <= 1 && entry.y >= 40) || !showRawBGs()) { + noiseType = null; + } else if (entry.y < 40) { + noiseType = 'error'; + } else if (noise == 2) { + noiseType = 'light'; + } else if (noise == 3) { + noiseType = 'medium'; + } else if (noise >= 4) { + noiseType = 'heavy'; + } + + bgButton.removeClass('noise-light noise-medium noise-heavy noise-error'); + if (noiseType) { + bgButton.addClass('noise-' + noiseType); + } + } + function updateBGDelta(prev, current) { var pill = currentDetails.find('span.pill.bgdelta'); @@ -416,6 +438,7 @@ var app = {}, browserSettings = {}, browserStorage = $.localStorage; var prevfocusPoint = nowData[nowData.length - 2]; updateCurrentSGV(focusPoint.y); + updateCurrentNoise(focusPoint); updateBGDelta(prevfocusPoint.y, focusPoint.y); @@ -440,6 +463,7 @@ var app = {}, browserSettings = {}, browserStorage = $.localStorage; nowDate = new Date(now); updateCurrentSGV(latestSGV.y); + updateCurrentNoise(latestSGV); updateClockDisplay(); updateTimeAgo(); From 1431be6ec950ea66e7df075c1cfe61b014e7e381 Mon Sep 17 00:00:00 2001 From: Jason Calabrese Date: Fri, 20 Mar 2015 00:06:26 -0700 Subject: [PATCH 2/9] display rawbg in top right if enabled; fix alarm button border --- static/css/main.css | 51 ++++++++++++++++++++++++++++++++------------------- static/index.html | 1 + static/js/client.js | 35 +++++++++++++++++++++++------------ 3 files changed, 56 insertions(+), 31 deletions(-) diff --git a/static/css/main.css b/static/css/main.css index 2146d168d..01b7186dd 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -206,18 +206,41 @@ body { width: 320px; } +.bgButton.noise-heavy, .bgButton.noise-error { + border-color: rgba(255, 0, 0, 0.39); + box-shadow: 2px 2px 10px rgba(255, 0, 0, 0.75); +} + +.bgButton.noise-medium { + border-color: rgba(255, 255, 0, 0.39); + box-shadow: 2px 2px 10px rgba(255, 255, 0, 0.75); +} + +.bgButton.noise-light { + border-color: rgba(189, 189, 189, 0.39); + box-shadow: 2px 2px 10px rgba(189, 189, 189, 0.75); +} + +.bgButton .rawbg { + color: white; + position: absolute; + top: 60px; + right: 20px; + text-shadow: 4px 4px 7px rgba(0, 0, 0, 0.84); +} + .alarming .bgButton { - border-color: #bdbdbd; - color: #000; - box-shadow: 2px 2px 0 #ddd; + border-color: #bdbdbd; + color: #000; + box-shadow: 2px 2px 0 #ddd; } .alarming .bgButton.urgent { - background-color: red; + background-color: red; } .alarming .bgButton.warning { - background-color: yellow; + background-color: yellow; } .alarming .bgButton:active { @@ -227,20 +250,6 @@ body { -webkit-box-shadow: none; } -.bgButton.noise-heavy, .bgButton.noise-error { - border-color: rgba(255, 0, 0, 0.39); - box-shadow: 2px 2px 10px rgba(255, 0, 0, 0.75); -} - -.bgButton.noise-medium { - border-color: rgba(255, 255, 0, 0.39); - box-shadow: 2px 2px 10px rgba(255, 255, 0, 0.75); -} - -.bgButton.noise-light { - border-color: rgba(189, 189, 189, 0.39); - box-shadow: 2px 2px 10px rgba(189, 189, 189, 0.75); -} .button { text-align: center; @@ -513,6 +522,10 @@ div.tooltip { display: none; } + .bgButton .rawbg { + top: 40px; + } + .container { top: 15px; padding-bottom: 20px; diff --git a/static/index.html b/static/index.html index 0ff53abe7..765d6c223 100644 --- a/static/index.html +++ b/static/index.html @@ -30,6 +30,7 @@

Nightscout

--- - +