3.2.4.1
Add values to thermal bands
This commit is contained in:
+11
-8
@@ -1756,13 +1756,13 @@ export function UTCIForecast() {
|
||||
<span class="utci-legend-label">Thermal stress bands</span>
|
||||
<div class="utci-legend-row">
|
||||
${[
|
||||
{ t: -9, label: 'Freezing' },
|
||||
{ t: 1, label: 'Cold' },
|
||||
{ t: 11, label: 'Cool' },
|
||||
{ t: 21, label: 'Comfortable', bold: true },
|
||||
{ t: 29, label: 'Caution' },
|
||||
{ t: 36, label: 'Extreme' },
|
||||
{ t: 47, label: 'Danger' },
|
||||
{ t: -9, label: 'Freezing', value: '< 0°C' },
|
||||
{ t: 1, label: 'Cold', value: '0–10°C' },
|
||||
{ t: 11, label: 'Cool', value: '10–19°C' },
|
||||
{ t: 21, label: 'Comfortable', value: '19–24°C', bold: true },
|
||||
{ t: 29, label: 'Caution', value: '27–32°C' },
|
||||
{ t: 36, label: 'Extreme', value: '32–41°C' },
|
||||
{ t: 47, label: 'Danger', value: '41°C+' },
|
||||
].map((b, i) => {
|
||||
const rgb = airTempRgb(b.t) || [200, 200, 200];
|
||||
const mid = `rgb(${rgb[0]},${rgb[1]},${rgb[2]})`;
|
||||
@@ -1771,7 +1771,10 @@ export function UTCIForecast() {
|
||||
const bg = `linear-gradient(135deg, ${light} 0%, ${mid} 60%, ${dark} 100%)`;
|
||||
const lum = (rgb[0]*299 + rgb[1]*587 + rgb[2]*114) / 1000;
|
||||
const fg = lum > 165 ? '#1a1a1a' : '#ffffff';
|
||||
return html`<span key=${i} class="utci-legend-item" style=${{ background: bg, color: fg, ...(b.bold ? { fontWeight: 700 } : {}) }}>${b.label}</span>`;
|
||||
return html`<span key=${i} class="utci-legend-item" style=${{ background: bg, color: fg, ...(b.bold ? { fontWeight: 700 } : {}) }}>
|
||||
<span class="utci-legend-item-label">${b.label}</span>
|
||||
<span class="utci-legend-item-value">${b.value}</span>
|
||||
</span>`;
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user