Skip to content

Commit eae1cd1

Browse files
authored
Update autoridade.html
1 parent 02f2553 commit eae1cd1

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

autoridade.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@
5656
background: rgba(212,175,55,0.1);
5757
}
5858

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+
5977
/* Conteúdo principal */
6078
.content {
6179
background: #111;
@@ -371,6 +389,8 @@ <h1>🌍 Painel de Autoridade — Terra Dourada</h1>
371389
<div class="tabs">
372390
<button class="tab active" onclick="showTab('eleicoes')">🗳️ Minhas Eleições</button>
373391
<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>
374394
</div>
375395

376396
<!-- CONTEÚDO PRINCIPAL -->
@@ -471,6 +491,19 @@ <h3 id="confirmationElectionName" style="color: #d4af37; margin: 10px 0 20px;"><
471491
let tipoEleicao = 'online'; // Padrão: online
472492
let usuarioLogado = null; // ⭐⭐ NOVA VARIÁVEL: usuário atual
473493

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+
474507
// ⭐⭐ FUNÇÃO NOVA: Identificar usuário logado
475508
async function identificarUsuarioLogado() {
476509
try {
@@ -510,6 +543,7 @@ <h3 id="confirmationElectionName" style="color: #d4af37; margin: 10px 0 20px;"><
510543
function showTab(tab) {
511544
// Atualizar abas
512545
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
546+
document.querySelectorAll('.tab-p2p').forEach(t => t.classList.remove('active'));
513547
document.querySelectorAll('[id^="tab-"]').forEach(c => c.style.display = 'none');
514548

515549
// Ativar aba atual

0 commit comments

Comments
 (0)