From 0c0c5de8c6bc2e06d0749188a9717475e1df60aa Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:22:18 +0900 Subject: parks: フィルタの選択肢を更新し、選択中を強調 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 水飲み・緑地広場・スイング遊具に改名し、ロープウェイ・ボール遊びを外してバスケゴール・東屋/シェルター・健康遊具・特殊遊具を追加。チェック中のフィルタを色付きで強調。 --- src/components/ParksFilters.astro | 31 +++++++++++++++++---------- src/components/ParksTable.astro | 45 +++++++++++++++++++++++++++++++++++---- 2 files changed, 61 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/components/ParksFilters.astro b/src/components/ParksFilters.astro index f31503b..172edf0 100644 --- a/src/components/ParksFilters.astro +++ b/src/components/ParksFilters.astro @@ -56,10 +56,10 @@ const facilityTypes = [
設備・遊具で絞る - + @@ -77,7 +77,7 @@ const facilityTypes = [ - - + + + +
+ {total}件 @@ -175,6 +175,15 @@ const facilityTypes = [ height: 0.9em; margin: 0; } + /* 选择中的フィルタを目立たせる */ + .parks-controls label:has(input[type="checkbox"]:checked) { + padding: 0 0.35rem; + border-radius: 999px; + background: var(--sl-color-accent-low, #dbeafe); + outline: 1px solid var(--sl-color-accent, #2563eb); + color: var(--sl-color-text, inherit); + font-weight: 700; + } .filter-icon { display: inline-flex; width: 18px; diff --git a/src/components/ParksTable.astro b/src/components/ParksTable.astro index 665a176..1eab03d 100644 --- a/src/components/ParksTable.astro +++ b/src/components/ParksTable.astro @@ -103,6 +103,33 @@ function facilityBadges(p: Park): Badge[] { return badges; } +// スイング遊具・健康遊具の判定用 +const SPRING_TOKENS = [ + "スプリング", "スイング", "リトルポップ", "リンクミニ", "ルッキンロッキン", + "リーフィー", "チューリー", "ロッキンパッピー", "ビー", "ハッピー", + "ハニー", "クップル", "ウゴウゴ", +]; +const HEALTH_TOKENS = [ + "フィットコンビ", "レグオーバー", "アームウォーカー", "ホップオーバー", + "ジャンプ・ステップ", "立位体前屈", "懸垂", "垂直飛び", "閉眼片足立ち", + "腕歩行", "リラックスボード", "パネルラダー", "棒とびこし", + "脚のばし", "ふみいたストレッチ", +]; +const STANDARD_PLAY_TOKENS = [ + "ブランコ", "ぶらんこ", "滑台", "滑り台", "すべり台", "砂場", "鉄棒", "複合遊具", + "ジャングル", "ヒコーキ", "飛行機", "シーソー", + ...SPRING_TOKENS, + ...HEALTH_TOKENS, +]; +function playSegments(play: string): string[] { + return play.split(/[、,]/).map((s) => s.trim()).filter(Boolean); +} +function hasSpecialToy(play: string): boolean { + return playSegments(play).some( + (segment) => !STANDARD_PLAY_TOKENS.some((token) => segment.includes(token)), + ); +} + // 設備フィルタ用のトークン(data-fac)。 function facTokens(p: Park): string { const tokens: string[] = []; @@ -111,17 +138,27 @@ function facTokens(p: Park): string { if (p["給水"]) tokens.push("water"); if (p["遊具"]) tokens.push("toy"); const play = p["遊具"] || ""; + const segments = playSegments(play); if (play.includes("砂場")) tokens.push("sand"); if (play.includes("ブランコ")) tokens.push("swing"); if (play.includes("シーソー")) tokens.push("seesaw"); - if (play.includes("スプリング")) tokens.push("spring"); + if ( + segments.some( + (segment) => + !segment.includes("ロープスイング") && + SPRING_TOKENS.some((token) => segment.includes(token)), + ) + ) { + tokens.push("spring"); + } if (play.includes("ジャングル")) tokens.push("jungle"); if (play.includes("ヒコーキ") || play.includes("飛行機")) tokens.push("plane"); if (play.includes("滑り台") || play.includes("滑台")) tokens.push("slide"); if (play.includes("複合遊具")) tokens.push("complex"); - if (play.includes("ロープウェイ")) tokens.push("rope"); - const ball = p["ボール遊び"]; - if (ball && ball !== "禁止") tokens.push("ball"); + if (play.includes("バスケ")) tokens.push("basket"); + if ((p["シェルター等"] || "").trim()) tokens.push("shelter"); + if (HEALTH_TOKENS.some((token) => play.includes(token))) tokens.push("health"); + if (hasSpecialToy(play)) tokens.push("special"); const clock = (p["時計"] || "").trim(); if (clock === "○" || clock === "あり" || clock === "有" || clock === "1") tokens.push("clock"); if (p["南西部指定管理"]) tokens.push("cm"); -- cgit v1.3.1