diff --git a/parser.js b/parser.js index 15352e0..de39b00 100644 --- a/parser.js +++ b/parser.js @@ -160,7 +160,7 @@ function printListaImpressao(sortedData) {
PatrĂ´
Prancha
Contato de emergencia
-
Whatsapp
+
Celular
@@ -192,7 +192,7 @@ function printListaImpressao(sortedData) {
${atleta['stance']}
${atleta['Instagram']}
-
${atleta['Camiseta do Kit Atleta']}
+
${atleta['Camiseta do Kit Atleta'] || ""}
${atleta['Cidade']} - ${atleta['UF']}
@@ -202,7 +202,7 @@ function printListaImpressao(sortedData) {
${atleta['patrocinadores']}
${atleta['prancha']}
${atleta['contato_de_emergencia']}
-
${atleta['whatsapp']}
+
${phoneMask(atleta['Celular'])}
`; }); @@ -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 } \ No newline at end of file diff --git a/style.css b/style.css index bd773be..25425f4 100644 --- a/style.css +++ b/style.css @@ -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; @@ -79,6 +78,9 @@ width: 100%; } +.col.celular { + text-wrap: nowrap; +} /* utilidades */ @@ -88,6 +90,9 @@ } .col { flex: 1 0 0%; + white-space: break-spaces; + text-wrap: balance; + word-break: break-word; } .col-auto {