Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 57: | Rivi 57: | ||
console.log( jw ); | console.log( jw ); | ||
// var page = encodeURI( '<!--{$page|default:x|escape:'html'}-->' ); | |||
out = '<h2 class="h3">Välijärvi nyt</h2>'; | |||
out += '<div class="row Xalign-items-center mt-4">'; | out += '<div class="row Xalign-items-center mt-4">'; | ||
if ( typeof jw.obstype[ 'temp' ] != 'undefined' ) { | if ( typeof jw.obstype[ 'temp' ] != 'undefined' ) { | ||
if ( jw.obstype[ 'temp' ].count > 0 ) { | if ( jw.obstype[ 'temp' ].count > 0 ) { | ||
out += '<div class="col col-6 col-sm-4 col-md-3 text-center">'; | |||
out += '<div style="width: 120px; height: 120px; margin: auto; border-radius: 50%; Xbackground-color: var(--syke-green); font-size: 56px; display: flex; justify-content: center; align-items: center; flex-direction: column;">+' + Math.round( jw.obstype[ 'temp' ].mean ) + '°</div>'; | |||
out += '<h2 class="h5">Pintaveden<br />lämpötila</h2>'; | |||
out += '</div>'; | |||
} | } | ||
} | } | ||
if ( typeof jw.obstype[ 'alg' ] != 'undefined' ) { | |||
if ( jw.obstype[ 'alg' ].count > 0 ) { | |||
var algmean = Math.round( jw.obstype[ 'alg' ].mean ); | |||
var algtxt = [ 'Ei sinilevää', 'Hieman sinilevää', 'Runsaasti sinilevää', 'Erittäin runsaasti sinilevää' ]; | |||
var algcolor = [ '#308fb3', '#8db335', '#f1cb00', '#ce0000' ]; | |||
out += '<div class="col col-6 col-sm-4 col-md-3 text-center">'; | |||
out += '<div style="width: 120px; height: 120px; margin: auto; border-radius: 50%; background-color: ' + algcolor[ algmean ] + ';"></div>'; | |||
out += '<h2 class="h5">' + algtxt[ algmean ] + '</h2>'; | |||
out += '</div>'; | |||
} | |||
} | |||
out += '<div class="col col-6 col-sm-4 col-md-3 text-center">'; | out += '<div class="col col-6 col-sm-4 col-md-3 text-center">'; | ||


