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

De Wiki Gla
Ir para navegação Ir para pesquisar
Linha 113: Linha 113:


<style>
<style>
.infobox-boss-wide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: unset;
  background: none;
  border: none;
  border-radius: 12px;
  box-shadow: none;
  font-family: sans-serif;
  color: #222;
  overflow: hidden;
}
.infobox-boss-right {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.skill-box {
.skill-box {
   background: none;;
   background: none;;
Linha 151: Linha 129:
   margin: 0 auto 24px auto;
   margin: 0 auto 24px auto;
}
}
.infobox-skill-info-area {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  margin-top: 24px;
  gap: 12px;
}
.infobox-skill-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 0;
  width: 100%;
}
.infobox-skill-tab {
  cursor: pointer;
  background: #fff;
  color: #222;
  border: 2px solid #ffc107;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 1em;
  font-weight: bold;
  transition: 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  opacity: 0.7;
  margin-bottom: 0;
}
.infobox-skill-tab.active,
.infobox-skill-tab:hover {
  opacity: 1;
  background: #ffc107;
  color: #181f2a;
  border-color: #ffc107;
}
.skill-desc {
  font-size: 1.08em;
  width: 100%;
  text-align: center;
  font-weight: 500;
  line-height: 1.5;
  margin-top: 0;
  margin-bottom: 0;
  background: none;
  color: #222;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}
.infobox-skill-video-area {
  width: 100%;
  max-width: 900px;
  min-height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 8px;
  margin-top: 0;
  margin-bottom: 0;
  box-shadow: none;
  padding: 16px 0;
  margin-left: auto;
  margin-right: auto;
}
.skill-video {
  width: 100%;
  height: auto;
  max-width: 700px;
  border-radius: 8px;
  background: #000;
  display: block;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .infobox-boss-wide {
    min-height: unset;
  }
  .infobox-skill-info-area,
  .infobox-skill-video-area {
    max-width: 100vw;
    width: 100%;
    padding: 0 2vw;
  }
  .skill-video,
  .skill-box {
    max-width: 100vw;
    width: 100%;
  }
}
</style>
</style>

Edição das 01h08min de 21 de maio de 2025

<script> (function () {

 const raw= document.getElementById('infoboxboss-data');
 console.log(raw);
       if (!raw) {
           console.error('Persona widget: no se encontró #persona-data');
           return;
       }
       // Extração de dados
       let habilidades = [];
       const tempRawHabs = (raw.dataset.habilidadesRaw || ).trim();
       rawHabs = tempRawHabs.replace(//g, ).trim();
       rawHabs.split('||').forEach(line => {
           if (!line.trim()) return;
           const parts = line.split('|').map(x => x.trim()).filter(Boolean);
           const habData = {};
           parts.forEach(part => {
               const [key, ...valParts] = part.split('=');
               if (!key || valParts.length === 0) return;
               habData[key.trim()] = valParts.join('=').trim();
           });
           const { nome, desc = , video =  } = habData;
           if (nome) {
               habilidades.push({
                   nome,
                   descricao: desc,
                   video
               });
           } else {
               console.warn("Habilidad omitida por falta de campos obligatorios:", line);
           }
       });
 const tabsContainer = document.getElementById('skill-tabs');
 const videoContainer = document.getElementById('skill-videos');
 const descText = document.getElementById('desc-text');
 habilidades.forEach((hab, idx) => {
   const id = `video${idx + 1}`;
   // Botón
   const btn = document.createElement('button');
   btn.className = 'infobox-skill-tab' + (idx === 0 ? ' active' : );
   btn.dataset.video = id;
   btn.textContent = hab.nome;
   tabsContainer.appendChild(btn);
   // Video
   const vid = document.createElement('video');
   vid.id = id;
   vid.className = 'skill-video';
   vid.controls = true;
   vid.autoplay = false;
   vid.loop = true;
   vid.style.display = idx === 0 ?  : 'none';
   const source = document.createElement('source');
   source.src = hab.video;
   source.type = "video/mp4";
   vid.appendChild(source);
   videoContainer.appendChild(vid);
 });
 // Descripción inicial
 descText.textContent = `${habilidades[0].nome}: ${habilidades[0].descricao}`;
 // Lógica tabs
 const tabs = document.querySelectorAll('.infobox-skill-tab');
 const videos = document.querySelectorAll('.skill-video');
 tabs.forEach((tab, idx) => {
   tab.addEventListener('click', () => {
     tabs.forEach(t => t.classList.remove('active'));
     tab.classList.add('active');
     const vidId = tab.dataset.video;
     descText.textContent = `${habilidades[idx].nome}: ${habilidades[idx].descricao}`;
     videos.forEach(v => {
       if (v.id === vidId) {
         v.style.display = ;
         v.load();
         v.play();
       } else {
         v.pause();
         v.style.display = 'none';
       }
     });
   });
 });
 document.getElementById('infoboxboss-data')?.remove();

})(); </script>


<style> .skill-box {

 background: none;;
 color: #222;
 border-radius: 12px;
 box-shadow: none;
 width: 100%;
 max-width: 700px;
 box-sizing: border-box;
 padding: 24px 24px 20px 24px;
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 18px;
 backdrop-filter: blur(2px);
 margin: 0 auto 24px auto;

} </style>