Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 139: | Rivi 139: | ||
if ( ot == 'temp' ) { | if ( ot == 'temp' ) { | ||
var tempcolor = [ '#308fb3', '#8db335', '#f1cb00', '#ce0000' ]; | |||
var tempval = Math.round( jw.obstype[ ot ].mean ); | |||
var tempcat = Math.min( 2, Math.floor( 3 * tempval / 30 ) ): | |||
out += '<div style="width: 84px; height: 84px; margin: auto; border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-direction: column; background-color: none;">'; | out += '<div style="width: 84px; height: 84px; margin: auto; border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-direction: column; background-color: none;">'; | ||
out += '<div style="font-size: 44px;">+' + Math.round( jw.obstype[ ot ].mean ) + '°</div>'; | out += '<div style="font-size: 44px;">+' + Math.round( jw.obstype[ ot ].mean ) + '°</div>'; | ||
| Rivi 145: | Rivi 149: | ||
out += '<div style="height: 60px; display: flex; justify-content: center; align-items: center; flex-direction: column;">'; | out += '<div style="height: 60px; display: flex; justify-content: center; align-items: center; flex-direction: column;">'; | ||
out += '<span class="h6" style="margin: 0;">Pintaveden<br />lämpötila</span>'; | out += '<span class="h6" style="margin: 0; color: ' + tempcolor[ tempcat ] + '">Pintaveden<br />lämpötila</span>'; | ||
out += '</div>'; | out += '</div>'; | ||


