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:
@@ -77,6 +77,7 @@ function pintaPedido(){
|
|||||||
if(pedido.length || itemAtual) $('carr').classList.add('on');
|
if(pedido.length || itemAtual) $('carr').classList.add('on');
|
||||||
if($('cartN')){ $('cartN').textContent=noCarrinho>99?'99+':noCarrinho; $('cartN').hidden=!noCarrinho;
|
if($('cartN')){ $('cartN').textContent=noCarrinho>99?'99+':noCarrinho; $('cartN').hidden=!noCarrinho;
|
||||||
$('cartLink').setAttribute('aria-label','Carrinho, '+noCarrinho+(noCarrinho===1?' item':' itens')); }
|
$('cartLink').setAttribute('aria-label','Carrinho, '+noCarrinho+(noCarrinho===1?' item':' itens')); }
|
||||||
|
pintaAvisoEnvio();
|
||||||
window.dispatchEvent(new Event('dtf-cart-changed'));
|
window.dispatchEvent(new Event('dtf-cart-changed'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,16 +129,16 @@ const duracao=s=>{
|
|||||||
const min=Math.ceil(s/60);
|
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' : '');
|
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(){
|
function pintaAvisoEnvio(){
|
||||||
const el=$('avisoEnvio'); if(!el) return;
|
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;
|
el.hidden = total/ENVIO_LENTO < ENVIO_AVISA_S;
|
||||||
if(el.hidden) return;
|
if(el.hidden) return;
|
||||||
el.innerHTML='<b>O envio '+((ehFolha()?folhas:artes).length>1?'destes arquivos':'deste arquivo')+
|
el.innerHTML='<b>Envio: '+faixaEnvio(total)+'</b> ('+fmt(total)+'), conforme sua internet. '+
|
||||||
' ('+fmt(total)+') leva '+faixaEnvio(total)+'</b>, conforme a velocidade de upload da sua internet. '+
|
'Mantenha a página aberta.';
|
||||||
'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>';
|
|
||||||
}
|
}
|
||||||
const larguraFilme=()=>MODOS[modo].larg;
|
const larguraFilme=()=>MODOS[modo].larg;
|
||||||
// cobrança proporcional: arredonda para cima em 10 cm · 2,75 m vira 2,80 m
|
// cobrança proporcional: arredonda para cima em 10 cm · 2,75 m vira 2,80 m
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ function guardaItem(){
|
|||||||
$('foco').classList.remove('on');
|
$('foco').classList.remove('on');
|
||||||
['qual','prev'].forEach(id=>$(id).classList.remove('on'));
|
['qual','prev'].forEach(id=>$(id).classList.remove('on'));
|
||||||
modo=null; artes=[]; folhas=[]; metros=0; nota=0; montagemCm=0;
|
modo=null; artes=[]; folhas=[]; metros=0; nota=0; montagemCm=0;
|
||||||
|
pintaAvisoEnvio();
|
||||||
pintaPedido();
|
pintaPedido();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ function escolheProduto(m){
|
|||||||
}
|
}
|
||||||
function abrir(m){
|
function abrir(m){
|
||||||
modo=m; artes=[]; folhas=[]; metros=0; nota=0; reencaixado=false;
|
modo=m; artes=[]; folhas=[]; metros=0; nota=0; reencaixado=false;
|
||||||
|
pintaAvisoEnvio();
|
||||||
montagemCm=0;
|
montagemCm=0;
|
||||||
avisoTipo('');
|
avisoTipo('');
|
||||||
pintaModo();
|
pintaModo();
|
||||||
@@ -89,6 +90,7 @@ document.querySelectorAll('#tipoEnvio .cam').forEach(b=>b.addEventListener('clic
|
|||||||
function trocaTipo(destino){
|
function trocaTipo(destino){
|
||||||
if(!destino || modo===destino) return;
|
if(!destino || modo===destino) return;
|
||||||
folhas=[]; artes=[]; recemChegada=null; metros=0; nota=0; montagemCm=0;
|
folhas=[]; artes=[]; recemChegada=null; metros=0; nota=0; montagemCm=0;
|
||||||
|
pintaAvisoEnvio();
|
||||||
modo=destino;
|
modo=destino;
|
||||||
history.replaceState(history.state,'',PAGINAS[modo]); document.title=tituloPagina();
|
history.replaceState(history.state,'',PAGINAS[modo]); document.title=tituloPagina();
|
||||||
$('lista').innerHTML=''; $('rA').style.display='none'; recusa([]);
|
$('lista').innerHTML=''; $('rA').style.display='none'; recusa([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user