From 8aeafa7658c6dfab3a88df8205af682e6e82bf0d Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 12 Sep 2023 05:28:15 -0700 Subject: feat: jp text --- index.html | 4 ++++ index.js | 61 ++++++++++++++++++++++++++++++++++--------------------------- 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index c94773e..b5be298 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,11 @@ + + + ~/ + diff --git a/index.js b/index.js index 923f028..caf5125 100644 --- a/index.js +++ b/index.js @@ -2,32 +2,32 @@ const doc = document; function updateClock() { var days = [ - "sunday", - "monday", - "tuesday", - "wednesday", - "thursday", - "friday", - "saturday", + "日曜日にちようび", + "月曜日げつようび", + "火曜日かようび", + "水曜日すいようび", + "木曜日もくようび", + "金曜日きんようび", + "土曜日どようび", ]; var months = [ - "january", - "february", - "march", - "april", - "may", - "june", - "july", - "august", - "september", - "october", - "november", - "december", + "一月", + "二月", + "三月", + "四月", + "五月", + "六月", + "七月", + "八月", + "九月", + "十月", + "十一月", + "十二月", ]; var m = new Date(); var dateStr = days[m.getDay()] + - " " + + ", " + months[m.getMonth()] + " " + m.getDate() + @@ -123,14 +123,21 @@ function displayWeather(data) { 803: "broken clouds", 804: "overcast", }; + var currentWeather = `${data.current.temp.toFixed( + 0 + )} + ${ + conditions[data.current.weather[0].id] + } (体感温度たいかんおんど + ${data.current.feels_like.toFixed(0)})`; - var currentWeather = `${data.current.temp.toFixed(0)}°c - ${conditions[data.current.weather[0].id]} (feels like - ${data.current.feels_like.toFixed(0)}°c)`; - - var tmrrwWeather = `${data.daily[1].temp.day.toFixed(0)}°c - ${conditions[data.daily[1].weather[0].id]} (feels like - ${data.daily[1].feels_like.day.toFixed(0)}°c)`; + var tmrrwWeather = `${data.daily[1].temp.day.toFixed( + 0 + )} + ${ + conditions[data.daily[1].weather[0].id] + } (体感温度たいかんおんど + ${data.daily[1].feels_like.day.toFixed(0)})`; doc.getElementById("current").innerHTML += currentWeather; doc.getElementById("tmrrw").innerHTML += tmrrwWeather; -- cgit v1.2.3