Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions defaultmodules/weather/current.njk
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
</span>
{% endif %}
{% if config.showUVIndex %}
<td class="align-right bright uv-index">
<div class="align-right bright uv-index">
<div class="wi dimmed wi-hot"></div>
{{ current.uvIndex }}
</td>
</div>
{% endif %}
</div>
{% endif %}
Expand Down
41 changes: 19 additions & 22 deletions defaultmodules/weather/forecast.njk
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
{% if forecast %}
{% set numSteps = forecast | calcNumSteps %}
{% set currentStep = 0 %}
<table class="{{ config.tableClass }}">
<div class="{{ config.tableClass }} weather-forecast" role="table">
{% if config.ignoreToday %}
{% set forecast = forecast.splice(1) %}
{% endif %}
{% set forecast = forecast.slice(0, numSteps) %}
{% for f in forecast %}
<tr
{% if config.colored %}class="colored"{% endif %}
{% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}
>
<div class="weather-forecast-row{% if config.colored %}{{ " colored" }}{% endif %}" role="row" {% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}>
{% if (currentStep == 0) and config.ignoreToday == false and config.absoluteDates == false %}
<td class="day">{{ "TODAY" | translate }}</td>
<div class="day" role="cell">{{ "TODAY" | translate }}</div>
{% elif (currentStep == 1) and config.ignoreToday == false and config.absoluteDates == false %}
<td class="day">{{ "TOMORROW" | translate }}</td>
<div class="day" role="cell">{{ "TOMORROW" | translate }}</div>
{% else %}
<td class="day">{{ f.date.format(config.forecastDateFormat) }}</td>
<div class="day" role="cell">{{ f.date.format(config.forecastDateFormat) }}</div>
{% endif %}
<td class="bright weather-icon">
<div class="bright weather-icon" role="cell">
<span class="wi weathericon wi-{{ f.weatherType }}"></span>
</td>
<td class="align-right bright max-temp">{{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }}</td>
<td class="align-right min-temp">{{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }}</td>
{% if config.showPrecipitationAmount %}
<td class="align-right bright precipitation-amount">{{ f.precipitationAmount | unit("precip", f.precipitationUnits) }}</td>
{% endif %}
{% if config.showPrecipitationProbability %}
<td class="align-right bright precipitation-prob">{{ f.precipitationProbability | unit('precip', '%') }}</td>
{% endif %}
</div>
<div class="align-right min-temp" role="cell">{{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }}</div>
<div class="align-right bright max-temp" role="cell">{{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }}</div>
{% if config.showUVIndex %}
<td class="align-right dimmed uv-index">
<div class="align-right dimmed uv-index" role="cell">
{{ f.uvIndex }}
<span class="wi dimmed weathericon wi-hot"></span>
</td>
</div>
{% endif %}
{% if config.showPrecipitationAmount %}
<div class="align-right bright precipitation-amount" role="cell">{{ f.precipitationAmount | unit("precip", f.precipitationUnits) }}</div>
{% endif %}
{% if config.showPrecipitationProbability %}
<div class="align-right bright precipitation-prob" role="cell">{{ f.precipitationProbability | unit('precip', '%') }}</div>
{% endif %}
</tr>
</div>
{% set currentStep = currentStep + 1 %}
{% endfor %}
</table>
</div>
{% else %}
<div class="dimmed light small">{{ "LOADING" | translate }}</div>
{% endif %}
Expand Down
43 changes: 22 additions & 21 deletions defaultmodules/weather/hourly.njk
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
{% if hourly %}
{% set numSteps = hourly | calcNumEntries %}
{% set currentStep = 0 %}
<table class="{{ config.tableClass }}">
<div class="{{ config.tableClass }} weather-hourly" role="table">
{% set hours = hourly.slice(0, numSteps) %}
{% for hour in hours %}
<tr
{% if config.colored %}class="colored"{% endif %}
{% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}
>
<td class="day">{{ hour.date | formatTime }}</td>
<td class="bright weather-icon">
<div class="weather-hourly-row{% if config.colored %}{{ " colored" }}{% endif %}" role="row" {% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}>
<div class="time" role="cell">{{ hour.date | formatTime }}</div>
<div class="bright weather-icon" role="cell">
<span class="wi weathericon wi-{{ hour.weatherType }}"></span>
</td>
<td class="align-right bright">{{ hour.temperature | roundValue | unit("temperature") }}</td>
</div>
<div class="align-right bright temperature" role="cell">{{ hour.temperature | roundValue | unit("temperature") }}</div>
{% if config.showUVIndex %}
<td class="align-right bright uv-index">
<div class="align-right bright uv-index" role="cell">
{% if hour.uvIndex!=0 %}
{{ hour.uvIndex }}
<span class="wi weathericon wi-hot"></span>
{% endif %}
</td>
</div>
{% endif %}
{% if config.showHumidity != "none" %}
<td class="align-left bright humidity-hourly">
<div class="align-left bright humidity-hourly" role="cell">
{{ hour.humidity }}
<span class="wi wi-humidity humidity-icon"></span>
</td>
</div>
{% endif %}
{% if config.showPrecipitationAmount %}
{% if (not config.hideZeroes or hour.precipitationAmount>0) %}
<td class="align-right bright precipitation-amount">{{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }}</td>
{% endif %}
<div class="align-right bright precipitation-amount{% if config.hideZeroes and hour.precipitationAmount <= 0 %}{{ " weather-hidden" }}{% endif %}" role="cell">
{% if not config.hideZeroes or hour.precipitationAmount > 0 %}
{{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }}
{% endif %}
</div>
{% endif %}
{% if config.showPrecipitationProbability %}
{% if (not config.hideZeroes or hour.precipitationAmount>0) %}
<td class="align-right bright precipitation-prob">{{ hour.precipitationProbability | unit('precip', '%') }}</td>
{% endif %}
<div class="align-right bright precipitation-prob{% if config.hideZeroes and hour.precipitationAmount <= 0 %}{{ " weather-hidden" }}{% endif %}" role="cell">
{% if not config.hideZeroes or hour.precipitationAmount > 0 %}
{{ hour.precipitationProbability | unit('precip', '%') }}
{% endif %}
</div>
{% endif %}
</tr>
</div>
{% set currentStep = currentStep + 1 %}
{% endfor %}
</table>
</div>
{% else %}
<div class="dimmed light small">{{ "LOADING" | translate }}</div>
{% endif %}
Expand Down
91 changes: 83 additions & 8 deletions defaultmodules/weather/weather.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,109 @@
padding-bottom: 6px;
}

