Skip to content

Commit

Permalink
Weather alerts are now truncated to show now more than three lines of…
Browse files Browse the repository at this point in the history
… description
  • Loading branch information
jclarke0000 committed Mar 21, 2021
1 parent d45d88c commit 7af09ba
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
18 changes: 17 additions & 1 deletion MMM-OpenWeatherForecast.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,29 @@
background-position: 6px 10px;
}

.MMM-OpenWeatherForecast .weather-alert .weather-alert-description {
.MMM-OpenWeatherForecast .weather-alert .weather-alert-title {
font-size: 17px;
line-height: 1;
margin-bottom: 4px;
color: #DD1212;
display: block;
text-align: left;
padding-left: 36px;
font-weight: 700;
}
.MMM-OpenWeatherForecast .weather-alert .weather-alert-description {
font-size: 17px;
line-height: 1.2;
color: #FFF;
display: block;
text-align: left;
padding-left: 36px;

/* truncate to no more than three lines */
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}

.MMM-OpenWeatherForecast .weather-alert .weather-alert-source {
Expand Down
4 changes: 0 additions & 4 deletions MMM-OpenWeatherForecast.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,6 @@ Module.register("MMM-OpenWeatherForecast", {
conversionFactor = 3.6;
}

console.log("=========== units: " + this.config.units);
console.log("=========== use km/h: " + this.config.displayKmhForWind);
console.log("=========== conv factor: " + conversionFactor);

//wind gust
var windGust = null;
if (!this.config.concise && gust) {
Expand Down
1 change: 1 addition & 0 deletions mmm-openweather-forecast.njk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

{% for alert in forecast.alerts %}
<div class="weather-alert">
<span class="weather-alert-title">{{ alert.event }}</span>
<span class="weather-alert-description">{{ alert.description }}</span>
<span class="weather-alert-source">{{ alert.sender_name }}</span>
</div>
Expand Down

0 comments on commit 7af09ba

Please sign in to comment.