From eefdaa714aa82a99d551ee7a3670d3e68b83619a Mon Sep 17 00:00:00 2001 From: dekun Date: Sat, 3 Oct 2026 18:54:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=BB=E8=A7=88=E5=91=A8=E5=87=A0=EF=BC=9A?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=97=A5=E7=BB=BF=E8=89=B2=E3=80=81=E5=91=A8?= =?UTF-8?q?=E6=9C=AB=E7=BA=A2=E8=89=B2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- static/hub.css | 8 +++++++- static/hub.js | 16 ++++++++++------ templates/base.html | 2 +- templates/dashboard.html | 2 +- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/static/hub.css b/static/hub.css index 13c78e8..59c3e52 100644 --- a/static/hub.css +++ b/static/hub.css @@ -153,7 +153,13 @@ body.page-login .main { background: rgba(56, 189, 248, 0.35); } .overview-bj-weekday { - color: var(--text); + font-weight: 650; +} +.overview-bj-weekday.is-weekday { + color: var(--ok); +} +.overview-bj-weekday.is-weekend { + color: var(--bad); } .overview-bj-lunar { color: var(--muted); diff --git a/static/hub.js b/static/hub.js index a0372bd..6cc7b66 100644 --- a/static/hub.js +++ b/static/hub.js @@ -628,6 +628,7 @@ const y = Number(get("year")); const m = Number(get("month")); const d = Number(get("day")); + const weekdayIndex = new Date(Date.UTC(y, m - 1, d)).getUTCDay(); return { time: get("year") + @@ -641,7 +642,8 @@ get("minute") + ":" + get("second"), - weekday: WEEKDAYS[new Date(Date.UTC(y, m - 1, d)).getUTCDay()] || "", + weekdayIndex: weekdayIndex, + weekday: WEEKDAYS[weekdayIndex] || "", lunar: solarToLunarText(y, m, d), }; } catch (e) { @@ -667,6 +669,7 @@ p(bj.getMinutes()) + ":" + p(bj.getSeconds()), + weekdayIndex: bj.getDay(), weekday: WEEKDAYS[bj.getDay()] || "", lunar: solarToLunarText(y, m, d), }; @@ -681,12 +684,13 @@ el.setAttribute("datetime", parts.time.replace(" ", "T") + "+08:00"); const meta = document.getElementById("overview-bj-meta"); if (meta) { - const bits = [parts.weekday, parts.lunar].filter(Boolean); + const weekend = parts.weekdayIndex === 0 || parts.weekdayIndex === 6; + const wdClass = weekend ? "is-weekend" : "is-weekday"; meta.innerHTML = - '' + - bits[0] + - "" + - (bits[1] ? '' + bits[1] + "" : ""); + (parts.weekday + ? '' + parts.weekday + "" + : "") + + (parts.lunar ? '' + parts.lunar + "" : ""); } } diff --git a/templates/base.html b/templates/base.html index 7a3ca24..87076bb 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,7 +4,7 @@ {% block title %}期权中控{% endblock %} - + {% if session.get('logged_in') %} diff --git a/templates/dashboard.html b/templates/dashboard.html index 7c37855..8a25d11 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -15,6 +15,6 @@
{% endblock %} {% block scripts %} - + {% endblock %}