Mudanças entre as edições de "Widget:BossActions"

De Wiki Gla
Ir para navegação Ir para pesquisar
 
Etiqueta: Reversão manual
 
(8 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 1: Linha 1:
<noinclude>
Widget para controle de abas.
</noinclude>
<includeonly>
<script>
<script>
/* Função para trocar de aba (seção)
/*<![CDATA[*/
  sectionId: O ID da div que deve aparecer
window.showBossSection = function(sectionId, btnElement) {
  buttonElement: O próprio botão clicado para mudar a classe 'active'
     // 1. Esconde tudo o que for seção
*/
     var sections = document.getElementsByClassName('boss-section');
function showBossSection(sectionId, buttonElement) {
     for (var i = 0; i < sections.length; i++) {
     // 1. Esconder todas as seções de conteúdo
        sections[i].style.setProperty('display', 'none', 'important');
     const sections = document.querySelectorAll('.boss-content-section');
         sections[i].classList.remove('active');
     sections.forEach(sec => {
    }
         sec.classList.remove('active');
 
         sec.style.display = 'none'; // Garantia extra de esconder
    // 2. Remove active dos botões
     });
    var buttons = btnElement.parentElement.getElementsByClassName('boss-nav-btn');
    for (var j = 0; j < buttons.length; j++) {
         buttons[j].classList.remove('active');
     }


     // 2. Mostrar a seção selecionada
     // 3. Mostra a seção clicada
     const targetSection = document.getElementById(sectionId);
     var target = document.getElementById(sectionId);
     if (targetSection) {
     if (target) {
         targetSection.classList.add('active');
         target.style.setProperty('display', 'block', 'important');
         targetSection.style.display = 'block';
         target.classList.add('active');
     }
     }
    btnElement.classList.add('active');
};
/*]]>*/
</script>
</includeonly>


    // 3. Remover classe 'active' de todos os botões da barra de navegação
<noinclude>
     // Procuramos os botões que estão no mesmo container do botão clicado
Widget genérico para estruturar páginas de Bosses.
     const navBar = buttonElement.parentElement;
Uso: {{#widget:BossActions}}
    const buttons = navBar.querySelectorAll('.btn-boss-action');
</noinclude>
    buttons.forEach(btn => {
<includeonly>
         btn.classList.remove('active');
<style>
     });
     /* Reaproveitando o padrão da Home do GLA */
     .boss-grid-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
         padding: 10px;
     }


     // 4. Adicionar classe 'active' ao botão clicado
     /* Estilo de Card idêntico ao da Home */
     buttonElement.classList.add('active');
    .boss-card-item {
}
        width: 100%;
</script>
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border: 1px solid #bbb;
        border-radius: 12px;
        background: #fff;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
 
     .boss-card-item:hover {
        transform: translateY(-3px);
        border-color: #007bff;
        box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    }
 
    .boss-card-header {
        height: 4px;
        width: 100%;
    }
 
    .boss-card-title {
        font-weight: bold;
        padding: 10px;
        text-align: center;
        background: #f8f9fa;
        color: #0645AD;
        border-bottom: 1px solid #eee;
        text-transform: uppercase;
    }
 
    /* Ajuste para o Tabber parecer botões */
    .tabber__tabs {
        display: flex !important;
        justify-content: center !important;
        gap: 10px !important;
        border-bottom: none !important;
        margin-bottom: 20px !important;
    }
 
    .tabber__tab {
        background: #fff !important;
        border: 1px solid #007bff !important;
        border-radius: 8px !important;
        padding: 8px 20px !important;
        color: #007bff !important;
        font-weight: bold !important;
        transition: 0.3s !important;
    }
 
    .tabber__tab[aria-selected="true"] {
        background: #007bff !important;
        color: white !important;
    }
 
    /* Container de Scroll */
    .boss-scroll-box {
        max-height: 300px;
        overflow-y: auto;
        padding: 10px;
    }
</style>
</includeonly>

Edição atual tal como às 20h35min de 21 de abril de 2026

Widget para controle de abas.



Widget genérico para estruturar páginas de Bosses. Uso: