diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-12 20:30:07 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-12 20:30:07 -0500 |
| commit | 16da33e2902be74696174d47fe926c864f8afd4f (patch) | |
| tree | 952111b5287c48e890207c8349cd32eaceda5473 /docs/prototypes | |
| parent | 01b9e0a0e4bcb6191a50e90df9f61c5275679563 (diff) | |
| download | archsetup-16da33e2902be74696174d47fe926c864f8afd4f.tar.gz archsetup-16da33e2902be74696174d47fe926c864f8afd4f.zip | |
feat(gallery): persist the widget-size choice across refreshes
The S/M/L pick saves to localStorage alongside the validation lamps and restores on load, falling back to the default M when unset or invalid.
Diffstat (limited to 'docs/prototypes')
| -rw-r--r-- | docs/prototypes/panel-widget-gallery.html | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/prototypes/panel-widget-gallery.html b/docs/prototypes/panel-widget-gallery.html index 99342bc..168a50c 100644 --- a/docs/prototypes/panel-widget-gallery.html +++ b/docs/prototypes/panel-widget-gallery.html @@ -692,8 +692,13 @@ const $ = id => document.getElementById(id); const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches; document.querySelectorAll('.szbar .key').forEach(b=>b.addEventListener('click',()=>{ document.body.dataset.size=b.dataset.sz; + localStorage.setItem('gv-size',b.dataset.sz); document.querySelectorAll('.szbar .key').forEach(k=>k.classList.toggle('on',k===b)); })); +(function(){const s=localStorage.getItem('gv-size'); + if(!s||!/^[123]$/.test(s))return; + document.body.dataset.size=s; + document.querySelectorAll('.szbar .key').forEach(k=>k.classList.toggle('on',k.dataset.sz===s));})(); /* boost the intrinsically tiny widgets (audit: content under 10% of the stage) */ const BOOST=['01','07','08','12','13','N14','18']; |
