aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/ParksTable.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/ParksTable.astro')
-rw-r--r--src/components/ParksTable.astro45
1 files changed, 41 insertions, 4 deletions
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");