.oxi-profiles-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1.5rem;
max-width: 1000px;
margin: 3rem auto;
padding: 0 1.5rem;
}
.oxi-profile-card {
background: #ffffff;
border: 2px solid #e2e8f0;
border-radius: 16px;
padding: 2rem 1.5rem;
text-align: center;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
}
.oxi-profile-card:hover {
transform: translateY(-5px);
border-color: #0ea5e9;
box-shadow: 0 12px 24px rgba(14, 165, 233, 0.15);
}
.oxi-profile-card.selected {
border-color: #0ea5e9;
background: #f0f9ff;
box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}
.oxi-profile-emoji {
font-size: 3.5rem;
line-height: 1;
margin-bottom: 1rem;
}
.oxi-profile-title {
font-size: 1.25rem;
font-weight: 700;
color: #0f172a;
margin-bottom: 0.5rem;
}
.oxi-profile-desc {
font-size: 0.95rem;
color: #64748b;
line-height: 1.4;
}
.oxi-org-fields {
max-width: 600px;
margin: 2rem auto;
padding: 2rem;
background: #f8fafc;
border-radius: 12px;
border: 1px solid #e2e8f0;
display: none;
}
.oxi-org-fields.active {
display: block;
animation: fadeIn 0.4s ease;
}
.oxi-form-group {
margin-bottom: 1.5rem;
text-align: left;
}
.oxi-form-group label {
display: block;
font-weight: 600;
color: #334155;
margin-bottom: 0.5rem;
}
.oxi-form-group input {
width: 100%;
padding: 0.75rem 1rem;
border: 1px solid #cbd5e1;
border-radius: 8px;
font-size: 1rem;
}
.oxi-btn-finish {
display: block;
width: 100%;
max-width: 400px;
margin: 3rem auto;
padding: 1.25rem;
background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
color: white;
font-size: 1.25rem;
font-weight: 700;
border: none;
border-radius: 99px;
cursor: pointer;
transition: opacity 0.3s;
opacity: 0.5;
pointer-events: none;
}
.oxi-btn-finish.ready {
opacity: 1;
pointer-events: auto;
box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}
.oxi-btn-finish.ready:hover {
opacity: 0.9;
}
.oxi-btn-finish.loading {
opacity: 0.7;
pointer-events: none;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
document.addEventListener(‘DOMContentLoaded’, function() {
const cards = document.querySelectorAll(‘.oxi-profile-card’);
const btn = document.getElementById(‘oxi-btn-finish’);
const orgFields = document.getElementById(‘oxi-org-fields’);
const orgNameInput = document.getElementById(‘org_name’);
const orgRoleInput = document.getElementById(‘org_role’);
let selectedProfile = ”;
let needsOrg = false;
// Verificar se WP Rest API URL está disponível, senão montar manual
const apiUrl = (window.wpApiSettings && window.wpApiSettings.root) ?
window.wpApiSettings.root + ‘oxigenius/v1/set-profile’ :
‘/wp-json/oxigenius/v1/set-profile’;
const nonce = (window.wpApiSettings && window.wpApiSettings.nonce) ?
window.wpApiSettings.nonce : ”;
function checkReady() {
let isReady = false;
if (selectedProfile) {
if (needsOrg) {
isReady = (orgNameInput.value.trim() !== ” && orgRoleInput.value.trim() !== ”);
} else {
isReady = true;
}
}
if (isReady) {
btn.classList.add(‘ready’);
} else {
btn.classList.remove(‘ready’);
}
}
cards.forEach(card => {
card.addEventListener(‘click’, () => {
cards.forEach(c => c.classList.remove(‘selected’));
card.classList.add(‘selected’);
selectedProfile = card.dataset.profile;
needsOrg = card.dataset.needsOrg === ‘true’;
if (needsOrg) {
orgFields.classList.add(‘active’);
} else {
orgFields.classList.remove(‘active’);
}
checkReady();
});
});
orgNameInput.addEventListener(‘input’, checkReady);
orgRoleInput.addEventListener(‘input’, checkReady);
btn.addEventListener(‘click’, async () => {
if (!btn.classList.contains(‘ready’)) return;
btn.classList.add(‘loading’);
btn.textContent = ‘Salvando…’;
try {
const res = await fetch(apiUrl, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
‘X-WP-Nonce’: nonce
},
body: JSON.stringify({
profile: selectedProfile,
org_name: needsOrg ? orgNameInput.value.trim() : ”,
org_role: needsOrg ? orgRoleInput.value.trim() : ”
})
});
const data = await res.json();
if (data.success && data.redirect) {
btn.textContent = ‘Sucesso! Redirecionando…’;
window.location.href = data.redirect;
} else {
alert(‘Ocorreu um erro ao salvar o perfil. Tente novamente.’);
btn.classList.remove(‘loading’);
btn.textContent = ‘Concluir meu Perfil’;
}
} catch (e) {
console.error(e);
alert(‘Erro de conexão.’);
btn.classList.remove(‘loading’);
btn.textContent = ‘Concluir meu Perfil’;
}
});
});
👧
Criança
Jogos, vídeos, atividades e muita diversão segura!
👪
Pai ou Responsável
Acompanhamento e acesso ao portal de conteúdos.
👩🏫
Professor(a)
Planos de aula, certificados e gestão de turmas.
🎓
Pesquisador(a)
Acesso a dados, estudos e publicações científicas.
🏫
Escola / Ensino
Representantes de colégios, creches ou universidades.
🏛️
Governo
Órgãos federais, estaduais e municipais.
🏥
Instituição de Saúde
Hospitais, clínicas e profissionais de saúde.
🏢
Empresa Privada
Iniciativas ESG e soluções de qualidade do ar.
🤝
Organização Parceira
ONGs, associações e entidades técnicas.
🛒
Cliente da Loja
Quero apenas comprar livros e produtos físicos.
