Put the filters on every list and place page, and count their numbers from the page
The search and filters bar is on every list, place and the Routes page with ten or more trails, scoped to that page's set and closed to start. The number beside each choice is recounted from the page's rows on every change; a choice that would show nothing is hidden; a filter that cannot narrow the page is left out. The open panel sits in the flow and pushes the rows down. Each part of the country has a page of its own, and the links to the home page "with the filters" are gone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
f467fcb560
commit
1ed0a68991
12 files changed
+906
-212
No files matched your search
+39
-29
@@ -989,7 +989,7 @@ html.js .map__status:not([data-say]) { display: none; }
|
||||
.home { padding-block: var(--space-4) var(--space-7); }
|
||||
.finder__notes { display: grid; gap: var(--space-2); margin-block-start: var(--space-6); }
|
||||
.results { container: results / inline-size; }
|
||||
.home__bar { margin-block-end: var(--space-3); }
|
||||
.finder__bar { margin-block-end: var(--space-3); }
|
||||
|
||||
/* Every page that shows a set of trails: the rows, with their map. Wide: the rows on the left, the
|
||||
map on the right, where it stays in view as the rows scroll. Narrow: the map is a short band above
|
||||
@@ -1022,7 +1022,7 @@ html.js .map__status:not([data-say]) { display: none; }
|
||||
}
|
||||
@media (min-width: 56rem) and (pointer: fine) {
|
||||
.browse .results-sort .select { min-block-size: 2.25rem; }
|
||||
.home .filters__bar .input, .home .filters__bar .button { min-block-size: 2.5rem; }
|
||||
.browse .filters__bar .input, .browse .filters__bar .button { min-block-size: 2.5rem; }
|
||||
}
|
||||
.browse--no-map .note { margin-block-start: var(--space-5); max-inline-size: var(--measure); color: var(--ink-2); font: 400 var(--step--1)/1.5 var(--font-sans); }
|
||||
.browse-about { margin-block-start: var(--space-7); padding-block-start: var(--space-4); border-block-start: 1px solid var(--ink); }
|
||||
@@ -1040,34 +1040,28 @@ html.js .map__status:not([data-say]) { display: none; }
|
||||
.filters__toggle[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
|
||||
.filters__toggle .filters__count:not(:empty) { background: var(--paper); color: var(--ink); }
|
||||
.filters__clear[hidden] { display: none; }
|
||||
/* The panels: the existing filter fields, in columns where there is room. With JavaScript they
|
||||
open from the bar; without it the bar and panels are not offered at all (see below). */
|
||||
.filters { position: relative; }
|
||||
/* The panels: the filter fields, in columns where there is room. With JavaScript they open from
|
||||
the bar; without it the bar and panels are not offered at all (see below). Open, they sit in the
|
||||
page between the bar and the rows, and the rows move down: nothing is drawn over a row, and the
|
||||
map beside them shows what the filters leave. */
|
||||
.filters__panels { margin-block-start: var(--space-2); border: 1px solid var(--ink); background: var(--surface); }
|
||||
html.js .filters__panels:not([data-open]) { display: none; }
|
||||
/* Open, the panels lie over the rows below the bar, as a sheet laid on the table: the page does not
|
||||
move, and the map beside them shows what the filters leave. */
|
||||
html.js .filters__panels {
|
||||
position: absolute;
|
||||
z-index: 30;
|
||||
inset-inline: 0;
|
||||
inset-block-start: 100%;
|
||||
max-block-size: min(72svh, 46rem);
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
box-shadow: 6px 6px 0 var(--rule);
|
||||
}
|
||||
.filters__end { position: sticky; inset-block-end: 0; display: flex; justify-content: flex-end; padding: var(--space-3) var(--space-4); border-block-start: 1px solid var(--rule); background: var(--surface); }
|
||||
/* A choice or a filter that would show nothing is put away by app.js with [hidden]; the fields'
|
||||
own display must not bring it back. */
|
||||
.filters [hidden] { display: none !important; }
|
||||
.filters__end .button { min-block-size: 2.5rem; }
|
||||
.filters__none { padding: var(--space-3) var(--space-4) 0; color: var(--ink-2); font: 400 var(--step--1)/1.4 var(--font-sans); }
|
||||
.filters__end { position: sticky; inset-block-end: 0; display: flex; justify-content: flex-end; padding: var(--space-2) var(--space-4); border-block-start: 1px solid var(--rule); background: var(--surface); }
|
||||
.filters__panel > summary { display: none; }
|
||||
.filters__more { border-block-start: 1px solid var(--rule); }
|
||||
.filters__more > summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-2) var(--space-4);
|
||||
min-block-size: 2.75rem;
|
||||
background: var(--ink);
|
||||
color: var(--paper);
|
||||
font: 600 var(--step--1)/1.3 var(--font-sans);
|
||||
padding: var(--space-1) var(--space-4);
|
||||
min-block-size: 2.5rem;
|
||||
color: var(--ink);
|
||||
font: 600 var(--step--2)/1.3 var(--font-sans);
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
@@ -1084,23 +1078,33 @@ html.js .filters__panels {
|
||||
transform: translateY(-25%) rotate(45deg);
|
||||
}
|
||||
.filters__more[open] > summary::after { transform: translateY(25%) rotate(-135deg); }
|
||||
.filters__more > summary:focus-visible { outline-offset: -5px; outline-color: var(--paper); }
|
||||
.filters__more > summary:hover { background: var(--sunken); }
|
||||
.filters__more > summary:focus-visible { outline-offset: -3px; }
|
||||
.filters__active:not(:empty) {
|
||||
padding: 0 var(--space-2);
|
||||
border-radius: 999px;
|
||||
background: var(--paper);
|
||||
color: var(--ink);
|
||||
background: var(--ink);
|
||||
color: var(--paper);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: none;
|
||||
}
|
||||
/* The fields run in as many columns as the panel has room for. */
|
||||
/* The fields run in as many columns as the panel has room for; a field of choices laid out as
|
||||
pills (Time, Terrain) takes the whole width, so its pills run across in a line or two rather
|
||||
than down one column. Kept tight, so that the first rows are still in view under the open panel
|
||||
where the window allows. */
|
||||
.filters__first, .filters__form {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
|
||||
gap: var(--space-4) var(--space-5);
|
||||
padding: var(--space-4);
|
||||
gap: var(--space-3) var(--space-5);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
.filters__first > .field--wide { grid-column: 1 / -1; }
|
||||
.filters .field { gap: var(--space-1); }
|
||||
.filters .field legend { margin-block-end: var(--space-1); }
|
||||
.filters .pills { gap: var(--space-1) var(--space-2); }
|
||||
.filters .pills .check__text { font-size: var(--step--1); }
|
||||
.filters .field__hint { font-size: var(--step--2); }
|
||||
|
||||
.field { display: grid; align-content: start; gap: var(--space-2); min-inline-size: 0; margin: 0; padding: 0; border: 0; }
|
||||
.field__label, .field legend {
|
||||
@@ -1177,6 +1181,12 @@ html.js .filters__panels {
|
||||
.results-tools { flex-basis: 100%; }
|
||||
.results-sort { flex: 1 1 100%; }
|
||||
.results-sort .select { flex: 1 1 auto; }
|
||||
/* Under a filter bar the count and the sort share one line: the bar costs little height. */
|
||||
.results[data-finder] .results-head { flex-wrap: nowrap; align-items: center; }
|
||||
.results[data-finder] .results-tools { flex: 0 1 auto; flex-basis: auto; }
|
||||
.results[data-finder] .results-sort { flex: 0 1 auto; }
|
||||
.results[data-finder] .results-sort__label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
||||
.results[data-finder] .results-count { flex: none; }
|
||||
}
|
||||
.key {
|
||||
display: flex;
|
||||
|
||||
Reference in new issue
Block a user