Mini e‑Commerce Store — Embed for Blogger
S
Shoply
Blogger-friendly single-file store
and
// then call renderProducts(JSON.parse(...)).
// Accessibility: close drawer with ESC
document.addEventListener('keydown', (e)=>{
if(e.key === 'Escape'){
$('#cartDrawer').classList.remove('open'); $('#modalBackdrop').classList.remove('open');
}
});
// Small UX: when cart changes, auto open/flash drawer briefly
let flashTimeout;
function flashCart(){
clearTimeout(flashTimeout);
$('#cartDrawer').classList.add('open');
flashTimeout = setTimeout(()=>$('#cartDrawer').classList.remove('open'), 900);
}
// Hook into saveCart to flash
const _saveCart = saveCart;
saveCart = function(c){ _saveCart(c); flashCart(); };
Comments
Post a Comment