Update index.html
Browse files- index.html +107 -1
index.html
CHANGED
|
@@ -214,7 +214,113 @@
|
|
| 214 |
<!-- Content Section -->
|
| 215 |
<section class="container mx-auto px-4 py-12 max-w-4xl">
|
| 216 |
<div class="bg-white rounded-lg shadow-lg p-8">
|
| 217 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
</div>
|
| 219 |
<span style="display: inline-block; height: 0;">
|
| 220 |
</span>
|
|
|
|
| 214 |
<!-- Content Section -->
|
| 215 |
<section class="container mx-auto px-4 py-12 max-w-4xl">
|
| 216 |
<div class="bg-white rounded-lg shadow-lg p-8">
|
| 217 |
+
<div class="container">
|
| 218 |
+
<h1>Busca de Estados Brasileiros</h1>
|
| 219 |
+
|
| 220 |
+
<form class="search-form" onsubmit="buscarEstado(event)">
|
| 221 |
+
<div class="input-group">
|
| 222 |
+
<input
|
| 223 |
+
type="text"
|
| 224 |
+
id="estadoInput"
|
| 225 |
+
placeholder="Digite a sigla (ex: SP) ou nome do estado (ex: S茫o Paulo)"
|
| 226 |
+
autocomplete="off"
|
| 227 |
+
>
|
| 228 |
+
<button type="submit" class="btn-acessar">Acessar</button>
|
| 229 |
+
</div>
|
| 230 |
+
</form>
|
| 231 |
+
|
| 232 |
+
<div class="help-text">
|
| 233 |
+
Digite a sigla (AC, AL, AM...) ou o nome completo do estado brasileiro
|
| 234 |
+
</div>
|
| 235 |
+
</div>
|
| 236 |
+
|
| 237 |
+
<!-- Modal -->
|
| 238 |
+
<div id="errorModal" class="modal">
|
| 239 |
+
<div class="modal-content">
|
| 240 |
+
<div class="modal-header">Resultado da pesquisa</div>
|
| 241 |
+
<div class="modal-body">Unidade n茫o encontrada. Tente novamente</div>
|
| 242 |
+
<button class="btn-ok" onclick="fecharModal()">OK</button>
|
| 243 |
+
</div>
|
| 244 |
+
</div>
|
| 245 |
+
|
| 246 |
+
<script>
|
| 247 |
+
// Dados dos estados brasileiros
|
| 248 |
+
const statesData = {
|
| 249 |
+
'AC': 'www.pge.ac.gov.br/', 'ACRE': 'www.pge.ac.gov.br/',
|
| 250 |
+
'AL': 'http://www.pge.al.gov.br/', 'ALAGOAS': 'http://www.pge.al.gov.br/',
|
| 251 |
+
'AM': 'http://www.pge.am.gov.br/', 'AMAZONAS': 'http://www.pge.am.gov.br/',
|
| 252 |
+
'AP': 'http://www.pge.ap.gov.br/', 'AMAP脕': 'http://www.pge.ap.gov.br/', 'AMAPA': 'http://www.pge.ap.gov.br/',
|
| 253 |
+
'BA': 'http://www.pge.ba.gov.br/', 'BAHIA': 'http://www.pge.ba.gov.br/',
|
| 254 |
+
'CE': 'http://www.pge.ce.gov.br/', 'CEAR脕': 'http://www.pge.ce.gov.br/', 'CEARA': 'http://www.pge.ce.gov.br/',
|
| 255 |
+
'DF': 'http://www.pg.df.gov.br/', 'DISTRITO FEDERAL': 'http://www.pg.df.gov.br/',
|
| 256 |
+
'ES': 'http://www.pge.es.gov.br/', 'ESP脥RITO SANTO': 'http://www.pge.es.gov.br/', 'ESPIRITO SANTO': 'http://www.pge.es.gov.br/',
|
| 257 |
+
'GO': 'http://www.procuradoria.go.gov.br/', 'GOI脕S': 'http://www.procuradoria.go.gov.br/', 'GOIAS': 'http://www.procuradoria.go.gov.br/',
|
| 258 |
+
'MA': 'http://www.pge.ma.gov.br/', 'MARANH脙O': 'http://www.pge.ma.gov.br/', 'MARANHAO': 'http://www.pge.ma.gov.br/',
|
| 259 |
+
'MG': 'http://www.pge.mg.gov.br/', 'MINAS GERAIS': 'http://www.pge.mg.gov.br/',
|
| 260 |
+
'MS': 'http://www.pge.ms.gov.br/', 'MATO GROSSO DO SUL': 'http://www.pge.ms.gov.br/',
|
| 261 |
+
'MT': 'http://www.pge.mt.gov.br/', 'MATO GROSSO': 'http://www.pge.mt.gov.br/',
|
| 262 |
+
'PA': 'http://www.pge.pa.gov.br/', 'PAR脕': 'http://www.pge.pa.gov.br/', 'PARA': 'http://www.pge.pa.gov.br/',
|
| 263 |
+
'PB': 'http://www.pge.pb.gov.br/', 'PARA脥BA': 'http://www.pge.pb.gov.br/', 'PARAIBA': 'http://www.pge.pb.gov.br/',
|
| 264 |
+
'PE': 'http://www.pge.pe.gov.br/', 'PERNAMBUCO': 'http://www.pge.pe.gov.br/',
|
| 265 |
+
'PI': 'http://www.pge.pi.gov.br/', 'PIAU脥': 'http://www.pge.pi.gov.br/', 'PIAUI': 'http://www.pge.pi.gov.br/',
|
| 266 |
+
'PR': 'http://www.pge.pr.gov.br/', 'PARAN脕': 'http://www.pge.pr.gov.br/', 'PARANA': 'http://www.pge.pr.gov.br/',
|
| 267 |
+
'RJ': 'http://www.pge.rj.gov.br/', 'RIO DE JANEIRO': 'http://www.pge.rj.gov.br/',
|
| 268 |
+
'RN': 'http://www.pge.rn.gov.br/', 'RIO GRANDE DO NORTE': 'http://www.pge.rn.gov.br/',
|
| 269 |
+
'RO': 'http://www.pge.ro.gov.br/', 'ROND脭NIA': 'http://www.pge.ro.gov.br/', 'RONDONIA': 'http://www.pge.ro.gov.br/',
|
| 270 |
+
'RR': 'http://www.pge.rn.gov.br/', 'RORAIMA': 'http://www.pge.rn.gov.br/',
|
| 271 |
+
'RS': 'http://www.pge.rs.gov.br/', 'RIO GRANDE DO SUL': 'http://www.pge.rs.gov.br/',
|
| 272 |
+
'SC': 'http://www.pge.sc.gov.br/', 'SANTA CATARINA': 'http://www.pge.sc.gov.br/',
|
| 273 |
+
'SE': 'http://www.pge.se.gov.br/', 'SERGIPE': 'http://www.pge.se.gov.br/',
|
| 274 |
+
'SP': 'http://www.pge.sp.gov.br/', 'S脙O PAULO': 'http://www.pge.sp.gov.br/', 'SAO PAULO': 'http://www.pge.sp.gov.br/',
|
| 275 |
+
'TO': 'http://www.pge.to.gov.br/', 'TOCANTINS': 'http://www.pge.to.gov.br/'
|
| 276 |
+
};
|
| 277 |
+
|
| 278 |
+
function buscarEstado(event) {
|
| 279 |
+
event.preventDefault();
|
| 280 |
+
|
| 281 |
+
const input = document.getElementById('estadoInput');
|
| 282 |
+
const busca = input.value.trim().toUpperCase();
|
| 283 |
+
|
| 284 |
+
if (!busca) {
|
| 285 |
+
mostrarModal();
|
| 286 |
+
return;
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
const url = statesData[busca];
|
| 290 |
+
|
| 291 |
+
if (url) {
|
| 292 |
+
// Adiciona protocolo se n茫o existir
|
| 293 |
+
const urlCompleta = url.startsWith('http') ? url : 'http://' + url;
|
| 294 |
+
window.open(urlCompleta, '_blank');
|
| 295 |
+
input.value = ''; // Limpa o campo ap贸s busca bem-sucedida
|
| 296 |
+
} else {
|
| 297 |
+
mostrarModal();
|
| 298 |
+
}
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
function mostrarModal() {
|
| 302 |
+
document.getElementById('errorModal').style.display = 'block';
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
function fecharModal() {
|
| 306 |
+
document.getElementById('errorModal').style.display = 'none';
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
// Fechar modal ao clicar fora dele
|
| 310 |
+
window.onclick = function(event) {
|
| 311 |
+
const modal = document.getElementById('errorModal');
|
| 312 |
+
if (event.target === modal) {
|
| 313 |
+
fecharModal();
|
| 314 |
+
}
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
// Permitir busca ao pressionar Enter
|
| 318 |
+
document.getElementById('estadoInput').addEventListener('keypress', function(event) {
|
| 319 |
+
if (event.key === 'Enter') {
|
| 320 |
+
buscarEstado(event);
|
| 321 |
+
}
|
| 322 |
+
});
|
| 323 |
+
</script>
|
| 324 |
</div>
|
| 325 |
<span style="display: inline-block; height: 0;">
|
| 326 |
</span>
|