1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
|
---
// 公園・公共施設の一覧を絞り込むコントロール。地図の上に表示する。
// 実際の絞り込みは ParksTable.astro のスクリプトが行う。
import { parks, towns, total } from "@/data/parks-rows";
import { PARK_ICONS } from "@/data/park-icons";
const facilityTypes = [
"図書館",
"公民館",
"児童館",
"地域センター",
"市役所支所",
"文化施設",
].filter((type) =>
parks.some((p) => p["施設"] === "1" && p["種別"] === type),
);
---
<div class="parks-controls" data-parks-filters>
<label>
<span>種類</span>
<select data-parks-kind>
<option value="">すべて</option>
<option value="park">公園</option>
{facilityTypes.map((type) => (
<option value={type}>{type}</option>
))}
</select>
</label>
<label>
<span>町名</span>
<select data-parks-town>
<option value="">すべての町名</option>
{towns.map((town) => (
<option value={town}>{town}</option>
))}
</select>
</label>
<label>
<span>キーワード</span>
<span class="parks-search-wrap">
<input type="search" data-parks-search placeholder="名称・住所・設備など" />
<button
type="button"
class="parks-search-clear"
data-parks-search-clear
aria-label="キーワードを削除"
title="キーワードを削除"
hidden>×</button>
</span>
</label>
<label class="parks-unconfirmed-filter" title="名称・住所などが未確認の公園だけを表示">
<input type="checkbox" data-parks-unconfirmed />
未確認のみ
</label>
<label
title="公園ポリゴンのハイライト配色を選べます(標準:黄・緑 / 強調:黄・紫と黒フチ / 色覚配慮:青・橙)"
>
<span>ハイライト</span>
<select data-park-theme-select aria-label="公園ポリゴンのハイライト配色">
<option value="standard">標準</option>
<option value="strong">強調</option>
<option value="cvd">色覚配慮</option>
</select>
</label>
<fieldset class="parks-facilities">
<legend>設備・遊具で絞る</legend>
<div class="fac-group">
<span class="fac-group-title">遊具</span>
<div class="fac-group-items">
<label>
<input type="checkbox" data-fac-filter value="sand" />
<span class="filter-icon" set:html={PARK_ICONS.sand.svg} />砂場
</label>
<label>
<input type="checkbox" data-fac-filter value="swing" />
<span class="filter-icon" set:html={PARK_ICONS.swing.svg} />ブランコ
</label>
<label>
<input type="checkbox" data-fac-filter value="seesaw" />
<span class="filter-icon" set:html={PARK_ICONS.teeter.svg} />シーソー
</label>
<label>
<input type="checkbox" data-fac-filter value="spring" />
<span class="filter-icon" set:html={PARK_ICONS.spring.svg} />スイング遊具
</label>
<label>
<input type="checkbox" data-fac-filter value="toddler" />
<span class="filter-icon" set:html={PARK_ICONS.duck.svg} />幼児用遊具
</label>
<label>
<input type="checkbox" data-fac-filter value="jungle" />
<span class="filter-icon" set:html={PARK_ICONS.climbing.svg} />ジャングルジム
</label>
<label>
<input type="checkbox" data-fac-filter value="plane" />
<span class="filter-icon" set:html={PARK_ICONS.airplane.svg} />ヒコーキ
</label>
<label>
<input type="checkbox" data-fac-filter value="slide" />
<span class="filter-icon" set:html={PARK_ICONS.slide.svg} />滑り台
</label>
<label>
<input type="checkbox" data-fac-filter value="complex" />
<span class="filter-icon" set:html={PARK_ICONS.playground.svg} />複合遊具
</label>
<label><input type="checkbox" data-fac-filter value="basket" />🏀バスケゴール</label>
<label><input type="checkbox" data-fac-filter value="health" /><span class="filter-icon" set:html={PARK_ICONS.health.svg} />健康遊具</label>
<label><input type="checkbox" data-fac-filter value="special" /><span class="filter-icon" set:html={PARK_ICONS.special.svg} />特殊遊具</label>
</div>
</div>
<div class="fac-group">
<span class="fac-group-title">広場・休憩</span>
<div class="fac-group-items">
<label>
<input type="checkbox" data-fac-filter value="picnic" />
<span class="filter-icon filter-icon-grass" set:html={PARK_ICONS.grass.svg} />草地広場
</label>
<label>
<input type="checkbox" data-fac-filter value="table" />
<span class="filter-icon" set:html={PARK_ICONS.picnic.svg} />野外卓/縁台
</label>
<label><input type="checkbox" data-fac-filter value="shelter" /><span class="filter-icon" set:html={PARK_ICONS.shelter.svg} />東屋/シェルター</label>
<label><input type="checkbox" data-fac-filter value="pergola" /><span class="filter-icon" set:html={PARK_ICONS.pergola.svg} />パーゴラ</label>
</div>
</div>
<div class="fac-group">
<span class="fac-group-title">設備</span>
<div class="fac-group-items">
<label><input type="checkbox" data-fac-filter value="toilet" /><span class="filter-wc" aria-hidden="true">WC</span>トイレ</label>
<label><input type="checkbox" data-fac-filter value="water" /><span class="filter-icon filter-icon-water" set:html={PARK_ICONS.water.svg} />水飲み</label>
<label><input type="checkbox" data-fac-filter value="clock" /><span class="filter-icon filter-icon-clock" set:html={PARK_ICONS.clock.svg} />時計</label>
</div>
</div>
<div class="fac-group">
<span class="fac-group-title">利用ルール</span>
<div class="fac-group-items">
<label><input type="checkbox" data-fac-filter value="ballok" /><span class="filter-icon" set:html={PARK_ICONS.ball.svg} />ボール遊び禁止の表示なし</label>
<label><input type="checkbox" data-fac-filter value="dogok" /><span class="filter-icon" set:html={PARK_ICONS.dog.svg} />犬禁止の表示なし</label>
<span class="fac-note">利用ルールは実際と異なる場合があります。現地の看板などでご確認ください。</span>
</div>
</div>
</fieldset>
<label class="parks-fire-toggle" title="消火栓・防火水槽を地図に表示する">
<input type="checkbox" data-show-fire />
消火栓・防火水槽
</label>
<span class="parks-count" data-parks-count aria-live="polite">{total}件</span>
</div>
<p class="parks-disclaimer">
現在β版のテスト中です。情報に誤りが含まれている可能性があります(特に利用ルール)。最新の情報は各施設の公式ページや現地の表示でご確認ください。遊具・設備などの一部のアイコンは、地図を拡大すると表示されます。
</p>
<style>
.parks-controls {
display: flex;
flex-wrap: wrap;
gap: 0.5rem 0.9rem;
align-items: center;
margin: 0 0 0.55rem;
}
/* Starlight の "* + *" の上下マージンが flex 行内で上下ズレを起こすため打ち消す */
.parks-controls > * {
margin: 0;
}
.parks-controls label {
display: inline-flex;
align-items: center;
gap: 0.4rem;
min-height: 2.1rem;
font-size: 0.9rem;
line-height: 1.2;
}
.parks-controls label > span {
line-height: 1.2;
}
.parks-controls select,
.parks-controls input[type="search"] {
height: 2.1rem;
box-sizing: border-box;
padding: 0.25rem 0.5rem;
border: 1px solid var(--sl-color-hairline, #ccc);
border-radius: 0.3rem;
background: var(--sl-color-bg, #fff);
color: var(--sl-color-text, inherit);
font: inherit;
line-height: 1.2;
}
.parks-facilities {
display: flex;
flex-wrap: wrap;
gap: 0.1rem 0.6rem;
align-items: center;
margin: 0;
padding: 0.2rem 0.5rem;
border: 1px solid var(--sl-color-hairline, #ccc);
border-radius: 0.3rem;
}
/* フィルタを「遊具 / 広場・休憩 / 設備 / 利用ルール」にまとまりで見せる */
.fac-group {
display: flex;
flex: 1 0 100%;
align-items: flex-start;
gap: 0.45rem;
}
.fac-group-title {
flex: none;
width: 4rem;
font-size: 0.72rem;
font-weight: 700;
line-height: 1.5rem;
color: var(--sl-color-gray-2, #64748b);
text-align: right;
}
.fac-group-items {
display: flex;
flex: 1 1 auto;
flex-wrap: wrap;
align-items: center;
gap: 0 0.6rem;
}
/* グループの注記(利用ルールの但し書きなど) */
.fac-note {
flex: 1 0 100%;
padding-top: 0.1rem;
font-size: 0.72rem;
line-height: 1.35;
color: var(--sl-color-gray-2, #64748b);
}
@media (max-width: 700px) {
.fac-group {
flex-direction: column;
align-items: stretch;
gap: 0.1rem;
}
.fac-group-title {
width: auto;
line-height: 1.2;
text-align: left;
}
}
.parks-facilities legend {
padding: 0 0.2rem;
font-size: 0.78em;
color: inherit;
opacity: 0.7;
}
.parks-facilities label {
display: inline-flex;
align-items: center;
gap: 0.2rem;
min-height: 1.5rem;
/* Starlight の「label + label」の上マージンで位置がずれ、縦も伸びるため打ち消す */
margin: 0;
font-size: 0.8rem;
line-height: 1.2;
}
.parks-facilities input[type="checkbox"] {
width: 0.9em;
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;
height: 18px;
flex: none;
}
.filter-icon-grass {
color: #2e7d32;
}
.filter-icon-water {
color: #0277bd;
}
.filter-icon-clock {
color: #f9a825;
}
.filter-wc {
display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 14px;
flex: none;
border-radius: 3px;
background: #455a64;
color: #fff;
font-size: 8px;
font-weight: 700;
line-height: 1;
}
.filter-icon :global(svg) {
display: block;
width: 100%;
height: 100%;
}
.parks-count {
margin-left: auto;
font-size: 0.9rem;
opacity: 0.75;
}
.parks-search-wrap {
position: relative;
display: inline-flex;
align-items: center;
}
.parks-search-wrap input[type="search"] {
padding-right: 1.9rem;
}
.parks-search-clear {
position: absolute;
right: 0.3rem;
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.4rem;
height: 1.4rem;
padding: 0;
border: 0;
border-radius: 50%;
background: transparent;
color: inherit;
font-size: 1rem;
line-height: 1;
cursor: pointer;
}
.parks-search-clear:hover {
background: var(--sl-color-gray-5, #e2e8f0);
}
.parks-search-clear[hidden] {
display: none;
}
.parks-disclaimer {
margin: 0 0 0.55rem;
color: var(--sl-color-gray-2);
font-size: 0.78rem;
}
</style>
|