fix: the upload-time notice leaves with the files, and says it in one line
All checks were successful
Build and deploy / Integration suite on a real stack (push) Successful in 2m37s
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 56s
All checks were successful
Build and deploy / Integration suite on a real stack (push) Successful in 2m37s
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 56s
The notice stayed on the product page after the item went to the cart, showing the last file's size on the next order. It is now redrawn wherever the files are cleared and hidden when no product is open. The text is one line: "Envio: até 8 min (501,2 MB), conforme sua internet. Mantenha a página aberta." Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -129,16 +129,16 @@ const duracao=s=>{
|
||||
const min=Math.ceil(s/60);
|
||||
return s<60 ? 'menos de 1 min' : min<60 ? min+' min' : Math.floor(min/60)+' h'+(min%60? ' '+min%60+' min' : '');
|
||||
};
|
||||
const faixaEnvio=bytes=>'de '+duracao(bytes/ENVIO_RAPIDO)+' a '+duracao(bytes/ENVIO_LENTO);
|
||||
const faixaEnvio=bytes=>bytes/ENVIO_RAPIDO<60 ? 'até '+duracao(bytes/ENVIO_LENTO)
|
||||
: 'de '+duracao(bytes/ENVIO_RAPIDO)+' a '+duracao(bytes/ENVIO_LENTO);
|
||||
// Só enquanto há arquivos no produto aberto: sai quando o item vai para o carrinho.
|
||||
function pintaAvisoEnvio(){
|
||||
const el=$('avisoEnvio'); if(!el) return;
|
||||
const total=(ehFolha()?folhas:artes).reduce((t,x)=>t+(x.f?.size||0),0);
|
||||
const total=modo ? (ehFolha()?folhas:artes).reduce((t,x)=>t+(x.f?.size||0),0) : 0;
|
||||
el.hidden = total/ENVIO_LENTO < ENVIO_AVISA_S;
|
||||
if(el.hidden) return;
|
||||
el.innerHTML='<b>O envio '+((ehFolha()?folhas:artes).length>1?'destes arquivos':'deste arquivo')+
|
||||
' ('+fmt(total)+') leva '+faixaEnvio(total)+'</b>, conforme a velocidade de upload da sua internet. '+
|
||||
'Ele começa quando você coloca o item no carrinho e continua enquanto você preenche os dados. '+
|
||||
'<b>Mantenha a página aberta até terminar.</b>';
|
||||
el.innerHTML='<b>Envio: '+faixaEnvio(total)+'</b> ('+fmt(total)+'), conforme sua internet. '+
|
||||
'Mantenha a página aberta.';
|
||||
}
|
||||
const larguraFilme=()=>MODOS[modo].larg;
|
||||
// cobrança proporcional: arredonda para cima em 10 cm · 2,75 m vira 2,80 m
|
||||
|
||||
Reference in New Issue
Block a user