[WIP] Implement server to parse address #1

Draft
joao.dubas wants to merge 17 commits from jpd-add-parser-server into main
3 changed files with 98 additions and 98 deletions
Showing only changes of commit f4e4181785 - Show all commits

View File

@ -1,100 +1,100 @@
:root { :root {
--bg-color: #131415; --bg-color: #131415;
--primary-color: #9575CD; --primary-color: #9575CD;
--margin: 40px; --margin: 40px;
--margin-sm: 20px; --margin-sm: 20px;
--radius: 6px; --radius: 6px;
--text-color: #FFF; --text-color: #FFF;
--header-height: 100px; --header-height: 100px;
} }
body { body {
margin: 0; margin: 0;
background: var(--bg-color); background: var(--bg-color);
color: var(--text-color); color: var(--text-color);
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
} }
ul { ul {
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style-type: none; list-style-type: none;
} }
header { header {
background: #24292d; background: #24292d;
height: var(--header-height); height: var(--header-height);
} }
header ul { header ul {
display: flex; display: flex;
} }
header ul li { header ul li {
height: var(--header-height); height: var(--header-height);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 0 var(--margin-sm); padding: 0 var(--margin-sm);
} }
header ul li h5 { header ul li h5 {
font-size: 24px; font-size: 24px;
font-weight: 400; font-weight: 400;
margin: 0; margin: 0;
} }
header ul li h6 { header ul li h6 {
font-size: 14px; font-size: 14px;
font-weight: 100; font-weight: 100;
margin: 5px 0 0; margin: 5px 0 0;
} }
header ul li h5 strong { header ul li h5 strong {
color: #81c784; color: #81c784;
} }
section { section {
height: calc(100vh - var(--header-height)); height: calc(100vh - var(--header-height));
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
section input { section input {
height: 60px; height: 60px;
line-height: 60px; line-height: 60px;
background: transparent; background: transparent;
border: 2px solid var(--primary-color); border: 2px solid var(--primary-color);
border-radius: var(--radius); border-radius: var(--radius);
color: var(--text-color); color: var(--text-color);
font-size: 20px; font-size: 20px;
outline: none !important; outline: none !important;
padding: 0 20px; padding: 0 20px;
width: 300px; width: 300px;
margin-top: var(--margin); margin-top: var(--margin);
} }
#search-results ul li { #search-results ul li {
color: #FFF; color: #FFF;
display: flex; display: flex;
} }
#search-results ul li button { #search-results ul li button {
align-self: center; align-self: center;
height: 34px; height: 34px;
padding: 0 15px; padding: 0 15px;
border: 0; border: 0;
border-radius: var( --radius); border-radius: var( --radius);
margin-left: var(--margin-sm); margin-left: var(--margin-sm);
background: var(--primary-color); background: var(--primary-color);
color: #FFF; color: #FFF;
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
cursor: pointer; cursor: pointer;
} }
#spinner { #spinner {
display: none; display: none;
} }

View File

@ -1,18 +1,18 @@
<dl> <dl>
<dt>Logradouro</dt> <dt>Logradouro</dt>
<dd>{{ .Result.Road }}</dd> <dd>{{ .Result.Road }}</dd>
<dt>N&uacute;mero</dt> <dt>N&uacute;mero</dt>
<dd>{{ .Result.HouseNumber }}</dd> <dd>{{ .Result.HouseNumber }}</dd>
<dt>Unidade</dt> <dt>Unidade</dt>
<dd>{{ .Result.Unit }}</dd> <dd>{{ .Result.Unit }}</dd>
<dt>Torre</dt> <dt>Torre</dt>
<dd>{{ .Result.House }}</dd> <dd>{{ .Result.House }}</dd>
<dt>Bairro</dt> <dt>Bairro</dt>
<dd>{{ .Result.Neighborhood }}</dd> <dd>{{ .Result.Neighborhood }}</dd>
<dt>Cidade</dt> <dt>Cidade</dt>
<dd>{{ .Result.City }}</dd> <dd>{{ .Result.City }}</dd>
<dt>Estado</dt> <dt>Estado</dt>
<dd>{{ .Result.Estado }}</dd> <dd>{{ .Result.State }}</dd>
<dt><abbr title="C&oacute; de Endere&ccedil;amento Postal">CEP</abbr></dt> <dt><abbr title="C&oacute;digo de Endere&ccedil;amento Postal">CEP</abbr></dt>
<dd>{{ .Result.PostalCode }}</dd> <dd>{{ .Result.PostalCode }}</dd>
</dl> </dl>

View File

@ -1,27 +1,27 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="pt-BR"> <html lang="pt-BR">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Parser de Endere&ccedil;o</title> <title>Parser de Endere&ccedil;o</title>
<script src="https://unpkg.com/htmx.org@1.9.10"></script> <script src="https://unpkg.com/htmx.org@1.9.10"></script>
<link rel="stylesheet" href="/static/index.css"/> <link rel="stylesheet" href="/static/css/index.css"/>
</head> </head>
<body> <body>
<main> <main>
<section> <section>
<div> <div>
<input <input
type="search" type="search"
name="address" name="address"
placeholder="Endereço: Rua, Número, Complement. Bairro - Cidade/Estado. CEP" placeholder="Endereço: Rua, Número, Complement. Bairro - Cidade/Estado. CEP"
hx-get="/parse" hx-get="/parse"
hx-trigger="keyup changed delay:500ms" hx-trigger="keyup changed delay:500ms"
hx-target="#address" /> hx-target="#address" />
</div> </div>
<div id="address"></div> <div id="address"></div>
</section> </section>
</main> </main>
</body> </body>
</html> </html>