fix: show repeated artwork in preview
This commit is contained in:
@@ -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 .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{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 .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 .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;
|
#vArea .semmont{border:0;min-height:200px;display:flex;flex-direction:column;
|
||||||
align-items:center;justify-content:center}
|
align-items:center;justify-content:center}
|
||||||
@@ -2512,11 +2514,21 @@ function previaAoVivo(){
|
|||||||
const painel=document.createElement('div'); painel.className='folhaPrevias';
|
const painel=document.createElement('div'); painel.className='folhaPrevias';
|
||||||
previews.forEach((x,index)=>{
|
previews.forEach((x,index)=>{
|
||||||
const figura=document.createElement('figure'); figura.className='folhaPrevia';
|
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;copia<repeticoes;copia++){
|
||||||
|
const imagem=new Image(); imagem.src=x.previewSrc;
|
||||||
|
imagem.alt=x.f.name+' · repetição '+(copia+1)+' de '+repeticoes;
|
||||||
|
imagem.style.maxHeight=alturaMax+'px'; sequencia.append(imagem);
|
||||||
|
}
|
||||||
const legenda=document.createElement('figcaption');
|
const legenda=document.createElement('figcaption');
|
||||||
legenda.textContent=(previews.length>1 ? (index+1)+'. ' : '')+x.f.name+
|
legenda.textContent=(previews.length>1 ? (index+1)+'. ' : '')+x.f.name+
|
||||||
(x.med ? ' · '+n1(x.med.larg)+' × '+n1(x.med.alt)+' cm' : '');
|
(x.med ? ' · '+n1(x.med.larg)+' × '+n1(x.med.alt)+' cm' : '')+
|
||||||
figura.append(imagem,legenda); painel.append(figura);
|
(repeticoes>1 ? ' · '+repeticoes+' repetições em sequência' : '');
|
||||||
|
figura.append(sequencia,legenda); painel.append(figura);
|
||||||
});
|
});
|
||||||
$('vArea').replaceChildren(painel);
|
$('vArea').replaceChildren(painel);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Reference in New Issue
Block a user