Files
plugi/themes/theme-one/dist/script.js
T
deepDiverPaul ed8ae3200b refresh theme-one starter blocks and layout
Redesign the master layout and content blocks with responsive styling, accessible navigation, and configurable CTA and quote sections. Add about-me, embedded-code, and FAQ blocks, and update the generated theme assets. Replace Alpine-based locale handling with vanilla JavaScript for locale flags and gallery lightboxes, and remove Alpine and DaisyUI dependencies.
2026-11-25 17:50:12 +01:00

1 line
684 B
JavaScript

const e={en:`us`},t=t=>Object.keys(e).includes(t)?e[t]:t,n=e=>{let n=t(e);return String.fromCodePoint(...[...n.toUpperCase()].map(e=>127397+e.charCodeAt(0)))};document.querySelectorAll(`[data-locale-flag]`).forEach(e=>{let t=e.dataset.locale;t&&(e.textContent=n(t))}),document.querySelectorAll(`[data-gallery]`).forEach(e=>{if(e.dataset.galleryLightbox!==`true`)return;let t=e.querySelector(`[data-gallery-dialog]`),n=t?.querySelector(`[data-gallery-lightbox-image]`);t&&n&&typeof t.showModal==`function`&&e.querySelectorAll(`[data-gallery-trigger]`).forEach(e=>{e.addEventListener(`click`,r=>{r.preventDefault(),n.src=e.href,n.alt=e.querySelector(`img`)?.alt??``,t.showModal()})})});