diff --git a/fff/09_yohou/main.js b/fff/09_yohou/main.js index f554479..dc197a0 100644 --- a/fff/09_yohou/main.js +++ b/fff/09_yohou/main.js @@ -58,31 +58,27 @@ function makeCondition(tenki) { const list = []; - // weather code wa honrai motto aru - // demo kono page de tsukau no wa kore dake - if (tenki.code === 0) { + + if (tenki.code === 0) { list.push("sunny"); - document.getElementById("weatherIcon").textContent = "☆彡☀"☆彡; - document.getElementById("weatherText").textContent = "晴れ"; + iconEl.innerHTML = "☀"; + textEl.textContent = "晴れ"; } else if (tenki.code >= 61) { list.push("rain"); - document.getElementById("weatherIcon").textContent = "☁☂☁"; - document.getElementById("weatherText").textContent = "雨"; + iconEl.innerHTML = "🌧"; + textEl.textContent = "雨"; } else { list.push("cloudy"); - document.getElementById("weatherIcon").textContent = "☁⛈☁"; - document.getElementById("weatherText").textContent = "くもり"; + iconEl.innerHTML = "☁"; + textEl.textContent = "くもり"; } if (tenki.temp >= 25) list.push("hot"); if (tenki.temp <= 10) list.push("cold"); const day = today.getDay(); - if (day === 0 || day === 6) { - list.push("weekend"); - } else { - list.push("weekday"); - } + if (day === 0 || day === 6) list.push("weekend"); + else list.push("weekday"); return list; } @@ -176,4 +172,3 @@ } main(); -