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 ++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'src/components/ParksTable.astro') 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;