.weather .weather-forecast,
.weather .weather-hourly {
display: grid;
width: max-content;
grid-template-columns: repeat(7, max-content);
}

.weather .weather-forecast-row,
.weather .weather-hourly-row {
display: grid;
grid-column: 1 / -1;
grid-template-columns: subgrid;
align-items: baseline;
column-gap: 25px;
}

.weather .day {
padding-left: 0;
padding-right: 25px;
white-space: nowrap;
}

.weather .weather-icon {
padding-right: 30px;
text-align: center;
}

.weather .min-temp {
padding-left: 20px;
padding-right: 0;
}

.weather .max-temp,
.weather .precipitation-amount,
.weather .precipitation-prob,
.weather .humidity-hourly,
.weather .uv-index {
padding-left: 20px;
padding-right: 0;
padding: 0;
}

.weather .weather-hidden {
visibility: hidden;
}

.weather .weather-forecast .day {
order: var(--weather-forecast-day-order, 1);
}

.weather .weather-forecast .weather-icon {
order: var(--weather-forecast-icon-order, 2);
}

.weather .weather-forecast .min-temp {
order: var(--weather-forecast-min-temp-order, 3);
}

.weather .weather-forecast .max-temp {
order: var(--weather-forecast-max-temp-order, 4);
}

.weather .weather-forecast .uv-index {
order: var(--weather-forecast-uv-index-order, 5);
}

.weather .weather-forecast .precipitation-amount {
order: var(--weather-forecast-precipitation-amount-order, 6);
}

.weather .weather-forecast .precipitation-prob {
order: var(--weather-forecast-precipitation-prob-order, 7);
}

.weather .weather-hourly .time {
order: var(--weather-hourly-time-order, 1);
white-space: nowrap;
}

.weather .weather-hourly .weather-icon {
order: var(--weather-hourly-icon-order, 2);
text-align: center;
}

.weather .weather-hourly .temperature {
order: var(--weather-hourly-temperature-order, 3);
}

.weather .weather-hourly .uv-index {
order: var(--weather-hourly-uv-index-order, 4);
}

.weather .weather-hourly .humidity-hourly {
order: var(--weather-hourly-humidity-order, 5);
}

.weather .weather-hourly .precipitation-amount {
order: var(--weather-hourly-precipitation-amount-order, 6);
}

.weather .weather-hourly .precipitation-prob {
order: var(--weather-hourly-precipitation-prob-order, 7);
}

.weather tr.colored .min-temp {
.weather .weather-forecast-row.colored .min-temp {
color: #bcddff;
}

.weather tr.colored .max-temp {
.weather .weather-forecast-row.colored .max-temp {
color: #ff8e99;
}

Expand Down
Loading