Skip to content

Commit

Permalink
Bug no CEP e reponsividade
Browse files Browse the repository at this point in the history
Consertado o bug na busca por CEP e adição da responsividade no formulário para smartphones
  • Loading branch information
wellingtonfernandesbarbosa committed Jun 24, 2023
1 parent be0eb5c commit 17a4196
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ async function buscaEndereco(cep) {
mensagemErro.innerHTML = "";

try {
var consultaCEP = await fetch(`http://viacep.com.br/ws/${cep}/json/`);
var consultaCEP = await fetch(`https://viacep.com.br/ws/${cep}/json/`);
var consultaCEPConvertida = await consultaCEP.json();

if (consultaCEPConvertida.erro){
Expand Down
16 changes: 16 additions & 0 deletions styles/cadastro.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
.principal {
margin: 2em 1em 6em 1em;
width: auto;
}

.principal__formulario {
height: auto;
}

.cadastro {
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
border-radius: 10px;
Expand All @@ -15,4 +24,11 @@

.mensagemDeErro {
margin-left: 1em;
}

@media screen and (min-width: 1024px) {
.principal {
width: 50vw;
margin: 5em auto 6em auto;
}
}
17 changes: 10 additions & 7 deletions styles/formulario.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.principal {
width: 50vw;
margin: 5em auto 6em auto;
}

.principal__titulo {
font-style: normal;
font-weight: 700;
Expand Down Expand Up @@ -45,7 +40,8 @@

.formulario__botao {
background: var(--laranja);
padding: 1em 4em;
padding: 0.7em 2em;
margin-right: 1em;
font-weight: 700;
font-size: 20px;
line-height: 30px;
Expand Down Expand Up @@ -74,4 +70,11 @@
font-size: 12px;
line-height: 18px;
color: var(--vermelho);
}
}


@media screen and (min-width: 1024px) {
.formulario__botao {
padding: 1em 4em;
}
}

1 comment on commit 17a4196

@vercel
Copy link

@vercel vercel bot commented on 17a4196 Jun 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.