Jss:
/* Script para INJETAR o Tema na Ereemby (Com Radar de Página) */
(function() {
function injetarTema() {
if (document.getElementById(‘tema-gerado-apx’)) return;
if(!document.querySelector(‘link[href*=”fontawesome”]’)) {
const fa = document.createElement(‘link’);
fa.rel = ‘stylesheet’;
fa.href = ‘https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css’;
document.head.appendChild(fa);
}
const htmlDoPainel = <div class=”hero-section” id=”tema-gerado-apx”>
<div class=”container-hero”>
<div class=”hero-container”>
<div class=”hero-presentation”>
<h1 class=”hero-title”>Sua experiência gamer, elevada a <span>outro nível</span>.</h1>
<p class=”hero-subtitle”>Seu fornecedor de confiança para assinaturas e produtos digitais com os melhores preços.</p>
<div class=”hero-buttons”>
<a href=”https://wa.me/5511999999999″ class=”hero-btn hero-btn-primary”>Suporte WhatsApp</a>
<a href=”https://discord.gg/…” class=”hero-btn hero-btn-secondary”>Comunidade</a>
</div>
</div>
<div class=”control-panel”>
<div class=”panel-header”>
<div class=”panel-icon-bg”><i class=”fa-solid fa-house”></i></div>
<h3>Painel de Controle</h3>
</div>
<div class=”panel-grid”>
<a href=”#” class=”panel-item”>
<i class=”fa-solid fa-store”></i>
<h4>Ver Produtos</h4>
<p>Explore o catálogo</p>
</a>
<a href=”https://instagram.com/…” class=”panel-item”>
<i class=”fa-brands fa-instagram”></i>
<h4>Instagram</h4>
<p>Siga nossas novidades!</p>
</a>
<a href=”#” class=”panel-item”>
<i class=”fa-solid fa-briefcase”></i>
<h4>Meus Pedidos</h4>
<p>Acompanhe compras</p>
</a>
<a href=”#” class=”panel-item”>
<i class=”fa-solid fa-users”></i>
<h4>Afiliados</h4>
<p>Ganhe comissões!</p>
</a>
</div>
</div>
</div>
</div>
</div>;
let navBar = document.querySelector(‘header’) || document.querySelector(‘nav’);
if (!navBar) {
let search = document.querySelector(‘input[type=”search”]’) document.querySelector(‘input[placeholder*=”produto” i]’) document.querySelector(‘input[placeholder*=”pesquisar” i]’);
if (search) {
navBar = search.closest(‘div[class*=”header”]’) || search.parentElement.parentElement.parentElement;
}
}
if (navBar) {
navBar.insertAdjacentHTML(‘afterend’, htmlDoPainel);
} else {
const root = document.querySelector(‘#__next’) || document.body;
if (root.children.length > 0) {
root.children[0].insertAdjacentHTML(‘afterend’, htmlDoPainel);
} else {
root.insertAdjacentHTML(‘afterbegin’, htmlDoPainel);
}
}
}
function gerenciarVisibilidade() {const isHome = (window.location.pathname === ‘/’ || window.location.pathname === ‘/index.html’);
let tema = document.getElementById(‘tema-gerado-apx’);
if (isHome) {
if (!tema) {
injetarTema();
} else {
tema.style.display = ”;
}
} else {
if (tema) {
tema.style.display = ‘none’;
}
}
}
setInterval(gerenciarVisibilidade, 500);
gerenciarVisibilidade();
})();