moey-ui 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/moey.min.js CHANGED
@@ -1,5 +1,5 @@
1
- /*! Moey v0.2.0 | MIT License */
2
- /*! Moey v0.2.0 | MIT License */
1
+ /*! Moey v0.3.0 | MIT License */
2
+ /*! Moey v0.3.0 | MIT License */
3
3
 
4
4
  (()=>{
5
5
  'use strict';
@@ -534,8 +534,8 @@ if(!menu)return;
534
534
  setupMenu(menu,trigger);
535
535
  if(isOpen(menu)||!emit(menu,'open',{trigger}))return;
536
536
  menuState.set(menu,{trigger,point});
537
- try{menu.showPopover({source:trigger});}catch{menu.showPopover();}
538
537
  const asSheet=!isSubmenu(menu)&&adaptAs(menu,trigger,menu.getAttribute('aria-label')||(trigger&&(trigger.getAttribute('aria-label')||trigger.textContent.replace(/\s+/g,' ').trim())));
538
+ try{menu.showPopover({source:trigger});}catch{menu.showPopover();}
539
539
  if(!asSheet){menu.classList.remove('is-sheet');placeMenu(menu);}
540
540
  trigger?.setAttribute('aria-expanded','true');
541
541
  const list=items(menu);
@@ -1255,6 +1255,12 @@ if(link.target)copy.target=link.target;
1255
1255
  }else copy.type='button';
1256
1256
  copy.innerHTML=`<span class="menu-item-label">${link.innerHTML}</span>`;
1257
1257
  copy.querySelectorAll('[id]').forEach((n)=>n.removeAttribute('id'));
1258
+ const lab=copy.firstElementChild;
1259
+ const lead=[...lab.childNodes].find((n)=>n.nodeType!==3||n.textContent.trim());
1260
+ if(lead&&lead.nodeType===1&&lead.matches('.mi, svg')){
1261
+ copy.prepend(lead);
1262
+ lab.innerHTML=lab.innerHTML.trim();
1263
+ }
1258
1264
  if(link.matches(':disabled, .disabled, [aria-disabled="true"]'))copy.setAttribute('aria-disabled','true');
1259
1265
  if(copy.tagName==='BUTTON'||st.tabs)copy.addEventListener('click',(e)=>{e.preventDefault();link.click();requestAnimationFrame(()=>navFit(st));});
1260
1266
  menu.append(copy);
@@ -2419,6 +2425,7 @@ function selOpen(sel){
2419
2425
  const st=selState.get(sel);
2420
2426
  if(sel.disabled||st.menu.matches(':popover-open'))return;
2421
2427
  selBuildMenu(sel);
2428
+ adaptAs(st.menu,st.btn,sheetTitle(sel));
2422
2429
  st.menu.showPopover();
2423
2430
  st.btn.setAttribute('aria-expanded','true');
2424
2431
  st.search=st.menu.querySelector('.select-search input');
@@ -2427,7 +2434,6 @@ st.search.setAttribute('role','combobox');
2427
2434
  st.search.setAttribute('aria-controls',st.menu.id);
2428
2435
  st.search.setAttribute('aria-expanded','true');
2429
2436
  }
2430
- adaptAs(st.menu,st.btn,sheetTitle(sel));
2431
2437
  selPlace(sel);
2432
2438
  const current=selItems(st).find((i)=>i.getAttribute('aria-selected')==='true'&&i.getAttribute('aria-disabled')!=='true')||selEnabled(st)[0];
2433
2439
  selSetActive(sel,current);
@@ -3658,6 +3664,14 @@ scroll.addEventListener('scroll',again,{passive:true});
3658
3664
  new ResizeObserver(()=>{st.winDirty=true;again();}).observe(scroll);
3659
3665
  }
3660
3666
  dtHead(st);
3667
+ const measure=()=>{
3668
+ const head=table.tHead,first=head?.rows[0]?.cells[0];
3669
+ if(!head||!head.offsetParent)return;
3670
+ root.style.setProperty('--mo-datatable-head',`${head.getBoundingClientRect().height}px`);
3671
+ if(first)root.style.setProperty('--mo-datatable-first',`${first.getBoundingClientRect().width}px`);
3672
+ };
3673
+ new ResizeObserver(measure).observe(table.tHead);
3674
+ new ResizeObserver(measure).observe(table);
3661
3675
  dtFillFilters(st);
3662
3676
  dtStates.set(root,st);
3663
3677
  st.url||st.fetcher?dtLoad(st):dtRender(st);
@@ -4790,8 +4804,8 @@ st.view=dpMonth(f);
4790
4804
  st.mode='days';
4791
4805
  st.picking=false;
4792
4806
  st.hover=null;
4793
- st.pop.showPopover();
4794
4807
  adaptAs(st.pop,st.btn,sheetTitle(st.range?st.host:st.inputs[0]));
4808
+ st.pop.showPopover();
4795
4809
  st.btn.setAttribute('aria-expanded','true');
4796
4810
  dpRender(st,{focus:true});
4797
4811
  }
@@ -7224,8 +7238,9 @@ function tpOpen(st){
7224
7238
  if(st.field.disabled||st.menu.matches(':popover-open'))return;
7225
7239
  tpRender(st);
7226
7240
  menuState.set(st.menu,{trigger:st.wrap});
7241
+ const asSheet=adaptAs(st.menu,st.field,sheetTitle(st.input)||'Time');
7227
7242
  st.menu.showPopover();
7228
- if(!adaptAs(st.menu,st.field,sheetTitle(st.input)||'Time'))placeMenu(st.menu);
7243
+ if(!asSheet)placeMenu(st.menu);
7229
7244
  st.field.setAttribute('aria-expanded','true');
7230
7245
  tpActive(st,st.active);
7231
7246
  }
