From c17312b14977cb8fb032e5f394a64aa0327abef2 Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Mon, 2 Nov 2026 09:22:42 +0900 Subject: hp-archive: カレンダーに「今日」ボタンを追加 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 月表示の横に「今日」ボタンを置き、押すと今日の日付を選んでその月に戻る - ヘッダーの高さが変わらないよう行の高さを固定 - X投稿用のキャプチャ画像を追加 --- src/components/ScheduleInteractive.astro | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/components/ScheduleInteractive.astro') diff --git a/src/components/ScheduleInteractive.astro b/src/components/ScheduleInteractive.astro index 6bcbb1c..4e1894b 100644 --- a/src/components/ScheduleInteractive.astro +++ b/src/components/ScheduleInteractive.astro @@ -323,7 +323,10 @@ calendarEl.innerHTML = `
-
${year}年${month}月
+
+
${year}年${month}月
+ +
@@ -348,6 +351,15 @@ }); }); + calendarEl.querySelectorAll('.schedule-cal-today').forEach((btn) => { + btn.addEventListener('click', () => { + selectedDate = todayKey; + currentMonth = todayMonth; + renderCalendar(); + showDayDetails(selectedDate); + }); + }); + calendarEl.querySelectorAll('.schedule-cal-nav').forEach((btn) => { btn.addEventListener('click', () => { const next = months.indexOf(currentMonth) + Number(btn.dataset.dir); -- cgit v1.3.1