Files
longhikes/web/assets/prefs.js
T
swaitsandClaude Fable 5.2 19fabadd49
Mirror to forge / mirror (push) Canceled after 0s
Validate / validate (push) Canceled after 0s
Validate / site (push) Canceled after 0s
Validate / deploy (push) Canceled after 0s
Put miles and feet first, and give the site a proper mark
Units. Miles and feet now come first everywhere unless the reader
chooses kilometres and metres: paired figures, the time estimate, the
elevation profile, page descriptions and the map scale. The length
filter and the length scale use round mile steps (round kilometre steps
for a reader who chose them). The lists defined by length are now
"Under 100 miles" and "The longest" at 1,000 miles or more; the old
/lists/under-100-km/ address redirects. The records stay metric.

Branding. The tab icon was a bare red blaze that read as a red block;
it is now a mountain with a trail up it, with PNG sizes for browsers
and phones that need them. The home page opens with the mark, the name
and what the site offers. Link previews get a real 1200x630 image:
the old one was an SVG, which Reddit, Slack and iMessage do not draw.

The decorative contour lines now stay inside the content column and
thin out to nothing on every side, where they used to run to the right
edge of a wide window and stop dead at the bottom of the band.

Tests updated for the new trail counts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 20:37:14 -07:00

14 lines
610 B
JavaScript

/* Runs in <head>, before first paint: marks that JavaScript runs, and applies the
reader's saved theme and length order. Saved by app.js (footer switches). */
(function () {
'use strict';
var root = document.documentElement;
root.classList.add('js');
try {
var theme = localStorage.getItem('lh-theme');
var units = localStorage.getItem('lh-units');
if (theme === 'light' || theme === 'dark') root.dataset.theme = theme;
if (units === 'km') root.dataset.units = 'km'; /* anything else, an old 'mi' included, is miles */
} catch (e) { /* storage blocked: defaults apply */ }
})();