diff --git a/src/admin/gallery/index.html b/src/admin/gallery/index.html index 9057a2e..9575900 100644 --- a/src/admin/gallery/index.html +++ b/src/admin/gallery/index.html @@ -5,6 +5,7 @@ +
- Format A5 portrait, un carton par page. Dans la boîte de dialogue + Un carton par page, en portrait. Dans la boîte de dialogue d'impression : désactiver en-têtes et pieds de page, marges « Aucune », échelle 100 %. Sur papier ivoire ou bristol, c'est encore plus beau. @@ -348,6 +363,8 @@ const titleInput = document.getElementById('title'); const baseUrlInput = document.getElementById('baseUrl'); const ecLevelSelect = document.getElementById('ecLevel'); + const formatSelect = document.getElementById('format'); + const pageSizeStyle = document.getElementById('pageSize'); const errorEl = document.getElementById('error'); const printBtn = document.getElementById('printBtn'); @@ -375,9 +392,21 @@ if (initialSlug) { slugInput.value = initialSlug; } + if (initialParams.get('format') === 'a6') { + formatSelect.value = 'a6'; + } + + function applyFormat() { + const format = formatSelect.value; + document.documentElement.dataset.format = format; + // Cotes en mm : Chrome ne connaît pas le mot-clé A6 (il retombe sur Letter). + const size = format === 'a6' ? '105mm 148mm' : '148mm 210mm'; + pageSizeStyle.textContent = `@page { size: ${size}; margin: 0; }`; + } function humanizeSlug(slug) { return slug + .replace(/-[0-9a-f]{6}$/, '') // suffixe aléatoire du slug (migration 20261015130000) .replace(/[-_]+/g, ' ') .trim() .replace(/\b\w/g, (c) => c.toUpperCase()); @@ -431,11 +460,13 @@ titleInput.addEventListener('input', refresh); baseUrlInput.addEventListener('input', refresh); ecLevelSelect.addEventListener('change', refresh); + formatSelect.addEventListener('change', applyFormat); printBtn.addEventListener('click', () => { window.print(); }); + applyFormat(); refresh(); diff --git a/src/admin/qrcode/index.html b/src/admin/qrcode/index.html index 77c42f7..90c4725 100644 --- a/src/admin/qrcode/index.html +++ b/src/admin/qrcode/index.html @@ -3,6 +3,7 @@