|
56 | 56 | background: rgba(212,175,55,0.1); |
57 | 57 | } |
58 | 58 |
|
| 59 | + /* NOVO BOTÃO P2P SOCIAL - VERDE */ |
| 60 | + .tab-p2p { |
| 61 | + background: transparent; |
| 62 | + border: 1px solid #56ab2f; |
| 63 | + color: #56ab2f; |
| 64 | + padding: 12px 25px; |
| 65 | + border-radius: 20px; |
| 66 | + cursor: pointer; |
| 67 | + transition: .3s; |
| 68 | + font-size: 1rem; |
| 69 | + } |
| 70 | + .tab-p2p:hover { |
| 71 | + background: rgba(86, 171, 47, 0.1); |
| 72 | + } |
| 73 | + .tab-p2p.active { |
| 74 | + background: rgba(86, 171, 47, 0.2); |
| 75 | + } |
| 76 | + |
59 | 77 | /* Conteúdo principal */ |
60 | 78 | .content { |
61 | 79 | background: #111; |
@@ -371,6 +389,8 @@ <h1>🌍 Painel de Autoridade — Terra Dourada</h1> |
371 | 389 | <div class="tabs"> |
372 | 390 | <button class="tab active" onclick="showTab('eleicoes')">🗳️ Minhas Eleições</button> |
373 | 391 | <button class="tab" onclick="showTab('cadastro')">➕ Nova Eleição</button> |
| 392 | + <!-- NOVO BOTÃO P2P SOCIAL --> |
| 393 | + <button class="tab-p2p" onclick="irParaRedeSocial()">🌐 P2P Social</button> |
374 | 394 | </div> |
375 | 395 |
|
376 | 396 | <!-- CONTEÚDO PRINCIPAL --> |
@@ -471,6 +491,19 @@ <h3 id="confirmationElectionName" style="color: #d4af37; margin: 10px 0 20px;">< |
471 | 491 | let tipoEleicao = 'online'; // Padrão: online |
472 | 492 | let usuarioLogado = null; // ⭐⭐ NOVA VARIÁVEL: usuário atual |
473 | 493 |
|
| 494 | +// ⭐⭐ FUNÇÃO NOVA: Ir para Rede Social P2P |
| 495 | +function irParaRedeSocial() { |
| 496 | + if (!usuarioLogado) { |
| 497 | + alert('Erro: Usuário não identificado. Faça login novamente.'); |
| 498 | + window.location.href = 'login.html'; |
| 499 | + return; |
| 500 | + } |
| 501 | + |
| 502 | + // Redirecionar para rede_social.html com o ID do usuário |
| 503 | + const userId = encodeURIComponent(usuarioLogado.email); |
| 504 | + window.location.href = `rede_social.html?user_id=${userId}`; |
| 505 | +} |
| 506 | + |
474 | 507 | // ⭐⭐ FUNÇÃO NOVA: Identificar usuário logado |
475 | 508 | async function identificarUsuarioLogado() { |
476 | 509 | try { |
@@ -510,6 +543,7 @@ <h3 id="confirmationElectionName" style="color: #d4af37; margin: 10px 0 20px;">< |
510 | 543 | function showTab(tab) { |
511 | 544 | // Atualizar abas |
512 | 545 | document.querySelectorAll('.tab').forEach(t => t.classList.remove('active')); |
| 546 | + document.querySelectorAll('.tab-p2p').forEach(t => t.classList.remove('active')); |
513 | 547 | document.querySelectorAll('[id^="tab-"]').forEach(c => c.style.display = 'none'); |
514 | 548 |
|
515 | 549 | // Ativar aba atual |
|
0 commit comments