Skip to content

Commit

Permalink
fixed icon paths
Browse files Browse the repository at this point in the history
  • Loading branch information
elisaciardulli committed Feb 12, 2025
1 parent d537175 commit 7d71620
Show file tree
Hide file tree
Showing 7 changed files with 4,750 additions and 2,654 deletions.
4 changes: 2 additions & 2 deletions code/components/tabByArea/tabByArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class WeatherForecast extends LitElement {
</div>
<div class="forecast">
${slice_of_bezirksforecast.map(
({ date, WeatherCode, MinTemp, MaxTemp }) => {
({ date, WeatherCode, MinTemp, MaxTemp, WeatherImgUrl }) => {
return html`
<div class="forecast__item">
<p class="forecast__item__day">
Expand All @@ -116,7 +116,7 @@ class WeatherForecast extends LitElement {
)}
</p>
<img
src="${WEATHER_ICON_SVG_PATH}/${WeatherCode}.svg"
src="${WeatherImgUrl}"
class="forecast__item__icon"
/>
<p class="forecast__item__temp">
Expand Down
6 changes: 3 additions & 3 deletions code/components/tabForecast/components/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ function render__carousel__card(header_img_src, location, today, today_string, l
<div class="carousel__card">
<div class="carousel__card__header_img" style="background-image: url('${header_img_src}');"></div>
<div class="carousel__card__body">
${today && today.WeatherCode
${today && today.WeatherImgUrl
? html`
<div class="carousel__card__body__weather_icon">
<img
style=""
src=${`https://www.suedtirol.info/static/img/weatherIcons/${today ? today.WeatherCode : ''}.svg`}
src=${today.WeatherImgUrl}
/>
</div>
`
: null}
<div
class="carousel__card__body__text_container"
style="${today && !today.WeatherCode ? 'margin-left: 8px;' : ''}"
style="${today && !today.WeatherImgUrl ? 'margin-left: 8px;' : ''}"
>
<div class="carousel__card__body__v_align_middle">
<p class="carousel__card__body__location">${location}</p>
Expand Down
4 changes: 2 additions & 2 deletions code/components/tabForecast/components/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { html } from 'lit-element';
import { render__placehoder } from '../utils';

export function render__location(location, name, max_temp, min_temp, weather_code, placeholder_mod) {
export function render__location(location, name, max_temp, min_temp, weather_code, weather_image_url, placeholder_mod) {
let class__weather__icon = `weather-map-new__icon weather-map-new__icon--${location}`;
return html`
<a class="weather-map-new__info" href="#">
Expand All @@ -17,7 +17,7 @@ export function render__location(location, name, max_temp, min_temp, weather_cod
`
: html`
<img
src="https://www.suedtirol.info/static/img/weatherIcons/${weather_code}.svg"
src="${weather_image_url}"
class="${class__weather__icon}"
/>
`}
Expand Down
16 changes: 9 additions & 7 deletions code/components/tabForecast/tabForecast.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,25 +199,27 @@ class Meteo extends LitElement {
${new_suedtirol_map(this.language_translation)}
${placeholder_mod
? placeholder_places.map(
({ Id, CityName, Maxtemp, MinTemp, WeatherCode }) => {
({ Id, CityName, Maxtemp, MinTemp, WeatherCode, WeatherImgUrl}) => {
return this.render__location(
localities_class[Id],
CityName.split("/")[0],
Maxtemp,
MinTemp,
WeatherCode,
WeatherImgUrl,
placeholder_mod
);
}
)
: localities_today.map(
({ Id, CityName, Maxtemp, MinTemp, WeatherCode }) => {
({ Id, CityName, Maxtemp, MinTemp, WeatherCode, WeatherImgUrl }) => {
return this.render__location(
localities_class[Id],
CityName.split("/")[0],
Maxtemp,
MinTemp,
WeatherCode
WeatherCode,
WeatherImgUrl
);
}
)}
Expand All @@ -228,8 +230,8 @@ class Meteo extends LitElement {
<div class="forecast">
${Forecast && this.selected_district_id === 0
? Forecast.slice(0, this.forecast_days).map(
({ date, Weathercode, TempMinmin, TempMaxmax }) => {
let weather_icon = `${WEATHER_ICON_PATH}/${Weathercode}.svg`;
({ date, Weathercode, TempMinmin, TempMaxmax, WeatherImgUrl }) => {
let weather_icon = `${WeatherImgUrl}`;
return html`
<div class="forecast__item">
<p class="forecast__item__day">
Expand Down Expand Up @@ -263,14 +265,14 @@ class Meteo extends LitElement {
this.forecast_days + 1
);
return slice_of_bezirksforecast.map(
({ date, WeatherCode, MinTemp, MaxTemp }) => {
({ date, WeatherCode, MinTemp, MaxTemp, WeatherImgUrl }) => {
return html`
<div class="forecast__item">
<p class="forecast__item__day">
${moment(date).format("dddd")}
</p>
<img
src="${WEATHER_ICON_PATH}/${WeatherCode}.svg"
src="${WeatherImgUrl}"
class="forecast__item__icon"
/>
<p class="forecast__item__temp">
Expand Down
21 changes: 14 additions & 7 deletions code/components/tabForecast/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,56 @@ export const placeholder_places = [
CityName: 'Silandro',
WeatherCode: 'a',
MinTemp: -7,
Maxtemp: 2
Maxtemp: 2,
WeatherImgUrl: 'https://api-weather.services.siag.it/api/v2/graphics/icons/imgsource/wetter/icon_10.png'
},
{
Id: 2,
CityName: 'Merano',
WeatherCode: 'b',
MinTemp: -6,
Maxtemp: 5
Maxtemp: 5,
WeatherImgUrl: 'https://api-weather.services.siag.it/api/v2/graphics/icons/imgsource/wetter/icon_10.png'
},
{
Id: 3,
CityName: 'Bolzano',
WeatherCode: 'b',
MinTemp: -5,
Maxtemp: 5
Maxtemp: 5,
WeatherImgUrl: 'https://api-weather.services.siag.it/api/v2/graphics/icons/imgsource/wetter/icon_10.png'
},
{
Id: 4,
CityName: 'Vipiteno',
WeatherCode: 'a',
MinTemp: -13,
Maxtemp: -1
Maxtemp: -1,
WeatherImgUrl: 'https://api-weather.services.siag.it/api/v2/graphics/icons/imgsource/wetter/icon_10.png'
},
{
Id: 5,
CityName: 'Bressanone',
WeatherCode: 'b',
MinTemp: -7,
Maxtemp: 3
Maxtemp: 3,
WeatherImgUrl: 'https://api-weather.services.siag.it/api/v2/graphics/icons/imgsource/wetter/icon_10.png'
},
{
Id: 6,
CityName: 'Brunico',
WeatherCode: 'b',
MinTemp: -15,
Maxtemp: -1
Maxtemp: -1,
WeatherImgUrl: 'https://api-weather.services.siag.it/api/v2/graphics/icons/imgsource/wetter/icon_10.png'
},
{
Id: 7,
CityName: 'Dolomiten',
WeatherCode: 'b',
MinTemp: -15,
Maxtemp: -1
Maxtemp: -1,
WeatherImgUrl: 'https://api-weather.services.siag.it/api/v2/graphics/icons/imgsource/wetter/icon_10.png'
}
];
export function render__placehoder(custom_class) {
Expand Down
8 changes: 5 additions & 3 deletions code/components/tabOnTheMountain/components/mountain_slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export function render__mountain_slide(
Southdesc,
Northcode,
Northdesc,
Winddesc
Winddesc,
NorthImgUrl,
SouthImgUrl
} = {},
day_code
) {
Expand Down Expand Up @@ -104,11 +106,11 @@ export function render__mountain_slide(
<h3>${p.mountain_weather[this.language_translation]}</h3>
<div class="meteo_mountain_widget__slide_section__north_south">
<div class="meteo_mountain_widget__slide_section__north_south__element">
<img src="https://www.suedtirol.info/static/img/weatherIcons/${Southcode}.svg" />
<img src="${SouthImgUrl}" />
<p><strong> ${p.main_chain_of_the_alps[this.language_translation]}</strong><br />${Southdesc}</p>
</div>
<div class="meteo_mountain_widget__slide_section__north_south__element">
<img src="https://www.suedtirol.info/static/img/weatherIcons/${Northcode}.svg" />
<img src="${NorthImgUrl}" />
<p><strong>${p.dolomites_ortler_range[this.language_translation]}</strong><br />${Northdesc}</p>
</div>
</div>
Expand Down
Loading

0 comments on commit 7d71620

Please sign in to comment.