From 2f4f3817adaa9722dabe8448105b83d6ce566c8a Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Mon, 19 Oct 2026 10:23:59 +0900 Subject: parks: 表をPNG画像で保存できるボタンを追加 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ParksTable.astro | 222 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) (limited to 'src') diff --git a/src/components/ParksTable.astro b/src/components/ParksTable.astro index 6f8fdbd..e5def82 100644 --- a/src/components/ParksTable.astro +++ b/src/components/ParksTable.astro @@ -204,9 +204,11 @@ const total = parks.length; + {total}件

設備の情報は、市の資料などに基づきます。設備で絞ると、この情報がある公園だけが対象になります。

+

@@ -345,6 +347,85 @@ const total = parks.length; font-size: 0.9rem; opacity: 0.75; } + .parks-save { + padding: 0.35rem 0.7rem; + border: 1px solid var(--sl-color-hairline, #ccc); + border-radius: 0.35rem; + background: var(--sl-color-bg, #fff); + color: var(--sl-color-text, inherit); + font: inherit; + font-size: 0.85rem; + cursor: pointer; + } + .parks-save:hover { + border-color: var(--sl-color-text-accent, #4c8); + } + .parks-save:disabled { + opacity: 0.6; + cursor: wait; + } + .parks-save-status { + margin: 0 0 0.6rem; + font-size: 0.8rem; + opacity: 0.8; + } + .parks-save-status:empty { + display: none; + } + /* 画像保存用のオフスクリーン領域。サイトの表スタイルをそのまま使う。 */ + .parks-capture { + position: fixed; + left: 0; + top: 0; + z-index: -1; + pointer-events: none; + width: max-content; + padding: 24px 28px; + background: #fff; + color: #1a1a1a; + color-scheme: light; + --sl-color-text: #1a1a1a; + --sl-color-bg: #ffffff; + --sl-color-hairline: #dddddd; + --sl-color-gray-4: #888888; + --sl-color-gray-6: #eef1f3; + --sl-color-white: #1a1a1a; + --sl-color-text-accent: #0b7a4b; + } + .parks-capture-head { + display: flex; + align-items: baseline; + gap: 0.8rem; + margin-bottom: 0.2rem; + } + .parks-capture-head strong { + font-size: 1.35rem; + } + .parks-capture-head span { + font-size: 0.9rem; + opacity: 0.75; + } + .parks-capture-meta { + margin-bottom: 0.7rem; + font-size: 0.8rem; + opacity: 0.75; + } + .parks-capture table { + width: max-content; + } + .parks-capture thead th { + position: static; + background: #eef1f3; + color: #1a1a1a; + } + .parks-capture tbody td { + color: #1a1a1a; + } + .parks-capture-foot { + margin-top: 0.7rem; + font-size: 0.72rem; + opacity: 0.65; + } .parks-hint, .parks-none { margin: 0 0 0.6rem; @@ -593,6 +674,8 @@ const total = parks.length;