From 4afa194d3620447cb4bd129f6b09fd298a1ddc5d Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Wed, 7 Oct 2026 00:03:55 +0900 Subject: ParksTable.astro, kodaira-data/parks.mdx: 設備をアイコン化し、指定管理のバッジ・絞り込みを追加、注記を更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 設備ラベルの文字を廃止し、バッジはアイコンのみ(ホバーでラベル表示)にした。 --- src/components/ParksTable.astro | 43 +++++++++++++++++++-------------- src/content/docs/kodaira-data/parks.mdx | 4 +-- 2 files changed, 27 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/components/ParksTable.astro b/src/components/ParksTable.astro index 8d7f648..8121201 100644 --- a/src/components/ParksTable.astro +++ b/src/components/ParksTable.astro @@ -40,6 +40,9 @@ function facilityBadges(p: Park): Badge[] { const label = ball.includes("一部") ? "ボール遊び一部可" : "ボール遊び可"; badges.push({ kind: "ball", label, title: `ボール遊び: ${ball}` }); } + if (p["南西部指定管理"]) { + badges.push({ kind: "cm", label: "指定管理", title: "南西部地域の指定管理公園" }); + } return badges; } @@ -51,27 +54,28 @@ function facTokens(p: Park): string { if (p["遊具"]) tokens.push("toy"); const ball = p["ボール遊び"]; if (ball && ball !== "禁止") tokens.push("ball"); + if (p["南西部指定管理"]) tokens.push("cm"); return tokens.join(" "); } // 設備セルの補足テキスト(バッジで示した項目の詳細と、その他の項目)。 -const DETAIL_FIELDS: { key: string; label: string }[] = [ - { key: "ベンチ・椅子", label: "ベンチ・椅子" }, - { key: "テーブル", label: "テーブル" }, - { key: "防災用具", label: "防災用具" }, - { key: "遊具", label: "遊具" }, - { key: "備考", label: "備考" }, +// ラベル文字は使わず、アイコンで項目を示す。 +const DETAIL_FIELDS: { key: string; icon: string }[] = [ + { key: "ベンチ・椅子", icon: "🪑" }, + { key: "テーブル", icon: "🍽" }, + { key: "防災用具", icon: "🧯" }, + { key: "遊具", icon: "🎠" }, + { key: "備考", icon: "" }, ]; function detailText(p: Park): string { const parts: string[] = []; - if (p["南西部指定管理"]) parts.push("南西部指定管理"); - for (const { key, label } of DETAIL_FIELDS) { + for (const { key, icon } of DETAIL_FIELDS) { const value = p[key]; if (!value) continue; - parts.push(key === "備考" ? value : `${label}: ${value}`); + parts.push(icon ? `${icon} ${value}` : value); } const ball = p["ボール遊び"]; - if (ball && ball !== "禁止" && ball !== "可") parts.push(`ボール遊び: ${ball}`); + if (ball && ball !== "禁止" && ball !== "可") parts.push(`⚽ ${ball}`); return parts.join(" / "); } @@ -141,11 +145,12 @@ const total = parks.length;
- 設備で絞る + 設備・管理で絞る +
{total}件 @@ -212,9 +217,7 @@ const total = parks.length; {facilityBadges(park).map((b) => ( - - {b.label} - + ))} {detailText(park) ? {detailText(park)} : null} {facilityBadges(park).length === 0 && !detailText(park) ? EMPTY : null} @@ -412,14 +415,15 @@ const total = parks.length; .parks .fac-badge { display: inline-flex; align-items: center; - gap: 0.25em; + justify-content: center; margin: 0 0.3em 0.2em 0; - padding: 0 0.5em; + padding: 0 0.4em; border-radius: 1em; - font-size: 0.8em; - line-height: 1.8; + font-size: 0.85em; + line-height: 1.9; white-space: nowrap; background: color-mix(in srgb, currentColor 10%, transparent); + cursor: help; } .parks .fac-toilet::before { content: "🚻"; @@ -433,6 +437,9 @@ const total = parks.length; .parks .fac-ball::before { content: "⚽"; } + .parks .fac-cm::before { + content: "🏛"; + } .parks .fac-detail { display: block; margin-top: 0.25em; diff --git a/src/content/docs/kodaira-data/parks.mdx b/src/content/docs/kodaira-data/parks.mdx index 6887653..6f37125 100644 --- a/src/content/docs/kodaira-data/parks.mdx +++ b/src/content/docs/kodaira-data/parks.mdx @@ -20,7 +20,7 @@ import ParksTable from '@/components/ParksTable.astro'; :::note - 「種別」は、市の資料にある公園の区分です。街区は街区公園、近隣は近隣公園、運動は運動公園を指します。 - 面積の「小・中・大」は目安です。小は1000㎡未満、中は1000〜10000㎡、大は10000㎡以上としています。 -- 「種別」と設備(トイレ・水飲み場・遊具など)の情報は、市の南西部地域の公園のみです。全市分は公開されていません。設備の絞り込みは、この情報がある公園だけが対象です。 -- 設備の情報は「竣工時のデータが基」との注記があります。現在と異なる場合があります。 +- 「種別」と設備(トイレ・水飲み場・遊具など)の情報は、市の南西部地域の公園のみです。全市分は公開されていません。設備の絞り込みは、この情報がある公園だけが対象です。今後、全市分の情報を追加していく予定です。 +- 設備の情報は「竣工時のデータが基」との注記があります。現在と異なる場合のほか、転記などの誤りが含まれる場合があります。ご了承ください。 - 空欄は「—」で示しています。出典に記載がないという意味であり、設備がないという意味ではありません。 ::: -- cgit v1.3.1