@@ -7942,6 +7957,7 @@ new MutationObserver((muts)=>{for(const m of muts)for(const n of m.addedNodes)if
7942
7957
  };
7943
7958
  const msStates=new WeakMap();
7944
7959
  const MS_NATIVE=CSS.supports?.('grid-template-rows','masonry');
7960
+ const GRIDDY='[data-moey-griddy], [data-moey-masonry]';
7945
7961
  const msHeight=(it)=>{
7946
7962
  const c=getComputedStyle(it),px=(v)=>parseFloat(v)||0;
7947
7963
  const box=c.boxSizing==='border-box'?0:px(c.paddingTop)+px(c.paddingBottom)+px(c.borderTopWidth)+px(c.borderBottomWidth);
@@ -7955,7 +7971,7 @@ return c.gridColumnEnd==='-1'?n:1;
7955
7971
  function msLayout(st){
7956
7972
  const{el}=st;
7957
7973
  if(MS_NATIVE)return;
7958
- el.classList.add('is-ready');
7974
+ if(!el.classList.contains('is-ready'))el.classList.add('is-ready');
7959
7975
  const cs=getComputedStyle(el);
7960
7976
  const tracks=(cs.gridTemplateColumns.match(/[\d.]+px/g)||[]).map(parseFloat);
7961
7977
  const n=Math.max(1,tracks.length),colGap=parseFloat(cs.columnGap)||0,rowGap=parseFloat(cs.rowGap)||0;
@@ -7963,7 +7979,10 @@ if(!tracks.length)tracks.push(el.clientWidth);
7963
7979
  const xs=tracks.map((_,i)=>tracks.slice(0,i).reduce((a,b)=>a+b,0)+colGap*i);
7964
7980
  const dense=/dense/.test(cs.gridAutoFlow);
7965
7981
  const padStart=parseFloat(cs.paddingInlineStart)||0,padTop=parseFloat(cs.paddingTop)||0;
7966
- const items=[...el.children].filter((it)=>!it.hidden&&getComputedStyle(it).display!=='none');
7982
+ const all=[...el.children],items=all.filter((it)=>!it.hidden&&getComputedStyle(it).display!=='none');
7983
+ all.forEach((it)=>{if(!items.includes(it))st.placed.delete(it);});
7984
+ const fresh=items.filter((it)=>!st.placed.has(it));
7985
+ fresh.forEach((it)=>{st.placed.add(it);it.style.transition='none';});
7967
7986
  const spans=items.map((it)=>{
7968
7987
  const k=msSpan(it,n);
7969
7988
  it.style.width=`${tracks.slice(0,k).reduce((a,b)=>a+b,0)+colGap*(k-1)}px`;
@@ -7990,24 +8009,32 @@ it.style.top=`${y+padTop}px`;
7990
8009
  const content=items.length?Math.max(...cols)-rowGap:0;
7991
8010
  const extra=cs.boxSizing==='border-box'?(parseFloat(cs.paddingTop)||0)+(parseFloat(cs.paddingBottom)||0)+(parseFloat(cs.borderTopWidth)||0)+(parseFloat(cs.borderBottomWidth)||0):0;
7992
8011
  el.style.height=`${Math.max(0,content)+extra}px`;
8012
+ if(fresh.length){void el.offsetWidth;fresh.forEach((it)=>{it.style.transition='';});}
7993
8013
  }
7994
- function setupMasonry(el){
8014
+ function setupGriddy(el){
7995
8015
  if(msStates.has(el))return msStates.get(el).api;
7996
- el.classList.add('masonry');
7997
- const st={el,raf:0};
8016
+ el.classList.add('griddy');
8017
+ const st={el,raf:0,placed:new WeakSet()};
7998
8018
  const again=()=>{if(!st.raf)st.raf=requestAnimationFrame(()=>{st.raf=0;msLayout(st);});};
7999
8019
  st.ro=new ResizeObserver(again);
8000
8020
  const watch=(it)=>{st.ro.observe(it);it.querySelectorAll('img').forEach((img)=>{if(!img.complete)img.addEventListener('load',again,{once:true});});};
8001
8021
  st.ro.observe(el);
8002
8022
  [...el.children].forEach(watch);
8003
- new MutationObserver((muts)=>{muts.forEach((m)=>m.addedNodes.forEach((n)=>{if(n.nodeType===1&&n.parentElement===el)watch(n);}));msLayout(st);})
8004
- .observe(el,{childList:true,attributes:true,subtree:true,attributeFilter:['hidden']});
8023
+ doc.fonts?.ready.then(again);
8024
+ new MutationObserver((muts)=>{
8025
+ let redo=false;
8026
+ muts.forEach((m)=>{
8027
+ m.addedNodes.forEach((n)=>{if(n.nodeType===1&&n.parentElement===el)watch(n);});
8028
+ if(m.type==='childList'||m.attributeName==='hidden'||m.target===el||m.target.parentElement===el)redo=true;
8029
+ });
8030
+ if(redo)msLayout(st);
8031
+ }).observe(el,{childList:true,attributes:true,subtree:true,attributeFilter:['hidden','class']});
8005
8032
  st.api={el,layout:()=>msLayout(st)};
8006
8033
  msStates.set(el,st);
8007
8034
  msLayout(st);
8008
8035
  return st.api;
8009
8036
  }
8010
- const masonry=(el)=>{el=typeof el==='string'?doc.querySelector(el):el;return el?setupMasonry(el):null;};
8037
+ const griddy=(el)=>{el=typeof el==='string'?doc.querySelector(el):el;return el?setupGriddy(el):null;};
8011
8038
  const flStates=new WeakMap();
8012
8039
  function flState(box){
8013
8040
  if(!flStates.has(box))flStates.set(box,{box,tags:new Set(),query:'',sort:null,dir:1});
@@ -8075,42 +8102,55 @@ const filter=(box,o={})=>{box=typeof box==='string'?doc.querySelector(box):box;i
8075
8102
  const ifStates=new WeakMap();
8076
8103
  function setupInfinite(box){
8077
8104
  if(ifStates.has(box))return ifStates.get(box).api;
8078
- const st={box,loads:0,busy:false,ended:false,auto:box.dataset.moeyInfinite==='button'?0:+(box.dataset.moeyInfiniteAuto??3)};
8105
+ const mode=box.dataset.moeyInfinite;
8106
+ const autoN=()=>{const v=box.dataset.moeyInfiniteAuto;return v==='all'?Infinity:Math.max(0,+(v??3)||0);};
8107
+ const st={box,loads:0,busy:false,ended:false,viaButton:false,auto:mode==='button'||mode==='once'?0:autoN()};
8079
8108
  const status=Object.assign(doc.createElement('div'),{className:'infinite-status'});
8080
8109
  status.setAttribute('role','status');
8081
- status.innerHTML='<span class="spinner spinner-sm" hidden></span><span class="infinite-text"></span><button type="button" class="btn btn-sm infinite-more" hidden>Load more</button>';
8110
+ status.innerHTML='<span class="spinner spinner-sm" hidden></span><span class="infinite-text"></span><button type="button" class="btn btn-sm infinite-more" hidden></button>';
8082
8111
  box.after(status);
8083
8112
  const sentinel=Object.assign(doc.createElement('div'),{className:'infinite-sentinel'});
8084
8113
  sentinel.setAttribute('aria-hidden','true');
8085
8114
  status.after(sentinel);
8086
8115
  const text=status.querySelector('.infinite-text'),spin=status.querySelector('.spinner'),more=status.querySelector('.infinite-more');
8116
+ const label=box.dataset.moeyInfiniteMore||'Load more';
8087
8117
  const sync=()=>{
8088
- spin.hidden=!st.busy;
8089
- more.hidden=st.busy||st.ended||st.loads<st.auto;
8090
- text.textContent=st.ended?(box.dataset.moeyInfiniteEnd||"That's everything"):st.busy?'Loading…':'';
8091
- };
8092
- const load=()=>{
8118
+ const inButton=st.busy&&st.viaButton;
8119
+ spin.hidden=!st.busy||inButton;
8120
+ more.hidden=!inButton&&(st.busy||st.ended||st.loads<st.auto);
8121
+ more.disabled=inButton;
8122
+ more.toggleAttribute('aria-busy',inButton);
8123
+ more.innerHTML=inButton?'<span class="spinner spinner-sm" aria-hidden="true"></span>Loading…':'';
8124
+ if(!inButton)more.textContent=label;
8125
+ text.textContent=st.ended?(box.dataset.moeyInfiniteEnd||"That's everything"):st.busy&&!inButton?'Loading…':'';
8126
+ };
8127
+ const load=(viaButton=false)=>{
8093
8128
  if(st.busy||st.ended)return;
8094
- st.busy=true;sync();
8129
+ st.busy=true;st.viaButton=viaButton;sync();
8095
8130
  const count=flItems(box).length;
8096
8131
  const waits=[];
8097
8132
  let ended=false;
8098
8133
  emit(box,'load',{page:st.loads+1,waitUntil:(p)=>waits.push(Promise.resolve(p)),done:()=>{ended=true;}});
8099
8134
  (waits.length?Promise.allSettled(waits):Promise.resolve()).then(()=>{
8100
- st.loads++;st.busy=false;st.ended=ended;
8135
+ const hadFocus=viaButton&&doc.activeElement===more;
8136
+ st.loads++;st.busy=false;st.viaButton=false;st.ended=ended;
8101
8137
  const added=flItems(box).length-count;
8102
8138
  if(!ended&&added<=0&&!waits.length)st.ended=true;
8103
8139
  sync();
8104
8140
  if(added>0&&!st.ended)text.textContent=`${added} more loaded`;
8105
8141
  if(flStates.has(box))flApply(flStates.get(box));
8106
8142
  else if(msStates.has(box))msLayout(msStates.get(box));
8143
+ if(hadFocus&&more.hidden){const first=flItems(box)[count];if(first){if(!first.matches('a, button, [tabindex]'))first.tabIndex=-1;first.focus({preventScroll:true});}}
8107
8144
  if(!st.ended&&st.loads<st.auto)requestAnimationFrame(()=>{const r=sentinel.getBoundingClientRect();if(r.top<innerHeight+400)load();});
8108
8145
  });
8109
8146
  };
8110
- more.addEventListener('click',()=>{st.auto=st.loads+(+(box.dataset.moeyInfiniteAuto??3)||0);load();});
8147
+ more.addEventListener('click',()=>{
8148
+ if(mode!=='button')st.auto=st.loads+autoN();
8149
+ load(true);
8150
+ });
8111
8151
  new IntersectionObserver((es)=>{if(es.some((x)=>x.isIntersecting)&&st.loads<st.auto)load();},{rootMargin:'0px 0px 400px 0px'}).observe(sentinel);
8112
8152
  sync();
8113
- st.api={el:box,load,reset:()=>{st.loads=0;st.ended=false;sync();}};
8153
+ st.api={el:box,load:()=>load(),reset:()=>{st.loads=0;st.ended=false;st.auto=mode==='button'||mode==='once'?0:autoN();sync();}};
8114
8154
  ifStates.set(box,st);
8115
8155
  return st.api;
8116
8156
  }
@@ -8119,8 +8159,6 @@ const LB_TYPES={jpg:'image',jpeg:'image',png:'image',gif:'image',webp:'image',av
8119
8159
  function lbType(src,el){
8120
8160
  const t=el?.dataset.type;
8121
8161
  if(t)return t;
8122
- if(/youtu\.?be/.test(src))return'youtube';
8123
- if(/vimeo\.com/.test(src))return'vimeo';
8124
8162
  if(src.startsWith('#'))return'inline';
8125
8163
  const ext=(src.split(/[?#]/)[0].split('.').pop()||'').toLowerCase();
8126
8164
  return LB_TYPES[ext]||(el?.querySelector('img')?'image':'iframe');
@@ -8210,8 +8248,7 @@ if(it.type==='image')return`<img class="lightbox-media" src="${esc(it.src)}"${it
8210
8248
  if(!active)return`<div class="lightbox-media lightbox-placeholder">${it.thumb?`<img src="${esc(it.thumb)}" alt="">`:''}</div>`;
8211
8249
  if(it.type==='video')return`<video class="lightbox-media" src="${esc(it.src)}" controls playsinline preload="metadata"${it.poster?` poster="${esc(it.poster)}"`:''}></video>`;
8212
8250
  if(it.type==='audio')return`<figure class="lightbox-media lightbox-audio">${it.poster?`<img src="${esc(it.poster)}" alt="">`:`<span class="lightbox-audio-icon">${lbIcon('music')}</span>`}<audio src="${esc(it.src)}" controls preload="metadata"></audio></figure>`;
8213
- if(it.type==='youtube'){const id=(it.src.match(/(?:v=|youtu\.be\/|embed\/|shorts\/)([\w-]{6,})/)||[])[1];return`<div class="lightbox-media lightbox-frame"><iframe src="https://www.youtube-nocookie.com/embed/${esc(id||'')}?autoplay=1&rel=0" title="${esc(it.caption||'Video')}" allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe></div>`;}
8214
- if(it.type==='vimeo'){const id=(it.src.match(/vimeo\.com\/(?:video\/)?(\d+)/)||[])[1];return`<div class="lightbox-media lightbox-frame"><iframe src="https://player.vimeo.com/video/${esc(id||'')}?autoplay=1&dnt=1" title="${esc(it.caption||'Video')}" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe></div>`;}
8251
+ if(it.type==='embed')return`<div class="lightbox-media lightbox-frame"><iframe src="${esc(it.src)}" title="${esc(it.caption||'Video')}" allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen></iframe></div>`;
8215
8252
  if(it.type==='inline'){const t=doc.querySelector(it.src);return`<div class="lightbox-media lightbox-html">${t?(t.tagName==='TEMPLATE'?t.innerHTML:t.innerHTML):''}</div>`;}
8216
8253
  return`<div class="lightbox-media lightbox-frame lightbox-frame-page"><iframe src="${esc(it.src)}" title="${esc(it.caption||'Content')}" loading="lazy"></iframe></div>`;
8217
8254
  }
@@ -8238,7 +8275,7 @@ const cap=box.querySelector('.lightbox-caption');
8238
8275
  cap.textContent=it.caption||'';
8239
8276
  cap.hidden=!o.caption||!it.caption;
8240
8277
  const dl=box.querySelector('[data-lb="download"]');
8241
- dl.hidden=!o.download||it.type==='youtube'||it.type==='vimeo'||it.type==='inline';
8278
+ dl.hidden=!o.download||it.type==='embed'||it.type==='inline';
8242
8279
  dl.href=it.src;
8243
8280
  box.querySelector('[data-lb="share"]').hidden=!o.share;
8244
8281
  box.querySelector('[data-lb="zoom"]').hidden=!o.zoom||it.type!=='image';
@@ -8398,7 +8435,7 @@ const b=Object.assign(doc.createElement('button'),{type:'button'});
8398
8435
  b.dataset.i=k;
8399
8436
  b.setAttribute('aria-label',`${x.caption||`Item ${k+1}`}`);
8400
8437
  if(x.thumb)b.append(Object.assign(doc.createElement('img'),{src:x.thumb,alt:''}));
8401
- else b.innerHTML=lbIcon({video:'play',audio:'music',youtube:'play',vimeo:'play'}[x.type]||'file');
8438
+ else b.innerHTML=lbIcon({video:'play',audio:'music',embed:'play'}[x.type]||'file');
8402
8439
  return b;
8403
8440
  }):[]));
8404
8441
  box.classList.remove('is-bare');
@@ -8443,31 +8480,40 @@ close:()=>lbClose(),next:()=>lbGo(lb.i+1,1),prev:()=>lbGo(lb.i-1,-1),go:(i)=>lbG
8443
8480
  get index(){return lb.i;},
8444
8481
  });
8445
8482
  const enterSeen=new WeakSet();
8483
+ const ENTER_SKIP='.filter-empty, .infinite-status, template, script, style';
8484
+ function enterPlay(box,nodes){
8485
+ if(reducedMotion())return;
8486
+ let i=0;
8487
+ nodes.forEach((n)=>{
8488
+ if(n.nodeType!==1||n.parentElement!==box||n.hidden||n.matches(ENTER_SKIP))return;
8489
+ n.classList.remove('is-entering');
8490
+ void n.offsetWidth;
8491
+ n.style.setProperty('--mo-enter-index',i++);
8492
+ n.classList.add('is-entering');
8493
+ clearTimeout(n.moeyEnterT);
8494
+ const done=(e)=>{if(e&&e.target!==n)return;clearTimeout(n.moeyEnterT);n.removeEventListener('animationend',done);n.classList.remove('is-entering');n.style.removeProperty('--mo-enter-index');};
8495
+ n.addEventListener('animationend',done);
8496
+ n.moeyEnterT=setTimeout(done,3000);
8497
+ });
8498
+ }
8446
8499
  function setupEnter(box){
8447
8500
  if(enterSeen.has(box))return;
8448
8501
  enterSeen.add(box);
8449
8502
  new MutationObserver((muts)=>{
8450
8503
  const moved=new Set(muts.flatMap((m)=>[...m.removedNodes]));
8451
- let i=0;
8452
- muts.forEach((m)=>m.addedNodes.forEach((n)=>{
8453
- if(n.nodeType!==1||n.parentElement!==box||moved.has(n)||n.matches('.filter-empty, .infinite-status, template, script'))return;
8454
- n.style.setProperty('--mo-enter-index',i++);
8455
- n.classList.add('is-entering');
8456
- let t=0;
8457
- const done=(e)=>{if(e&&e.target!==n)return;clearTimeout(t);n.removeEventListener('animationend',done);n.classList.remove('is-entering');n.style.removeProperty('--mo-enter-index');};
8458
- n.addEventListener('animationend',done);
8459
- t=setTimeout(done,2000);
8460
- }));
8504
+ enterPlay(box,muts.flatMap((m)=>[...m.addedNodes]).filter((n)=>!moved.has(n)));
8461
8505
  }).observe(box,{childList:true});
8506
+ if(box.hasAttribute('data-moey-enter-first'))enterPlay(box,[...box.children]);
8462
8507
  }
8508
+ const enter=(box,items)=>{box=typeof box==='string'?doc.querySelector(box):box;if(!box)return;setupEnter(box);enterPlay(box,items?[...items]:[...box.children]);};
8463
8509
  const initGallery=()=>{
8464
8510
  const scan=(root)=>{
8465
- root.querySelectorAll?.('[data-moey-masonry]').forEach(setupMasonry);
8511
+ root.querySelectorAll?.(GRIDDY).forEach(setupGriddy);
8466
8512
  root.querySelectorAll?.('[data-moey-infinite]').forEach(setupInfinite);
8467
8513
  root.querySelectorAll?.('[data-moey-enter]').forEach(setupEnter);
8468
8514
  };
8469
8515
  scan(doc);
8470
- new MutationObserver((muts)=>{for(const m of muts)for(const n of m.addedNodes)if(n.nodeType===1){if(n.matches('[data-moey-masonry]'))setupMasonry(n);if(n.matches('[data-moey-infinite]'))setupInfinite(n);if(n.matches('[data-moey-enter]'))setupEnter(n);scan(n);}})
8516
+ new MutationObserver((muts)=>{for(const m of muts)for(const n of m.addedNodes)if(n.nodeType===1){if(n.matches(GRIDDY))setupGriddy(n);if(n.matches('[data-moey-infinite]'))setupInfinite(n);if(n.matches('[data-moey-enter]'))setupEnter(n);scan(n);}})
8471
8517
  .observe(doc.body,{childList:true,subtree:true});
8472
8518
  };
8473
8519
  const plStates=new WeakMap();
@@ -8583,14 +8629,7 @@ plStates.set(el,st);
8583
8629
  return st.api;
8584
8630
  }
8585
8631
  const player=(el)=>{el=typeof el==='string'?doc.querySelector(el):el;return el?setupPlayer(el):null;};
8586
- function embedSrc(a){
8587
- const href=a.dataset.src||a.getAttribute('href')||'';
8588
- const yt=href.match(/(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{6,})/);
8589
- if(yt)return`https://www.youtube-nocookie.com/embed/${yt[1]}?autoplay=1&rel=0`;
8590
- const vm=href.match(/vimeo\.com\/(?:video\/)?(\d+)/);
8591
- if(vm)return`https://player.vimeo.com/video/${vm[1]}?autoplay=1&dnt=1`;
8592
- return href;
8593
- }
8632
+ const embedSrc=(a)=>a.dataset.src||a.getAttribute('href')||'';
8594
8633
  doc.addEventListener('click',(e)=>{
8595
8634
  const a=e.target.closest?.('[data-moey-embed]');
8596
8635
  if(!a||a.classList.contains('is-loaded')||e.metaKey||e.ctrlKey||e.shiftKey)return;
@@ -8610,5 +8649,5 @@ new MutationObserver((muts)=>{for(const m of muts)for(const n of m.addedNodes)if
8610
8649
  };
8611
8650
  const initLate=()=>{initSelects();initDatatables();initDatepickers();initComboboxes();initOtp();initCopy();initPasswords();initDirty();initFloating();initTimepickers();initCharts();initKanbans();initSplits();initCalendars();initTabbars();initSwipes();initRefresh();initSortables();initChats();initShortcuts();initMarquees();initGallery();initPlayers();};
8612
8651
  if(doc.readyState==='loading')doc.addEventListener('DOMContentLoaded',initLate);else initLate();
8613
- window.Moey=Object.freeze({version:'0.2.0',dismiss,open,close,openMenu,closeMenu,tooltip:showTip,toast,tab:(t)=>selectTab(t,{focus:false}),paginate,popover,sortTable,palette,collapse,toggle,tags,chips,dropzone,tree,notify,datatable,select,spy,carousel,datepicker,combobox,countdown,confirm:askConfirm,alert:askAlert,prompt:askPrompt,strength,clean,chart,kanban,split,calendar,swipe,refresh,sortable,timepicker,chat,shortcuts,tour,marquee,masonry,filter,infinite,lightbox,player});
8652
+ window.Moey=Object.freeze({version:'0.3.0',dismiss,open,close,openMenu,closeMenu,tooltip:showTip,toast,tab:(t)=>selectTab(t,{focus:false}),paginate,popover,sortTable,palette,collapse,toggle,tags,chips,dropzone,tree,notify,datatable,select,spy,carousel,datepicker,combobox,countdown,confirm:askConfirm,alert:askAlert,prompt:askPrompt,strength,clean,chart,kanban,split,calendar,swipe,refresh,sortable,timepicker,chat,shortcuts,tour,marquee,griddy,masonry:griddy,enter,filter,infinite,lightbox,player});
8614
8653
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moey-ui",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "A clean, mobile-first front-end framework for admin dashboards, productivity apps and websites — one stylesheet, one script, no dependencies.",
5
5
  "keywords": [
6
6
  "css",
@@ -16,7 +16,7 @@
16
16
  "oklch",
17
17
  "no-dependencies"
18
18
  ],
19
- "homepage": "https://nakedtuxedo.com",
19
+ "homepage": "https://moey.dev",
20
20
  "license": "MIT",
21
21
  "type": "module",
22
22
  "main": "dist/moey.js",
package/src/css/adapt.css CHANGED
@@ -67,12 +67,24 @@ html:has(.is-sheet:popover-open) { overflow: hidden; }
67
67
  .datepicker.is-sheet .datepicker-main { margin-inline: auto; }
68
68
  .datepicker.is-sheet .datepicker-foot > .btn { min-height: 2.5rem; }
69
69
 
70
- /* Slide up (the menu's own zoom is switched off) */
70
+ /* Slide up to open, slide back down to close (the pop-up's own zoom and fade are switched off).
71
+ Closing is a transition too, so the sheet keeps its size and layout until it's gone. */
71
72
  @media (prefers-reduced-motion: no-preference) {
72
- .is-sheet[popover]:popover-open { animation: mo-adapt-up .24s cubic-bezier(.2, .8, .2, 1); }
73
- .menu.is-sheet[popover] { transition: none; }
74
- .is-sheet[popover].is-dragging { animation: none; }
75
- @keyframes mo-adapt-up { from { translate: 0 100%; } }
73
+ .is-sheet[popover],
74
+ .is-sheet[popover]::backdrop {
75
+ transition:
76
+ translate .24s cubic-bezier(.2, .8, .2, 1),
77
+ opacity .24s cubic-bezier(.2, .8, .2, 1),
78
+ overlay .24s allow-discrete,
79
+ display .24s allow-discrete;
80
+ }
81
+ .is-sheet[popover]:popover-open { animation: none; }
82
+ .is-sheet[popover]:not(:popover-open) { opacity: 1; scale: none; translate: 0 100%; }
83
+ .is-sheet[popover]:not(:popover-open)::backdrop { opacity: 0; }
84
+ @starting-style {
85
+ .is-sheet[popover]:popover-open { opacity: 1; scale: none; translate: 0 100%; }
86
+ .is-sheet[popover]:popover-open::backdrop { opacity: 0; }
87
+ }
76
88
  }
77
89
  .is-sheet[popover].is-dragging { transition: none; user-select: none; }
78
90
  .is-sheet[popover].is-settling { transition: translate .2s ease; }
package/src/css/app.css CHANGED
@@ -19,7 +19,7 @@
19
19
  --mo-sidebar-width: 16rem;
20
20
  --mo-sidebar-width-collapsed: 4.25rem;
21
21
  --mo-topbar-height: 3.75rem;
22
- --mo-topbar-bg: color-mix(in oklab, var(--mo-bg-body) 85%, transparent);
22
+ --mo-topbar-bg: var(--mo-bg-body); /* shown --mo-glass see-through (.frosted on the header: frosted glass) */
23
23
  --mo-app-padding: 1rem;
24
24
  display: flex;
25
25
  min-height: var(--mo-app-height, 100dvh);
@@ -283,8 +283,7 @@
283
283
  gap: .75rem;
284
284
  height: var(--mo-topbar-height);
285
285
  padding-inline: var(--mo-app-padding);
286
- background: var(--mo-topbar-bg);
287
- backdrop-filter: blur(12px) saturate(1.5);
286
+ background: color-mix(in oklab, var(--mo-topbar-bg) var(--mo-glass), transparent);
288
287
  --mo-badge-ring: var(--mo-bg-body); /* notification badges blend into the bar */
289
288
  }
290
289
 
package/src/css/chat.css CHANGED
@@ -66,8 +66,7 @@ html.mo-keyboard .chat-full { position: fixed; inset-inline: 0; top: var(--mo-vv
66
66
  font-size: .75rem;
67
67
  font-weight: var(--mo-font-weight-medium);
68
68
  color: var(--mo-fg-2);
69
- background: color-mix(in oklab, var(--mo-bg-2) 90%, transparent);
70
- backdrop-filter: blur(8px);
69
+ background: color-mix(in oklab, var(--mo-bg-2) var(--mo-glass), transparent);
71
70
  border-radius: 999px;
72
71
  }
73
72
 
@@ -133,7 +133,9 @@
133
133
  /* First column stays put while scrolling sideways (data-moey-sticky-first) */
134
134
  .datatable-sticky-first :is(th, td):first-child { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--mo-bg-surface); }
135
135
  .datatable-sticky-first thead th:first-child { z-index: 3; }
136
- .datatable-sticky-first.has-select :is(th, td):nth-child(2) { position: sticky; inset-inline-start: 2.75rem; z-index: 1; background: var(--mo-bg-surface); }
136
+ /* with checkboxes, the name column stays too, right after the checkbox column (moey.js measures its width) */
137
+ .datatable-sticky-first.has-select :is(th, td):nth-child(2) { position: sticky; inset-inline-start: var(--mo-datatable-first, 2.75rem); z-index: 1; background: var(--mo-bg-surface); }
138
+ .datatable-sticky-first.has-select thead th:nth-child(2) { z-index: 3; } /* the header stays above the rows scrolling under it */
137
139
 
138
140
  /* Phones: rows become cards (data-moey-stack) */
139
141
  @media (width < 640px) {
@@ -190,7 +192,7 @@
190
192
  /* Expandable details: a chevron column, and an inset panel under the open row */
191
193
  .datatable :is(th, td).datatable-expand { width: 2.75rem; padding-inline: .5rem 0; }
192
194
  .datatable tr:has(+ .datatable-detail-row) > td { border-bottom-color: transparent; }
193
- .datatable .datatable-detail-row > td { padding: 0 .75rem .75rem; background: none; }
195
+ .datatable .datatable-detail-row > td { padding: .75rem; background: none; } /* the panel is inset evenly: 12px on every side */
194
196
  .datatable-detail { padding: 1rem 1.25rem; font-size: .875rem; background: var(--mo-bg-2); border-radius: var(--mo-radius-control); }
195
197
  .datatable-detail > :last-child { margin-bottom: 0; }
196
198
  .datatable-detail .table { margin: 0; background: transparent; }
@@ -35,14 +35,15 @@ html:has(:is(.dialog, .drawer, .sheet)[open]:modal) { overflow: hidden; }
35
35
  border: 0;
36
36
  box-shadow: var(--mo-shadow-overlay);
37
37
  }
38
- :is(.dialog, .drawer, .sheet)[open] { display: flex; flex-direction: column; }
38
+ :is(.dialog, .drawer, .sheet) { flex-direction: column; } /* also while closing: the parts stay stacked, nothing reflows */
39
+ :is(.dialog, .drawer, .sheet)[open] { display: flex; }
39
40
  /* While a modal is open the page keeps the space of its scrollbar (no layout jump), but
40
41
  fixed boxes stop short of it — so anything edge-to-edge is sized to the whole window (100vw). */
41
42
  :is(.dialog, .drawer, .sheet)::backdrop {
42
43
  inset-inline-end: auto;
43
44
  width: 100vw;
44
45
  background: oklch(14% .01 258 / .45);
45
- backdrop-filter: blur(2px);
46
+ /* (no backdrop blur: at 2px it was barely visible, but it stalled the first opening by ~0.1s and slowed every frame) */
46
47
  opacity: calc(1 - var(--mo-sheet-drag, 0)); /* fades while a sheet is dragged down */
47
48
  }
48
49
  :is(.dialog, .drawer, .sheet):focus-visible { outline: 0; }
@@ -256,7 +257,7 @@ html:has(:is(.dialog, .drawer, .sheet)[open]:modal) { overflow: hidden; }
256
257
  /* closed state (also the starting point of the exit) */
257
258
  :is(.dialog, .drawer, .sheet):not([open]),
258
259
  :is(.dialog, .drawer, .sheet):not([open])::backdrop { opacity: 0; }
259
- .dialog:not([open]) { scale: .96; translate: 0 .5rem; }
260
+ /* (a dialog opens with a small rise and closes with a plain fade) */
260
261
  .drawer:not([open]) { translate: 100% 0; }
261
262
  .drawer-start:not([open]) { translate: -100% 0; }
262
263
  .drawer-top:not([open]) { translate: 0 -100%; }
@@ -70,10 +70,9 @@
70
70
  z-index: 5;
71
71
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
72
72
  margin-top: 1rem;
73
- background: color-mix(in oklab, var(--mo-bg-raised) 90%, transparent);
73
+ background: color-mix(in oklab, var(--mo-bg-raised) var(--mo-glass), transparent); /* .frosted: frosted glass */
74
74
  border-radius: var(--mo-radius-card);
75
75
  box-shadow: 0 -.25rem 1.5rem rgb(0 0 0 / .08), 0 0 0 var(--mo-border-width) var(--mo-border-color);
76
- backdrop-filter: blur(.5rem);
77
76
  }
78
77
 
79
78
  /* Only while there are unsaved changes */
@@ -1,41 +1,69 @@
1
1
  /* ==========================================================================
2
- Gallery — masonry, filter & sort, infinite scroll and the lightbox (moey.js).
2
+ Gallery: griddy, filter & sort, infinite scroll and the lightbox (moey.js).
3
3
  ========================================================================== */
4
4
 
5
- /* Masonry: columns from the grid utilities (or automatic), heights packed by moey.js */
6
- .masonry {
7
- --mo-masonry-min: 14rem;
5
+ /* Griddy: a grid whose items of different heights pack into columns with no holes. Columns come
6
+ from the grid utilities (or automatic), moey.js places each item. The old names (.masonry,
7
+ .masonry-dense, --mo-masonry-min, data-moey-masonry) still work. */
8
+ :is(.griddy, .masonry) {
8
9
  display: grid;
9
- grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--mo-masonry-min)), 1fr));
10
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--mo-griddy-min, var(--mo-masonry-min, 14rem))), 1fr));
10
11
  gap: 1rem;
11
12
  align-items: start;
12
13
  }
13
14
  /* the grid-cols-* utilities set --mo-columns (phone first: grid-cols-2 md:grid-cols-4) */
14
- .masonry[class*="grid-cols-"] { grid-template-columns: repeat(var(--mo-columns, 3), minmax(0, 1fr)); }
15
+ :is(.griddy, .masonry)[class*="grid-cols-"] { grid-template-columns: repeat(var(--mo-columns, 3), minmax(0, 1fr)); }
15
16
  /* moey.js gives each item its exact place (is-ready): the grid only supplies the columns and gaps */
16
- .masonry.is-ready { position: relative; }
17
- .masonry.is-ready > * { position: absolute; box-sizing: border-box; }
18
- .masonry > * { min-width: 0; margin: 0; }
19
- .masonry > .span-2 { grid-column: span 2; }
20
- .masonry > .span-3 { grid-column: span 3; }
21
- .masonry-dense { grid-auto-flow: row dense; }
17
+ :is(.griddy, .masonry).is-ready { position: relative; }
18
+ :is(.griddy, .masonry).is-ready > * { position: absolute; box-sizing: border-box; }
19
+ :is(.griddy, .masonry) > * { min-width: 0; margin: 0; }
20
+ :is(.griddy, .masonry) > .span-2 { grid-column: span 2; }
21
+ :is(.griddy, .masonry) > .span-3 { grid-column: span 3; }
22
+ :is(.griddy-dense, .masonry-dense) { grid-auto-flow: row dense; }
22
23
  @supports (grid-template-rows: masonry) {
23
- .masonry { grid-template-rows: masonry; }
24
+ :is(.griddy, .masonry) { grid-template-rows: masonry; }
25
+ }
26
+ /* Gliding: when the layout changes (a wider item, fewer columns, a new gap, the window), the items
27
+ already there slide to their new place. Not while one is being dragged (that has its own slide). */
28
+ @media (prefers-reduced-motion: no-preference) {
29
+ html:not(.mo-sorting) .griddy-glide.is-ready > * {
30
+ transition: left .4s var(--mo-ease), right .4s var(--mo-ease), top .4s var(--mo-ease), width .4s var(--mo-ease);
31
+ }
24
32
  }
25
33
 
26
- /* New items glide in: data-moey-enter on any list or grid (masonry, infinite scroll, a feed).
27
- Items added later get .is-entering and --mo-enter-index (0, 1, 2… in each batch, for a stagger).
28
- data-moey-enter="fade" fades only; "zoom" grows from 96%. Your own: style [data-moey-enter] > .is-entering. */
34
+ /* New items arrive: data-moey-enter on any list or grid (griddy, infinite scroll, a feed). Items
35
+ added later get .is-entering and --mo-enter-index (0, 1, 2… in each batch), one after another
36
+ (--mo-enter-stagger apart). The value picks the effect:
37
+ (empty) fade up · fade · rise · drop · zoom · pop · slide · flip · blur · none.
38
+ Your own: style [data-moey-enter] > .is-entering. */
29
39
  @media (prefers-reduced-motion: no-preference) {
30
- [data-moey-enter] > .is-entering { animation: mo-enter-up .45s var(--mo-ease) both; animation-delay: calc(min(var(--mo-enter-index, 0), 10) * 60ms); }
40
+ [data-moey-enter] > .is-entering {
41
+ animation: mo-enter-up .45s var(--mo-ease) both;
42
+ animation-delay: calc(min(var(--mo-enter-index, 0), 10) * var(--mo-enter-stagger, 60ms));
43
+ }
31
44
  [data-moey-enter="fade"] > .is-entering { animation-name: mo-enter-fade; }
32
45
  [data-moey-enter="zoom"] > .is-entering { animation-name: mo-enter-zoom; }
46
+ [data-moey-enter="rise"] > .is-entering { animation-name: mo-enter-rise; animation-duration: .5s; }
47
+ [data-moey-enter="drop"] > .is-entering { animation-name: mo-enter-drop; animation-duration: .5s; }
48
+ [data-moey-enter="pop"] > .is-entering { --mo-enter-stagger: 55ms; animation-name: mo-enter-pop; animation-duration: .45s; animation-delay: calc(min(var(--mo-enter-index, 0), 20) * var(--mo-enter-stagger)); }
49
+ [data-moey-enter="slide"] > .is-entering { animation-name: mo-enter-slide; animation-duration: .5s; }
50
+ [data-moey-enter="slide"]:dir(rtl) > .is-entering { animation-name: mo-enter-slide-rtl; }
51
+ [data-moey-enter="flip"] > .is-entering { animation-name: mo-enter-flip; animation-duration: .5s; transform-origin: 50% 0; }
52
+ [data-moey-enter="blur"] > .is-entering { animation-name: mo-enter-blur; animation-duration: .5s; }
53
+ [data-moey-enter="none"] > .is-entering { animation: none; }
33
54
  }
34
55
  @keyframes mo-enter-up { from { opacity: 0; translate: 0 1rem; } }
35
56
  @keyframes mo-enter-fade { from { opacity: 0; } }
36
57
  @keyframes mo-enter-zoom { from { opacity: 0; scale: .96; } }
58
+ @keyframes mo-enter-rise { from { opacity: 0; translate: 0 1.625rem; } }
59
+ @keyframes mo-enter-drop { from { opacity: 0; translate: 0 -1.625rem; } }
60
+ @keyframes mo-enter-pop { from { opacity: 0; scale: .001; } }
61
+ @keyframes mo-enter-slide { from { opacity: 0; translate: -1.625rem 0; } }
62
+ @keyframes mo-enter-slide-rtl { from { opacity: 0; translate: 1.625rem 0; } }
63
+ @keyframes mo-enter-flip { from { opacity: 0; transform: perspective(900px) rotateX(-28deg); } }
64
+ @keyframes mo-enter-blur { from { opacity: 0; filter: blur(14px); } }
37
65
  /* Picture tiles */
38
- .masonry img,
66
+ :is(.griddy, .masonry) img,
39
67
  .gallery-tile img { display: block; width: 100%; height: auto; border-radius: var(--mo-radius-card); }
40
68
  .gallery-tile { position: relative; display: block; overflow: hidden; color: inherit; text-decoration: none; border-radius: var(--mo-radius-card); }
41
69
  .gallery-tile:focus-visible { outline: var(--mo-focus-ring-width) solid var(--mo-theme-focus-ring); outline-offset: 2px; }
@@ -53,6 +81,7 @@
53
81
  .infinite-status { display: flex; gap: .625rem; align-items: center; justify-content: center; min-height: 3rem; padding: .75rem 0; font-size: .875rem; color: var(--mo-fg-3); }
54
82
  .infinite-status:has(.infinite-text:empty):has(.spinner[hidden]):has(.infinite-more[hidden]) { min-height: 0; padding: 0; }
55
83
  .infinite-sentinel { height: 1px; }
84
+ .infinite-more[aria-busy] { opacity: 1; cursor: progress; } /* loading in place: not faded like a disabled button */
56
85
 
57
86
  /* Lightbox — phone first: full bleed, controls float on soft gradients, one tap hides them */
58
87
  .lightbox {
@@ -130,4 +159,4 @@ video.lightbox-media { width: 100%; max-height: 100%; background: #000; }
130
159
  @media (prefers-reduced-motion: reduce) { .lightbox-top, .lightbox-bottom, .lightbox-prev, .lightbox-next { transition: none; } }
131
160
 
132
161
  /* Hidden items really go (tiles set their own display) */
133
- :where(.masonry, .filter-items) > [hidden] { display: none !important; }
162
+ :where(.griddy, .masonry, .filter-items) > [hidden] { display: none !important; }
@@ -36,6 +36,15 @@
36
36
  .hover-lift rises a little with a soft shadow .hover-grow grows a touch
37
37
  .hover-dim fades a little (image tiles)
38
38
  Only for a mouse (phones have no hover), and still for people who ask for less motion. */
39
+ /* Frosted glass: see-through with the page blurred behind it. Moey's floating bars are only slightly
40
+ see-through by default (cheaper to draw while scrolling); add .frosted to one of them (app header,
41
+ tab bar, sticky form buttons, chat day pill) or to anything with a background. */
42
+ .frosted {
43
+ --mo-glass: 78%;
44
+ -webkit-backdrop-filter: saturate(1.6) blur(14px);
45
+ backdrop-filter: saturate(1.6) blur(14px);
46
+ }
47
+
39
48
  @media (hover: hover) {
40
49
  .hover-lift:hover { translate: 0 -.1875rem; box-shadow: var(--mo-shadow-lg); }
41
50
  .hover-grow:hover { scale: 1.025; }
@@ -91,7 +91,10 @@
91
91
  .card-body:not(.card-flush) > .list-group-flush:first-child { margin-top: calc(var(--mo-list-padding-y) * -1); }
92
92
  .card-body:not(.card-flush) > .list-group-flush:last-child { margin-bottom: calc(var(--mo-list-padding-y) * -1); }
93
93
  /* Edge-to-edge in a .card-flush body: rows get the card's side padding */
94
- .card-flush > .list-group-flush { --mo-list-padding-x: var(--mo-card-padding); }
94
+ .card-flush > .list-group-flush,
95
+ .card > .list-group-flush { --mo-list-padding-x: var(--mo-card-padding); }
96
+ /* Straight in a dialog, drawer or sheet (no .dialog-body around it): the same, with the dialog padding */
97
+ :is(.dialog, .drawer, .sheet) > .list-group-flush { --mo-list-padding-x: var(--mo-dialog-padding); }
95
98
  .dialog-flush > .list-group-flush { --mo-list-padding-x: var(--mo-dialog-padding); }
96
99
 
97
100
  .list-group-sm { --mo-list-padding-y: .5rem; }
@@ -37,13 +37,14 @@ html:has(.palette[open]:modal) { overflow: hidden; }
37
37
  border-radius: var(--mo-radius-dialog);
38
38
  box-shadow: var(--mo-shadow-overlay);
39
39
  }
40
- .palette[open] { display: flex; flex-direction: column; }
40
+ .palette { flex-direction: column; } /* also while closing: nothing reflows */
41
+ .palette[open] { display: flex; }
41
42
  .palette:focus-visible { outline: 0; }
42
43
  .palette::backdrop {
43
44
  inset-inline-end: auto;
44
45
  width: 100vw;
45
46
  background: oklch(14% .01 258 / .35);
46
- backdrop-filter: blur(2px);
47
+ /* (no backdrop blur: at 2px it was barely visible, but it stalled the first opening by ~0.1s and slowed every frame) */
47
48
  }
48
49
  @media (width < 576px) { .palette { margin-top: .5rem; } }
49
50
 
@@ -162,7 +163,7 @@ html:has(.palette[open]:modal) { overflow: hidden; }
162
163
  display var(--mo-dialog-duration) allow-discrete;
163
164
  }
164
165
  .palette:not([open]), .palette:not([open])::backdrop { opacity: 0; }
165
- .palette:not([open]) { scale: .98; }
166
+ /* (it opens with a small zoom and closes with a plain fade) */
166
167
  @starting-style {
167
168
  .palette[open], .palette[open]::backdrop { opacity: 0; }
168
169
  .palette[open] { scale: .98; }