From bcec51fae68854f49f0260474dd9cd215416a7e9 Mon Sep 17 00:00:00 2001 From: Cx330 <1487537121@qq.com> Date: Sat, 29 Mar 2025 21:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/body.css | 23 ++++++++++++++++++++++- index.html | 31 ++++++------------------------- javascape/time.js | 9 +++++++++ 3 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 javascape/time.js diff --git a/css/body.css b/css/body.css index 7f70599..8afb26b 100644 --- a/css/body.css +++ b/css/body.css @@ -4,4 +4,25 @@ body, html { padding: 0; font-family: Arial, sans-serif; /* 默认字体 */ background-color:#f4f4f4; -} \ No newline at end of file +} + +/*主内容区test*/ +.container { + width: 60%; + margin: 10% auto 0; + background-color: #f0f0f0; + padding: 2% 5%; + border-radius: 10px +} + +ul { + padding-left: 20px; +} + + ul li { + line-height: 2.3 + } + +a { + color: #20a53a +} \ No newline at end of file diff --git a/index.html b/index.html index 2101e30..b61b9f9 100644 --- a/index.html +++ b/index.html @@ -3,31 +3,8 @@ DreamLife|HomePage - - - - - + + @@ -40,11 +17,15 @@
  • 目前网站工具箱以基本完善
  • 工具箱网站dreamlife.top/toolbox
  • +

    您的当前区域时间

    +

    加载中...

    + + \ No newline at end of file diff --git a/javascape/time.js b/javascape/time.js new file mode 100644 index 0000000..7b748d3 --- /dev/null +++ b/javascape/time.js @@ -0,0 +1,9 @@ +//获取计算机的时间信息 +function updateLocalTime() { + const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + const now = new Date().toLocaleString('zh-CN', { timeZone: timezone }); + document.getElementById('timeDisplay').innerText = `当前时间 (${timezone}): ${now}`; +} + +setInterval(updateLocalTime, 1000); // 每秒更新时间 +window.onload = updateLocalTime; \ No newline at end of file