Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 99: | Rivi 99: | ||
if ( jw.obstype[ 'alg' ].count > 0 ) { | if ( jw.obstype[ 'alg' ].count > 0 ) { | ||
var algmean = Math.round( jw.obstype[ 'alg' ].mean ); | var algmean = Math.round( jw.obstype[ 'alg' ].mean ); | ||
var algtxt = [ 'Ei sinilevää', 'Hieman<br />sinilevää', 'Runsaasti<br />sinilevää', 'Erit. runsaasti<br />sinilevää' ]; | var algtxt = [ 'Ei sinilevää', 'Hieman<br />sinilevää', 'Runsaasti<br />sinilevää', 'Erit. runsaasti<br />sinilevää' ]; | ||
var algcolor = [ '#308fb3', '#8db335', '#f1cb00', '#ce0000' ]; | var algcolor = [ '#308fb3', '#8db335', '#f1cb00', '#ce0000' ]; | ||
| Rivi 117: | Rivi 116: | ||
icecatmean = 1; | icecatmean = 1; | ||
icetxt = [ 'Ei jäätä', 'Osittain jäässä', 'Yhtenäinen jääpeite' ]; | icetxt = [ 'Ei jäätä', 'Osittain jäässä', 'Yhtenäinen jääpeite' ]; | ||
iceautumnbgcolor = [ '#64c1cb', '#64c1cb', '#fff' ]; | |||
icespringbgcolor = [ '#64c1cb', '#fff', '#64c1cb' ]; | |||
iceautumnbrcolor = [ '#64c1cb', '#fff', '#64c1cb' ]; | |||
icespringbrcolor = [ '#64c1cb', '#64c1cb', '#fff' ]; | |||
iceautumnfgcolor = [ '', '', '' ]; | |||
icespringfgcolor = [ '', '', '' ]; | |||
if ( now.getMonth() > 2 && now.getMonth() < 7 ) { | |||
bgcolor = icespringbgcolor[ icecatmean ]; | |||
} else { | |||
bgcolor = iceautumnbgcolor[ icecatmean ]; | |||
} | |||
out += '<div class="col col-6 col-sm-3 col-md-2 text-center">'; | out += '<div class="col col-6 col-sm-3 col-md-2 text-center">'; | ||
out += '<div style="height: 40px; display: flex; justify-content: center; align-items: center; flex-direction: column;"><span style="margin: 0;">' + jw.obstype[ 'ice' ].newest.inRelationToToday() + '</span></div>'; | out += '<div style="height: 40px; display: flex; justify-content: center; align-items: center; flex-direction: column;"><span style="margin: 0;">' + jw.obstype[ 'ice' ].newest.inRelationToToday() + '</span></div>'; | ||
out += '<div style="width: 84px; height: 84px; margin: auto; border-radius: 50%; background-color: | out += '<div style="width: 84px; height: 84px; margin: auto; border-radius: 50%; background-color: ' + bgcolor + '; display: flex; justify-content: center; align-items: center; flex-direction: column;">'; | ||
out += '<div style="font-size: 36px;">' + Math.round( jw.obstype[ 'ice' ].mean ) + '</div>'; | out += '<div style="font-size: 36px;">' + Math.round( jw.obstype[ 'ice' ].mean ) + '</div>'; | ||
out += '<div style="font-size: 24px; margin-top: -20px;">cm</div>'; | out += '<div style="font-size: 24px; margin-top: -20px;">cm</div>'; | ||


