Use weather icon instead of condition (more variety)

This commit is contained in:
2026-04-28 22:06:57 +02:00
parent dcb916d442
commit c4dd938a56
6 changed files with 450 additions and 512 deletions

View File

@@ -47,7 +47,7 @@ export default {
<projectRelTime :icon="timeIcon" :localTime="options.formatted_time_local" :siteTime="options.formatted_time" :offset="options.day_offset" />
<span v-if="project.mode==consts.modes.blog"> ({{ options.relative_time }})</span>
</p>
<p class="weather" v-if="options.weather_icon && options.weather_icon!='unknown'" :title="options.weather_cond==''?'':lang.get(options.weather_cond)">
<p class="weather" v-if="options.weather_icon && options.weather_icon!='unknown'" :title="options.weather_cond==''?'':lang.get('weather.'+options.weather_icon)">
<spotIcon :icon="options.weather_icon" fixed-width size="lg" :text="options.weather_temp+'°C'" />
</p>
<div v-if="medias.length > 0">

View File

@@ -162,7 +162,7 @@
<div class="body">
<div v-if="options.type == 'message'" class="body-box">
<div class="drill" @click.prevent="executeMainAction" @mouseenter="openMarkerPopup" @mouseleave="closeMarkerPopup">
<span v-if="options.weather_icon && options.weather_icon!='unknown'" class="weather clickable" :title="lang.get(options.weather_cond)">
<span v-if="options.weather_icon && options.weather_icon!='unknown'" class="weather clickable" :title="lang.get('weather.'+options.weather_icon)">
<spotIcon :icon="options.weather_icon" :text="Math.round(options.weather_temp)+'°C'" text-classes="temperature" />
</span>
<img class="staticmap clickable" :title="lang.get('media.click_zoom')" :src="options.static_img_url" />

View File

@@ -59,6 +59,7 @@ function customIcon(iconName, width, height, hex, path) {
};
}
/* TODO: Use official icons: https://github.com/visualcrossing/WeatherIcons/tree/main/SVG/2nd%20Set%20-%20Monochrome */
const faCloudBoltMoon = customIcon('cloud-bolt-moon', 640, 512, 'f76d', 'M399.1 48.4c34.7 19.6 59.3 54.8 64.2 96.1 38.8 22 64.9 63.6 64.9 111.4 35.6 .6 63.5-10.3 89.7-31.2 3.5-2.8 6.9-5.8 10.1-8.9 4.1-4 5.3-10.1 3-15.3s-7.7-8.4-13.4-7.9c-4 .3-7.9 .4-11.9 .3-55.5-1.9-99.9-47.5-99.9-103.4 0-36.3 18.7-68.3 47.1-86.8 3.3-2.2 6.8-4.1 10.3-5.9 5.1-2.5 8.1-8 7.4-13.7s-4.9-10.3-10.4-11.6c-10.5-2.4-21.2-3.5-31.9-3.5-56.7 0-105.8 32.8-129.3 80.5zM206.8 416L175.5 520.1c-3.6 11.9 5.3 23.9 17.8 23.9 4.6 0 9-1.7 12.4-4.7L346.9 412.9c3.5-3.1 5.5-7.6 5.5-12.4 0-9.2-7.4-16.6-16.6-16.6l-61.8 0 31.2-104.1c3.6-11.9-5.3-23.9-17.8-23.9-4.6 0-9 1.7-12.4 4.7L133.9 387.1c-3.5 3.1-5.5 7.6-5.5 12.4 0 9.2 7.4 16.6 16.6 16.6l61.8 0zm193.5-80.1c44.2 0 80-35.8 80-80 0-39.3-28.4-72.1-65.8-78.7 1.2-5.6 1.9-11.3 1.9-17.2 0-44.2-35.8-80-80-80-17 0-32.8 5.3-45.8 14.4-16.8-27.8-47.3-46.4-82.2-46.4-53.1 0-96.3 44.5-96 97.3-45.4 7.6-80 47.1-80 94.6 0 50 38.3 91.1 87.2 95.6L243.1 225c12.2-10.9 28-17 44.4-17 44.6 0 76.5 43 63.7 85.7l-12.7 42.2 61.8 0z');
const faCloudBoltSun = customIcon('cloud-bolt-sun', 576, 512, 'f76e', 'M248.5-31c-4.2-1.7-8.9-1.3-12.6 1.2L176 9.9 116.2-29.8c-3.7-2.5-8.5-2.9-12.6-1.2s-7.2 5.4-8.1 9.8L81.2 49.2 10.8 63.4c-4.4 .9-8.1 3.9-9.8 8.1S-.2 80.4 2.3 84.2L41.9 144 2.3 203.8c-2.5 3.7-2.9 8.5-1.2 12.6s5.4 7.2 9.8 8.1l69.3 14c.5-47.2 26.5-88.2 64.9-110 7.3-60.8 57.3-108.5 119.1-112.3l-7.6-37.4c-.9-4.4-3.9-8.1-8.1-9.8zM128 239.9c0 44.2 35.8 80 80 80l6.7 0 124-111c12.2-10.9 28-17 44.4-17 44.6 0 76.5 43 63.7 85.7l-12.7 42.2 45.8 0c53 0 96-43 96-96 0-47.6-34.6-87-80-94.6 .4-52.8-42.9-97.3-96-97.3-34.9 0-65.4 18.6-82.2 46.4-13-9.1-28.8-14.4-45.8-14.4-44.2 0-80 35.8-80 80 0 5.9 .6 11.7 1.9 17.2-37.4 6.7-65.8 39.4-65.8 78.7zM302.4 400L271.2 504.1c-3.6 11.9 5.3 23.9 17.8 23.9 4.6 0 9-1.7 12.4-4.7L442.5 396.9c3.5-3.1 5.5-7.6 5.5-12.4 0-9.2-7.4-16.6-16.6-16.6l-61.8 0 31.2-104.1c3.6-11.9-5.3-23.9-17.8-23.9-4.6 0-9 1.7-12.4 4.7L229.5 371.1c-3.5 3.1-5.5 7.6-5.5 12.4 0 9.2 7.4 16.6 16.6 16.6l61.8 0z');
const faCloudFog = customIcon('cloud-fog', 576, 512, 'f74e', 'M32 224c0 53 43 96 96 96l320 0c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0 1.1-5.2 1.6-10.5 1.6-16 0-44.2-35.8-80-80-80-24.3 0-46.1 10.9-60.8 28-18.7-35.7-56.1-60-99.2-60-61.9 0-112 50.1-112 112 0 7.1 .7 14.1 1.9 20.8-38.3 12.6-65.9 48.7-65.9 91.2zM512 392c0-13.3-10.7-24-24-24L24 368c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24zM88 464c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zm176 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l288 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-288 0z');