aboutsummaryrefslogtreecommitdiff
path: root/docs/prototypes
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-12 20:30:07 -0500
committerCraig Jennings <c@cjennings.net>2026-07-12 20:30:07 -0500
commit482cd5b58625cd5b4831c6703c2d767ee9975d09 (patch)
tree952111b5287c48e890207c8349cd32eaceda5473 /docs/prototypes
parentb55746fffaf114ae7929e4592c0d26778fc794d0 (diff)
downloadarchsetup-482cd5b58625cd5b4831c6703c2d767ee9975d09.tar.gz
archsetup-482cd5b58625cd5b4831c6703c2d767ee9975d09.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.html5
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'];