Compare commits

...
2 Commits
2 changed files with 99 additions and 20 deletions

No files matched your search

+66 -15
View File
@@ -769,9 +769,13 @@ body.side-pinned:has(.basemap-panel:not([hidden]), .gpx-panel:not([hidden])) .pr
border-radius: 4px;
}
/* Finger-sized (44 px, see the panel rule at the end) with the text in
the middle, not at the top of an otherwise empty row; a summary stays
display: list-item for its disclosure triangle. */
.offline-data-panel__continent > summary,
.offline-data-panel__subregions > summary {
padding: 6px 8px;
box-sizing: border-box;
padding: 12px 8px;
cursor: pointer;
}
@@ -791,7 +795,11 @@ body.side-pinned:has(.basemap-panel:not([hidden]), .gpx-panel:not([hidden])) .pr
border-left: 2px solid #eee;
}
.offline-data-panel__subregions > summary {
/* Second-level, so smaller than the 44 px rows (and more specific than
that rule at the end). */
.offline-data-panel__region-list .offline-data-panel__subregions > summary {
min-height: 32px;
padding: 8px 8px;
color: #666;
font-size: 12px;
}
@@ -2567,16 +2575,22 @@ body.side-pinned:has(.basemap-panel:not([hidden]), .gpx-panel:not([hidden])) .pr
padding: 0;
}
/* Name (wraps), the whole Run button, the status on a line of its own. */
.plugins-panel__item {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
padding: 4px 0;
white-space: nowrap;
gap: 4px 8px;
padding: 8px 0;
}
.plugins-panel__item + .plugins-panel__item {
box-shadow: inset 0 1px #e6e6e6;
}
.plugins-panel__label {
flex: 1;
min-width: 0;
}
.plugins-panel__run {
@@ -2591,6 +2605,8 @@ body.side-pinned:has(.basemap-panel:not([hidden]), .gpx-panel:not([hidden])) .pr
color: #fff;
font: inherit;
font-size: 12px;
white-space: nowrap;
flex-shrink: 0;
cursor: pointer;
}
@@ -2600,14 +2616,13 @@ body.side-pinned:has(.basemap-panel:not([hidden]), .gpx-panel:not([hidden])) .pr
}
.plugins-panel__status {
min-width: 3.5em;
max-width: 200px;
flex-basis: 100%;
color: #888;
font-size: 11px;
/* Overrides the parent's nowrap: "Running…"/"Done" never wrap either
way, but a real RunError message (e.g. "plugin exited with status 1")
needs to, or it just overflows the panel unreadably. */
white-space: normal;
}
.plugins-panel__status:empty {
display: none;
}
.plugins-panel__status--error {
@@ -3205,12 +3220,13 @@ html.night .maplibregl-marker {
flex-shrink: 0;
}
/* List dividers as in OsmAnd: a hairline between rows (an inset shadow,
so the 44 px rows don't grow) and each section heading on a gray band, so it's
/* List dividers as in OsmAnd: a hairline between sibling rows (an inset
shadow, so the 44 px rows don't grow) — a folder's line comes after
its contents, not under its own name — and each section heading on a
gray band, so it's
clear what belongs together, not just text spaced apart. */
.overlays-panel__item + .overlays-panel__item,
.gpx-tree__file,
.gpx-tree__point + .gpx-tree__point,
.gpx-tree li + li,
.sidebar-flyout__option + .sidebar-flyout__option,
.gpx-tree__download-menu-item + .gpx-tree__download-menu-item {
box-shadow: inset 0 1px #e6e6e6;
@@ -3233,3 +3249,38 @@ html.night .maplibregl-marker {
margin-top: -8px;
border-top: none;
}
/* Panel headers: one row of equal, finger-sized icon buttons (actions,
export menu, pin, close) in one color, the title cut short rather than
wrapped. */
:is(.gpx-panel__header, .basemap-panel__header) {
gap: 4px;
padding: 2px 4px 2px 12px;
}
:is(.gpx-panel__header, .basemap-panel__header) > strong {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.gpx-panel__actions {
gap: 0;
}
:is(.gpx-panel__header, .basemap-panel__header) :is(.gpx-panel__action, .gpx-panel__close, .basemap-panel__close, .side-panel-pin, .gpx-tree__download) {
width: 40px;
min-width: 40px;
height: 44px;
margin: 0;
padding: 0;
display: inline-flex;
align-items: center;
justify-content: center;
color: #444;
}
.gpx-panel__action[hidden] {
display: none;
}
+33 -5
View File
@@ -15,7 +15,10 @@
h1 { font-size: 1.2rem; margin: 0 0 4px; }
p { margin: 0 0 8px; color: var(--muted); font-size: 0.85rem; }
input { width: 100%; max-width: 420px; box-sizing: border-box; padding: 8px; font-size: 1rem; }
main { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
main section { margin-bottom: 16px; }
main section[hidden] { display: none; }
main h3 { margin: 0 0 6px; font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
button { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.75rem; text-align: center; word-break: break-word; }
button:hover, button:focus-visible { background: var(--hover); }
button[hidden] { display: none; }
@@ -50,6 +53,29 @@
import { POI_ICONS } from "/js/icons.js";
const main = document.querySelector("main");
// The NPS library has no categories of its own: sorted by name, first
// match wins (order matters: "bear-spray" is safety before wildlife,
// "waterskiing" water before winter, "ice-cream" food before winter).
// ponytail: name patterns; a new symbol lands in Other until one fits.
const CATEGORIES = [
["Safety & rules", /safety|stay-back|falling|slippery|uneven|rattlesnake|tornado|incident|emergenc|first-aid|^aed|hospital|fire-extinguisher|life-jackets|lifeguard|bear-spray|^quiet|silence|no-mobile|smoking|pets-|stay-on-trail|caution/],
["Accessibility", /assistive|audio-description|braille|caption|large-print|low-vision|sign-language|tactile|wheelchair|text-telephone|volume-control|hand-rail|elevator|strollers/],
["Water", /boat|canoe|kayak|raft|swim|beach|fish|diving|scuba|snorkel|surf|wading|tubing|sail|marina|waterski|watercraft|pedal|rowboat|airboat|buoy|^lock$|^dam$|mussel|aquatic|tidepool|shipwreck|waterfowl/],
["Camping & lodging", /camp|cabin|lodging|shelter|^rv-|trailer-site|hookup|firewood|fire-grate|bear-box|bear-canister|food-storage|generator|ash-disposal|wood-gathering|picnic|grill/],
["Food & shopping", /food|coffee|ice-cream|snack|table-service|vending|wine|alcohol|^store$|bookstore|shop|supplies|rental|^bottles|cans/],
["Winter", /ski|snow|sled|^ice|winter/],
["Trails & activities", /trail|walk|climb|caving|horse|stable|bicycle|bike|motorbike|^utv|archery|golf|tennis|volleyball|baseball|skate|inline|exercise|gliding|hunting|metal-detect|rock-collect|foraging|stagecoach|playground|dog-sled/],
["Transportation & vehicles", /parking|bus-stop|rail|metro|air(port|field)|seaplane|ferry|shuttle|tram|road|four-wheel|bridge|tunnel|rr-xing|crossing|automobiles|trucks|gas-station|diesel|electric-car|propane|mechanic|towing|radiator|dump-station|sanitary|sewer|gate|entrance/],
["Nature & sights", /view|lookout|waterfall|geyser|spring|flower|stargaz|birding|wilderness|historic|monument|statue|museum|cemetery|cannon|chapel|windmill|point-of-interest|lighthouse|photography|sunny/],
["Programs & events", /ranger-led|junior|guided|tour|program|park-film|theat|amphitheater|calendar|event|^art$|interpretive|passport|things-to-do|scientist/],
["Services", /./],
];
const sections = new Map(CATEGORIES.map(([name]) => {
const section = document.createElement("section");
section.innerHTML = `<h3>${name}</h3><div class="grid"></div>`;
main.append(section);
return [name, section.querySelector(".grid")];
}));
const aliases = {}; // svg -> OsmAnd names pointing at it
for (const [key, svg] of Object.entries(POI_ICONS)) if (key.includes("_")) (aliases[svg] ||= []).push(key);
for (const [key, svg] of Object.entries(POI_ICONS)) {
@@ -60,17 +86,19 @@
for (const alias of aliases[svg] || []) button.append(Object.assign(document.createElement("small"), { textContent: alias }));
button.dataset.search = [key, ...(aliases[svg] || [])].join(" ").replace(/[-_]/g, " ");
button.addEventListener("click", () => navigator.clipboard?.writeText(key));
main.append(button);
sections.get(CATEGORIES.find(([, pattern]) => pattern.test(key))[0]).append(button);
}
const buttons = [...main.querySelectorAll("button")];
const count = document.querySelector(".count");
const showCount = () => {
const shown = [...main.children].filter((b) => !b.hidden).length;
count.textContent = shown === main.children.length ? `(${shown})` : `(${shown} of ${main.children.length})`;
const shown = buttons.filter((b) => !b.hidden).length;
count.textContent = shown === buttons.length ? `(${shown})` : `(${shown} of ${buttons.length})`;
for (const grid of sections.values()) grid.parentElement.hidden = ![...grid.children].some((b) => !b.hidden);
};
showCount();
document.querySelector("input").addEventListener("input", (event) => {
const words = event.target.value.toLowerCase().split(/\s+/).filter(Boolean);
for (const button of main.children) button.hidden = !words.every((w) => button.dataset.search.includes(w));
for (const button of buttons) button.hidden = !words.every((w) => button.dataset.search.includes(w));
showCount();
});
</script>