fetch('/data/weather.json') .then(r=>r.json()).then(d=>{ const t=parseInt(d.current_condition[0].temp_C); const desc=d.current_condition[0].lang_ru?.[0]?.value||d.current_condition[0].weatherDesc[0].value; const sign=t>0?'+':''; document.getElementById('weather-val').textContent=`${sign}${t}°C`; const words=desc.split(' '); const mid=Math.ceil(words.length/2); document.getElementById('weather-lbl').textContent=words.slice(0,mid).join(' ')+'\n'+words.slice(mid).join(' '); }).catch(()=>{document.getElementById('weather-val').textContent='н/д';}); fetch('/data/currency.json') .then(r=>r.json()).then(d=>{ document.getElementById('usd-val').textContent=d.Valute.USD.Value.toFixed(2); document.getElementById('eur-val').textContent=d.Valute.EUR.Value.toFixed(2); }).catch(()=>{ document.getElementById('usd-val').textContent='н/д'; document.getElementById('eur-val').textContent='н/д'; });