Skip to content

Commit

Permalink
review some css / display part
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsounet committed Apr 6, 2024
1 parent 5cbf3ee commit dfe36c2
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 42 deletions.
84 changes: 67 additions & 17 deletions MMM-MeteoFrance.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,15 @@
color: #FFFFFF;
}

.MMM-MeteoFrance .temperature .low-temperature,
.MMM-MeteoFrance .temperature-container .low-temperature {
color: #AAA;
}

.MMM-MeteoFrance .temperature .high-temperature,
.MMM-MeteoFrance .temperature-container .high-temperature {
.MMM-MeteoFrance .temperature-container .high-temperature,
.MMM-MeteoFrance .temperature-uv-container .high-temperature {
color: #F8DD70;
}

.MMM-MeteoFrance .temperature .low-temperature,
.MMM-MeteoFrance .temperature-container .low-temperature {
.MMM-MeteoFrance .temperature-container .low-temperature,
.MMM-MeteoFrance .temperature-uv-container .low-temperature {
color: #6FC4F5;
}

Expand Down Expand Up @@ -147,11 +144,55 @@
position: relative;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container {
margin-left: 5px;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .icon_uv {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAoCAYAAACSN4jeAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAJqADAAQAAAABAAAAKAAAAAA7wp46AAAIJElEQVRYCd1Ya2xcRxWembvX9tpObFLbGzt24zSh6iOUpo3SipKWtBUtqGpUpFgRED/WD2iDf4Boi0RBTvhRkAIpIiSpvd5du2kpCSmoRE0oj7YCKqCkUZM6BfKo4zjB67jGjhNnvXvvDN+5u7O5NvsSmB8w1nrOmTlzzjfnnDkzu4z9vzdfc8+dVS3Bj83XPsV8KKpsDvilZAeUbfVXNQXumg+d8wKMSXmrYuoaxdhyydW8eG1egC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9h3vCMuMF2jFezdswG2U/BFFKY+QslDPJeTVjObxMnM2p/lcfU5gm+ubR4FqmhQh3xYLiy3TSulFgsQ+k+QXWja7Vc9RLw28t5JNSblG0/n0OYE535SVSoSBs1Ip+dfotGnlXKjfA2CUeNBNdf7eGj3nkeIw4h9J8PweX0swdYdqmUx9TmC0sMA0nkGeOfck2LorzEp5xust2QOPHiU59MuiUt1FNLW7Hyp9DdcFvXzRZJ1U8pEEnft/XsDOB1v/ip2/AJ8MI54Tj9ZfrUV0CoVk34HXIsi2o4sEP6TN0m8gHpN/HfVrDGNDXCro+C+0xc2heqpr6VT7vthflemnKgo9Pa/TrfufG/sn185FRytrdC4AAAAASUVORK5CYII=);
background-repeat: no-repeat;
background-size: cover;
background-color: yellow;
border-radius: 8px;
width: 16px;
height: 16px;
transform: translate(0, -5px);
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv0,
.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv1,
.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv2 {
color: green;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv3,
.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv4,
.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv5 {
color: yellow;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv6,
.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv7 {
color: orange;;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv8,
.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv9,
.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv10 {
color: red;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv11,
.MMM-MeteoFrance .extra-current-conditions-wrapper .uv-container .uv12 {
color: mediumpurple;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .wind-alert-container .wind-speed-gust {
color: white;
background-color: #ed1c24;
border-radius: 2px;
line-height: 2;
border-radius: 5px;
line-height: 2.5;
padding: 5px;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .feels-sun-container .inline-icon {
Expand All @@ -160,7 +201,7 @@
transform: translate(0, -5px);
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .temperature-container,
.MMM-MeteoFrance .extra-current-conditions-wrapper .temperature-uv-container,
.MMM-MeteoFrance .extra-current-conditions-wrapper .precipitation-container,
.MMM-MeteoFrance .extra-current-conditions-wrapper .wind-container,
.MMM-MeteoFrance .extra-current-conditions-wrapper .wind-alert-container {
Expand All @@ -169,14 +210,10 @@
margin-left: auto;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .Precip-wind-contener {
display: flex;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .temperature-container .wi-thermometer {
.MMM-MeteoFrance .extra-current-conditions-wrapper .temperature-uv-container .wi-thermometer {
font-size: 80%;
transform: translate(0, -1px);
margin-right: 5px;
/*margin-right: 5px;*/
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .wind-alert-container .wi-strong-wind {
Expand Down Expand Up @@ -282,11 +319,20 @@
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .feels-sun-container .wi-humidity {
color: #167ac6;
color: #0091ff;
font-size: 80%;
transform: translate(0, -1px);
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .Precip-wind-contener .wi-raindrop {
color: #0091ff;
vertical-align: middle;
}

.MMM-MeteoFrance .extra-current-conditions-wrapper .Precip-wind-contener .wind-container {
margin-left: 5px;
}

/* Summary */

.MMM-MeteoFrance .summary {
Expand Down Expand Up @@ -447,6 +493,10 @@
font-size: 17px;
}

.MMM-MeteoFrance .wrapper.table .forecast-container .header-row .wind-header {
font-size: 17px;
}

.MMM-MeteoFrance .wrapper.table .forecast-container .header-row .wind-arrow-header {
font-size: 24px;
}
20 changes: 10 additions & 10 deletions MMM-MeteoFrance.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Module.register("MMM-MeteoFrance", {
*/
processWeatherData () {

var summary = `${this.weatherData.nowcast.weather_description }.`;
var summary = `${this.weatherData.nowcast.weather_description}.`;

var hourlies = [];

Expand Down Expand Up @@ -191,15 +191,15 @@ Module.register("MMM-MeteoFrance", {

return {
currently : {
temperature: `${this.weatherData.nowcast.temperature }°`,
temperature: `${this.weatherData.nowcast.temperature}°`,
iconPath: this.weatherData.nowcast.weather_icon,
background: this.weatherData.nowcast.weather_background,
tempRange: this.formatHiLowTemperature(this.weatherData.daily_forecast.T_max, this.weatherData.daily_forecast.T_min),
precipitation: this.formatPrecipitation(this.weatherData.daily_forecast.total_precipitation_24h),
wind: this.formatWind(this.weatherData.nowcast.wind_speed, this.weatherData.nowcast.wind_speed_gust, this.weatherData.nowcast.wind_icon),
feels: this.formatFeels(this.weatherData.nowcast.felt_temperature),
sun: this.formatSun(this.weatherData.daily_forecast.sunrise_time, this.weatherData.daily_forecast.sunset_time),
humidity: `${this.weatherData.nowcast.relative_humidity }%`,
humidity: `${this.weatherData.nowcast.relative_humidity}%`,
uv: Math.round(this.weatherData.daily_forecast.uv_index)
},
summary : summary,
Expand Down Expand Up @@ -285,7 +285,7 @@ Module.register("MMM-MeteoFrance", {
// --------- Temperature ---------

if (type === "hourly") { //just display projected temperature for that hour
fItem.temperature = `${Math.round(fData.temperature) }°`;
fItem.temperature = `${Math.round(fData.temperature)}°`;
} else { //display High / Low temperatures
fItem.tempRange = this.formatHiLowTemperature(fData.temp.max,fData.temp.min);
}
Expand All @@ -297,7 +297,7 @@ Module.register("MMM-MeteoFrance", {
},

formatFeels (feels) {
return this.translate("FEELS", { DEGREE: `${Math.round(feels) }°` });
return this.translate("FEELS", { DEGREE: `${Math.round(feels)}°` });
},

formatSun (Sunrise,Sunset) {
Expand All @@ -319,8 +319,8 @@ Module.register("MMM-MeteoFrance", {
*/
formatHiLowTemperature (h,l) {
return {
high: `${Math.round(h) }°`,
low: `${Math.round(l) }°`
high: `${Math.round(h)}°`,
low: `${Math.round(l)}°`
};
},

Expand All @@ -329,7 +329,7 @@ Module.register("MMM-MeteoFrance", {
*/
formatPrecipitation (precipitation) {
return {
accumulation: precipitation ? `${precipitation } mm` : "0 mm"
accumulation: precipitation ? `${precipitation} mm` : "0 mm"
};

},
Expand All @@ -341,8 +341,8 @@ Module.register("MMM-MeteoFrance", {
var Beaufort = this.kmh2Beaufort(speed);

return {
windSpeed: `${Math.round(speed) } km/h`,
windSpeedGust: gust ? `${Math.round(speed+gust) } km/h` : 0,
windSpeed: `${Math.round(speed)} km/h`,
windSpeedGust: gust ? `${Math.round(speed+gust)} km/h` : 0,
windIcon: icon,
Beaufort: `Beaufort${Beaufort}`
};
Expand Down
32 changes: 18 additions & 14 deletions MMM-MeteoFrance.njk
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,26 @@
<span class="wi wi-humidity"></span>
<span class="humidity"> {{ forecast.currently.humidity }}</span>
{% endif %}
{% if config.display.UV %}
<img class="inline-icon uv" src="{{ inlineIcons.uv }}" />
<span class="uv"> {{ forecast.currently.uv }}</span>
{% endif %}
</div>
<span class="temperature-container">
<span class="wi wi-thermometer"></span>
<span class="low-temperature">{{ forecast.currently.tempRange.low }}</span>
<span class="temperature-separator dimmed">/</span>
<span class="high-temperature">{{ forecast.currently.tempRange.high }}</span>
<span class="temperature-uv-container">
<span class="temp-container">
<span class="wi wi-thermometer"></span>
<span class="low-temperature">{{ forecast.currently.tempRange.low }}</span>
<span class="temperature-separator">/</span>
<span class="high-temperature">{{ forecast.currently.tempRange.high }}</span>
</span>
{% if config.display.UV %}
<span class="uv-container">
<span class="inline-icon icon_uv"></span>
<span class="uv{{ forecast.currently.uv }}"> {{ forecast.currently.uv }}</span>
</span>
{% endif %}
</span>
<div class="Precip-wind-contener">
{% if config.display.Precipitation %}
<span class="precipitation-container">
{% if (config.display.InlineIcons) %}
<img class="inline-icon rain" src="{{ inlineIcons.rain }}" />
<span class="wi wi-raindrop"></span>
{% endif %}
{% if forecast.currently.precipitation.accumulation %}
<span class="pop">{{ forecast.currently.precipitation.accumulation }}</span>
Expand All @@ -71,7 +75,7 @@
{% if config.display.Wind %}
<span class="wind-container">
{% if (config.display.InlineIcons) %}
<img class="inline-icon" src="{{ inlineIcons.wind }}" />
<span class="wi wi-strong-wind"></span>
{% endif %}
<span class="wind-speed">{{ forecast.currently.wind.windSpeed }}</span>
{% if forecast.currently.wind.windIcon %}
Expand All @@ -82,7 +86,7 @@
</div>
{% if config.display.Wind and forecast.currently.wind.windSpeedGust %}
<div class="wind-alert-container">
<span class="wi wi-strong-wind"></span>
<span class="fa-solid fa-wind"></span>
<span class="wind-speed-gust">RAFALES {{ forecast.currently.wind.windSpeedGust }}</span>
</div>
{% endif %}
Expand Down Expand Up @@ -113,7 +117,7 @@

{% if config.display.Wind %}
<span class="wind-header">
<img class="inline-icon wind" src="{{ inlineIcons.wind }}" />
<span class="wi wi-strong-wind"></span>
</span>
<span class="wind-arrow-header">&nbsp;</span>
{% endif %}
Expand Down Expand Up @@ -162,7 +166,7 @@
</span>
<span class="temperature-container small">
<span class="low-temperature">{{ d.tempRange.low }}</span>
<span class="temperature-separator dimmed">/</span>
<span class="temperature-separator">/</span>
<span class="high-temperature">{{ d.tempRange.high }}</span>
</span>

Expand Down
5 changes: 4 additions & 1 deletion node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,15 @@ module.exports = NodeHelper.create({
case "p11j":
case "p12j":
case "p13j":
case "p13bisj":
case "p14j":
case "p15j":
case "p9n":
case "p10n":
case "p11n":
case "p12n":
case "p13n":
case "p13bisn":
case "p14n":
case "p15n":
background = "pluie";
Expand Down Expand Up @@ -199,6 +201,7 @@ module.exports = NodeHelper.create({
break;

default:
console.error(`[METEOFRANCE] Unkown icon: ${name}, Thanks to inform developer!`)
background = "soleil_nuage";
break;
}
Expand All @@ -214,7 +217,7 @@ module.exports = NodeHelper.create({
},

sendError (error, message) {
console.error(`[METEOFRANCE] **ERREUR** ${ error}`, message ? message: "");
console.error(`[METEOFRANCE] **ERREUR** ${error}`, message ? message: "");
this.sendSocketNotification("ERROR", error.message || error);
}
});

0 comments on commit dfe36c2

Please sign in to comment.