show sun/moon as bright rather than bold if obj is visible

This commit is contained in:
Denis Treskunov 2020-01-18 08:39:54 -08:00
parent 08b9e7b5b5
commit 85a52523cf

View File

@ -161,7 +161,7 @@ Module.register("clock",{
if (this.config.showSunTimes) {
const sunTimes = SunCalc.getTimes(now, this.config.lat, this.config.lon);
const isVisible = now.isBetween(sunTimes.sunrise, sunTimes.sunset);
sunWrapper.innerHTML = '<span class="' + (isVisible ? 'bold' : 'light') + '"><i class="fa fa-sun-o" aria-hidden="true"></i></span>' +
sunWrapper.innerHTML = '<span class="' + (isVisible ? 'bright' : '') + '"><i class="fa fa-sun-o" aria-hidden="true"></i></span>' +
'<span><i class="fa fa-arrow-up" aria-hidden="true"></i>' + formatTime(this.config, sunTimes.sunrise) + '</span>' +
'<span><i class="fa fa-arrow-down" aria-hidden="true"></i>' + formatTime(this.config, sunTimes.sunset) + '</span>';
}
@ -169,7 +169,7 @@ Module.register("clock",{
const moonIllumination = SunCalc.getMoonIllumination(now.toDate());
const moonTimes = SunCalc.getMoonTimes(now, this.config.lat, this.config.lon);
const isVisible = now.isBetween(moonTimes.rise, moonTimes.set);
moonWrapper.innerHTML = '<span class="' + (isVisible ? 'bold' : 'light') + '"><i class="fa fa-moon-o" aria-hidden="true"></i> ' + moonIllumination.fraction.toLocaleString(undefined, {style: 'percent'}) + '</span>' +
moonWrapper.innerHTML = '<span class="' + (isVisible ? 'bright' : '') + '"><i class="fa fa-moon-o" aria-hidden="true"></i> ' + moonIllumination.fraction.toLocaleString(undefined, {style: 'percent'}) + '</span>' +
'<span><i class="fa fa-arrow-up" aria-hidden="true"></i> ' + formatTime(this.config, moonTimes.rise) + '</span>'+
'<span><i class="fa fa-arrow-down" aria-hidden="true"></i> ' + formatTime(this.config, moonTimes.set) + '</span>';
}