diff --git a/css/layout.css b/css/layout.css index 2b915f2..8ebfd8f 100644 --- a/css/layout.css +++ b/css/layout.css @@ -179,4 +179,20 @@ header h1{ padding: 10px; border-width: 1px; display: none; +} + +#banner { + display: none +} +@media only screen and (min-width: 768px){ + #banner { + line-height: 1.1; + font-size: small; + display: block; + margin-left: 300px; + text-align: center; + overflow-y: auto; + font-weight: bold; + height: 100%; + } } \ No newline at end of file diff --git a/index.template.html b/index.template.html index 8d3f3b0..964bc91 100644 --- a/index.template.html +++ b/index.template.html @@ -84,6 +84,7 @@ no
location
+ diff --git a/js/app.js b/js/app.js index 8a2454f..2731e23 100644 --- a/js/app.js +++ b/js/app.js @@ -1126,6 +1126,19 @@ function update_site(){ window.location.reload(true) } +function check_banner(){ + const bannerRequest = new Request("https://api.v2.sondehub.org/banner"); + fetch(bannerRequest) + .then(function(response){ return response.json()}) + .then(function(response){ + if (response['banner']) { + document.getElementsByTagName("header")[0].style.backgroundColor = "#ff6259" + document.getElementsByTagName("header")[0].style.borderColor = "#eb3d34" + document.getElementById("banner").innerText = response['banner'] + } + }) +} + function update_countdown(){ var date = new Date(0); time_remaining = (reload_end_time - new Date().getTime())/1000 @@ -1135,6 +1148,7 @@ function update_countdown(){ } check_version() +check_banner() update_check = setInterval(check_version, 15 * 60 * 1000) load_hash(); startAjax(); diff --git a/js/sondehub.js b/js/sondehub.js index d29944f..1296cc4 100644 --- a/js/sondehub.js +++ b/js/sondehub.js @@ -570,7 +570,7 @@ function makeQuad(x, y, zoom) { // map type list -var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { +var osm = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '© OpenStreetMap contributors' });