From 56d8fde0db5039c37439a025dc6e54a06d482398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Fri, 18 Sep 2026 15:14:29 -0300 Subject: [PATCH] fix: show repeated artwork in preview --- dtf-site.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/dtf-site.html b/dtf-site.html index 7ea6573..361d981 100644 --- a/dtf-site.html +++ b/dtf-site.html @@ -372,6 +372,8 @@ h1 em{font-style:normal;color:var(--laranja)} #vArea .folhaPrevias{min-height:200px;padding:10px;display:grid;gap:12px;background:#F8F9FA} #vArea .folhaPrevia{margin:0;background:#fff;border:1px solid var(--linha);border-radius:6px;overflow:hidden} #vArea .folhaPrevia img{width:100%;height:auto;max-height:520px;object-fit:contain;display:block;background:#fff} +#vArea .folhaRepeticoes{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px;background:#fff} +#vArea .folhaRepeticoes img{width:auto;max-width:100%;object-fit:contain;display:block;background:#fff} #vArea .folhaPrevia figcaption{padding:7px 9px;font-size:10.5px;color:var(--fraco);border-top:1px solid var(--linha)} #vArea .semmont{border:0;min-height:200px;display:flex;flex-direction:column; align-items:center;justify-content:center} @@ -2512,11 +2514,21 @@ function previaAoVivo(){ const painel=document.createElement('div'); painel.className='folhaPrevias'; previews.forEach((x,index)=>{ const figura=document.createElement('figure'); figura.className='folhaPrevia'; - const imagem=new Image(); imagem.src=x.previewSrc; imagem.alt=x.f.name; + const repeticoes=Math.max(1,Math.min(200,x.rep||1)); + const sequencia=document.createElement('div'); sequencia.className='folhaRepeticoes'; + // The whole printed strip remains visible: repeated sheets are scaled + // together rather than hiding every copy below the panel fold. + const alturaMax=Math.max(48,Math.floor(480/repeticoes)); + for(let copia=0;copia1 ? (index+1)+'. ' : '')+x.f.name+ - (x.med ? ' · '+n1(x.med.larg)+' × '+n1(x.med.alt)+' cm' : ''); - figura.append(imagem,legenda); painel.append(figura); + (x.med ? ' · '+n1(x.med.larg)+' × '+n1(x.med.alt)+' cm' : '')+ + (repeticoes>1 ? ' · '+repeticoes+' repetições em sequência' : ''); + figura.append(sequencia,legenda); painel.append(figura); }); $('vArea').replaceChildren(painel); }else{