Skip to content

Commit

Permalink
trocada coluna whatsapp por celular. Melhorado layout de impressão
Browse files Browse the repository at this point in the history
  • Loading branch information
saadbruno committed Aug 14, 2024
1 parent 9fcbc82 commit f9cb21f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
20 changes: 17 additions & 3 deletions parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function printListaImpressao(sortedData) {
<div class='col'>Patrô</div>
<div class='col'>Prancha</div>
<div class='col'>Contato de emergencia</div>
<div class='col'>Whatsapp</div>
<div class='col'>Celular</div>
</div>
<div class='separador'></div>
Expand Down Expand Up @@ -192,7 +192,7 @@ function printListaImpressao(sortedData) {
<div class='separador'></div>
<div class='stance'><img class='icone' src='img/stance.svg'>${atleta['stance']}</div>
<div class='instagram'><img class='icone' src='img/instagram.svg'>${atleta['Instagram']}</div>
<div class='camiseta'><img class='icone' src='img/camiseta.svg'>${atleta['Camiseta do Kit Atleta']}</div>
<div class='camiseta'><img class='icone' src='img/camiseta.svg'>${atleta['Camiseta do Kit Atleta'] || ""}</div>
<div class='col cidade'><img class='icone' src='img/cidade.svg'>${atleta['Cidade']} - ${atleta['UF']}</div>
</div>
Expand All @@ -202,7 +202,7 @@ function printListaImpressao(sortedData) {
<div class='col patrocinadores'>${atleta['patrocinadores']}</div>
<div class='col prancha'>${atleta['prancha']}</div>
<div class='col contato_de_emergencia'>${atleta['contato_de_emergencia']}</div>
<div class='col whatsapp'>${atleta['whatsapp']}</div>
<div class='col celular'>${phoneMask(atleta['Celular'])}</div>
</div>`;
});
Expand Down Expand Up @@ -240,4 +240,18 @@ function calculateAge(birthDateString) {
}

return age;
}

// formata numero de celular
function phoneMask(value) {
if (!value) return "";
value = value.replace(/\D/g, '');
if (value.startsWith(`55`)) {
value = value.replace(/(\d{2})(\d{2})(\d)/, "($2) $3");
value = value.replace(/(\d)(\d{4})$/, "$1-$2");
} else {
value = value.replace(/(\d{2})(\d)/, "($1) $2");
value = value.replace(/(\d)(\d{4})$/, "$1-$2");
}
return value
}
17 changes: 11 additions & 6 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@
}

.header {
padding: 1mm 3mm;
column-gap: 4mm;
font-weight: 700;
background-color: #f0f0f0;
}

padding: 1mm 3mm;
column-gap: 4mm;
font-weight: 700;
background-color: #f0f0f0;
}

.atleta {
display: flex;
Expand Down Expand Up @@ -79,6 +78,9 @@
width: 100%;
}

.col.celular {
text-wrap: nowrap;
}

/* utilidades */

Expand All @@ -88,6 +90,9 @@
}
.col {
flex: 1 0 0%;
white-space: break-spaces;
text-wrap: balance;
word-break: break-word;
}

.col-auto {
Expand Down

0 comments on commit f9cb21f

Please sign in to comment.