From 7af09ba5183853809e83a4ad4fa2c73080c8ffc8 Mon Sep 17 00:00:00 2001 From: Jeff Clarke Date: Sun, 21 Mar 2021 11:42:50 +0000 Subject: [PATCH] Weather alerts are now truncated to show now more than three lines of description --- MMM-OpenWeatherForecast.css | 18 +++++++++++++++++- MMM-OpenWeatherForecast.js | 4 ---- mmm-openweather-forecast.njk | 1 + 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/MMM-OpenWeatherForecast.css b/MMM-OpenWeatherForecast.css index 5139fd9..01d8fb9 100644 --- a/MMM-OpenWeatherForecast.css +++ b/MMM-OpenWeatherForecast.css @@ -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 { diff --git a/MMM-OpenWeatherForecast.js b/MMM-OpenWeatherForecast.js index ba82eac..b32e28d 100644 --- a/MMM-OpenWeatherForecast.js +++ b/MMM-OpenWeatherForecast.js @@ -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) { diff --git a/mmm-openweather-forecast.njk b/mmm-openweather-forecast.njk index b2ba8d1..0759fdf 100644 --- a/mmm-openweather-forecast.njk +++ b/mmm-openweather-forecast.njk @@ -27,6 +27,7 @@ {% for alert in forecast.alerts %}
+ {{ alert.event }} {{ alert.description }} {{ alert.sender_name }}