Mudanças entre as edições de "Widget:Droflax"
Ir para navegação
Ir para pesquisar
${skin.tooltip} ">
m (Limpou toda a página) Etiqueta: anulando |
|||
| Linha 1: | Linha 1: | ||
<div class="personaje-box"> | |||
<div class="personaje-header"> | |||
<div class="personaje-info"> | |||
<div class="nome"></div> | |||
<div class="tier"></div> | |||
<div class="classe"></div> | |||
</div> | |||
<img class="art-personaje" alt="Arte del personaje" /> | |||
<div class="personaje-tabs"> | |||
<button class="tab-btn active" data-tab="habilidades">Habilidades</button> | |||
<button class="tab-btn" data-tab="skins">Skins</button> | |||
</div> | |||
</div> | |||
<div class="tab-content active" id="habilidades"> | |||
<div class="cuadros-container"></div> | |||
<div class="habilidades-container"> | |||
<div class="habilidades-details"> | |||
<div class="descripcion-container"></div> | |||
<div class="atributos-container"></div> | |||
</div> | |||
<div class="video-container"></div> | |||
</div> | |||
</div> | |||
<div class="tab-content" id="skins"></div> | |||
</div> | |||
<script type="text/javascript"> | |||
(function () { | |||
const dataEl = document.getElementById('persona-data'); | |||
if (!dataEl) { | |||
console.error('Persona widget: no se encontró #persona-data'); | |||
return; | |||
} | |||
// Extração de dados | |||
const nome = dataEl.dataset.nome || ''; | |||
const tier = dataEl.dataset.tier || ''; | |||
const classe = dataEl.dataset.classe || ''; | |||
const image = dataEl.dataset.image || ''; | |||
let habilidades = []; | |||
let skins = []; | |||
const tempRawHabs = (dataEl.dataset.habilidadesRaw || '').trim(); | |||
let tempRawSkins = (dataEl.dataset.skinsRaw || '').trim(); | |||
rawSkins = tempRawSkins.replace(/<!--[\s\S]*?-->/g, '').trim(); | |||
rawHabs = tempRawHabs.replace(/<!--[\s\S]*?-->/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(); // por si hay "=" en el valor | |||
}); | |||
const { nome, icon, level, desc = '', atr, video = '' } = habData; | |||
if (nome && icon && level && atr) { | |||
habilidades.push({ | |||
nome, | |||
icon, | |||
level: parseInt(level), | |||
descripcion: desc, // estará vacío si no fue definido | |||
atributos: atr, | |||
video | |||
}); | |||
} else { | |||
console.warn("Habilidad omitida por falta de campos obligatorios:", line); | |||
} | |||
}); | |||
rawSkins.split('||').forEach(line => { | |||
if (!line.trim()) return; | |||
// Extraer pares clave=valor (por ejemplo: image=..., tooltip=...) | |||
const obj = {}; | |||
line.split('|').forEach(part => { | |||
const [key, ...rest] = part.split('='); | |||
if (key && rest.length) { | |||
obj[key.trim()] = rest.join('=').trim(); | |||
} | |||
}); | |||
if (obj.image && obj.tooltip) { | |||
skins.push({ image: obj.image, tooltip: obj.tooltip }); | |||
} else { | |||
console.error("Error en la skin (falta image o tooltip):", line); | |||
} | |||
}); | |||
const tierLower = tier.toLowerCase(); | |||
let tierClass = ''; | |||
document.querySelector('.personaje-info .nome').textContent = nome; | |||
document.querySelector('.personaje-info .tier').textContent = 'Tier: ' + tier; | |||
document.querySelector('.personaje-info .classe').textContent = 'Classe: ' + classe; | |||
document.querySelector('img.art-personaje').src = image; | |||
const buttons = document.querySelectorAll('.tab-btn'); | |||
const contents = document.querySelectorAll('.tab-content'); | |||
buttons.forEach(btn => { | |||
btn.addEventListener('click', () => { | |||
buttons.forEach(b => b.classList.remove('active')); | |||
contents.forEach(c => c.classList.remove('active')); | |||
btn.classList.add('active'); | |||
document.getElementById(btn.dataset.tab).classList.add('active'); | |||
}); | |||
}); | |||
switch (tierLower) { | |||
case 'bronze': | |||
case 'bronce': | |||
tierClass = 'tier-bronze'; | |||
break; | |||
case 'silver': | |||
case 'prata': | |||
tierClass = 'tier-silver'; | |||
break; | |||
case 'gold': | |||
case 'ouro': | |||
tierClass = 'tier-gold'; | |||
break; | |||
case 'diamond': | |||
case 'diamante': | |||
tierClass = 'tier-diamond'; | |||
break; | |||
} | |||
if (tierClass) { | |||
document.querySelector('.personaje-box').classList.add(tierClass); | |||
} | |||
// Render skins | |||
document.getElementById('skins').innerHTML = generarHTMLSkins(skins); | |||
// Render habilidades | |||
const cuadrosContainer = document.querySelector('.cuadros-container'); | |||
const descripcionContainer = document.querySelector('.descripcion-container'); | |||
const videoContainer = document.querySelector('.video-container'); | |||
const cuadros = []; | |||
habilidades.forEach(hab => { | |||
const div = document.createElement('div'); | |||
div.className = 'cuadro'; | |||
div.innerHTML = `<img src="${hab.icon}" alt="${hab.nome}" style="width:100%;height:100%;object-fit:cover">`; | |||
div.title = hab.nome; | |||
hab.descripcion = hab.descripcion.replace(/'''(.*?)'''/g, '<b>$1</b>'); | |||
div.addEventListener('click', () => { | |||
descripcionContainer.innerHTML = ` | |||
<h3 style="margin-bottom:4px;color:white">${hab.nome}</h3>`+ generarHTMLAtributos(hab.atributos); + ` | |||
<p class="descLevel">Level: ${hab.level}</p> | |||
<div class="desc">${hab.descripcion}</div>`; | |||
if (hab.video && hab.video !== '') { | |||
videoContainer.innerHTML = ` | |||
<video width="100%" controls playsinline> | |||
<source src="${hab.video}" type="video/webm"> | |||
</video>`; | |||
} else { | |||
videoContainer.innerHTML = ''; | |||
} | |||
cuadros.forEach(c => c.classList.remove('activo')); | |||
div.classList.add('activo'); | |||
}); | |||
cuadros.push(div); | |||
cuadrosContainer.appendChild(div); | |||
}); | |||
if (cuadros.length) cuadros[0].click(); | |||
function generarHTMLAtributos(str) { | |||
const vals = str.split(',').map(v => v.trim()); | |||
const labels = [ 'Poder PVE', 'Poder PVP', 'Energía', 'Recarga']; | |||
const icons = [ | |||
'/images/7/7a/Icon-pve.png', | |||
'/images/5/5f/Icon-pvp.png', | |||
'/images/3/38/Icon-energy.png', | |||
'/images/b/b1/Icon-cooldown.png' | |||
]; | |||
return ` | |||
<div class="attribute--cardsContainer"> | |||
${vals.map((v, i) => { | |||
let f = v === '-' ? '-' : parseInt(v); | |||
if (i === 1 && !isNaN(f)) f = (f > 0 ? '+' : '') + f; | |||
return ` | |||
<span class="simple-tooltip simple-tooltip-inline tooltipstered" data-simple-tooltip="<p><b>${labels[i]}</b></p>"> | |||
<div class="cardAttribute"> | |||
<img src="${icons[i]}" class="cardAttribute--icon"> | |||
<h2 class="cardAttribute--value">${f}${i === 0 && f !== '-' ? ' seg' : ''}</h2> | |||
</div> | |||
</span>`; | |||
}).join('')} | |||
</div>`; | |||
} | |||
function generarHTMLSkins(lista) { | |||
return ` | |||
<div class="card-skins"> | |||
<span class="card-skins-title">Skins</span> | |||
<div class="skins--container"> | |||
${lista.map(skin => ` | |||
<span class="simple-tooltip simple-tooltip-inline tooltipstered" data-simple-tooltip="<center><b>${skin.tooltip}</b></center>"> | |||
<img class="skins--imageSkin" src="${skin.image}" alt=""> | |||
</span>`).join('')} | |||
</div> | |||
</div>`; | |||
} | |||
cuadrosContainer.addEventListener('wheel', (e) => { | |||
if (e.deltaY !== 0) { | |||
e.preventDefault(); | |||
cuadrosContainer.scrollLeft += e.deltaY; | |||
} | |||
}); | |||
dataEl.remove(); | |||
})(); | |||
</script> | |||
<style> | |||
img { | |||
pointer-events: none; | |||
user-select: none; | |||
} | |||
.personaje-box { | |||
background: #1e1e1e; | |||
border-radius: 12px; | |||
padding: 16px; | |||
color: #fff; | |||
font-family: 'Segoe UI', sans-serif; | |||
width: 90%; | |||
margin: auto; | |||
border: 2px solid #444; | |||
} | |||
.personaje-header { | |||
display: flex; | |||
gap: 20px; | |||
border-bottom: 2px solid #555; | |||
padding-bottom: 10px; | |||
flex-direction: column; | |||
} | |||
.personaje-header img { | |||
width: 230px; | |||
position: absolute; | |||
right: 5%; | |||
} | |||
.personaje-info { | |||
user-select: none; | |||
} | |||
.personaje-info .nome { | |||
font-size: 35px; | |||
font-weight: bold; | |||
} | |||
.personaje-info .tier, | |||
.personaje-info .classe { | |||
font-size: 18px; | |||
color: #bbb; | |||
} | |||
.personaje-tabs { | |||
margin-block: 4px; | |||
display: flex; | |||
gap: 12px; | |||
justify-content: flex-start; | |||
} | |||
.tab-btn { | |||
padding: 8px 20px; | |||
background: #333; | |||
color: white; | |||
border: none; | |||
border-radius: 8px; | |||
font-size: 20px; | |||
cursor: pointer; | |||
} | |||
.tab-btn.active { | |||
background: #156bc7; | |||
font-weight: bold; | |||
} | |||
.tab-content { | |||
display: none; | |||
animation: fadeIn 0.4s ease; | |||
} | |||
.tab-content.active { | |||
display: block; | |||
} | |||
.habilidades-container { | |||
display: flex; | |||
gap: 20px; | |||
} | |||
.habilidades-details { | |||
flex: 1; | |||
display: flex; | |||
flex-direction: column; | |||
gap: 10px; | |||
width: 50%; | |||
justify-content: center; | |||
} | |||
.cuadros-container { | |||
display: flex; | |||
flex-wrap: nowrap; | |||
gap: 10px; | |||
width: 55%; | |||
overflow-x: auto; | |||
overflow-y: hidden; | |||
padding-bottom: 8px; | |||
scrollbar-width: thin; | |||
scrollbar-color: #555 transparent; | |||
margin-bottom: 4px; | |||
margin-top: 20px; | |||
margin-left: 10px; | |||
scroll-behavior: smooth; | |||
} | |||
.cuadros-container::-webkit-scrollbar { | |||
height: 6px; | |||
} | |||
.cuadros-container::-webkit-scrollbar-track { | |||
background: transparent; | |||
} | |||
.cuadros-container::-webkit-scrollbar-thumb { | |||
background-color: #555; | |||
border-radius: 3px; | |||
} | |||
.cuadros-container .cuadro { | |||
flex: 0 0 auto; | |||
width: 50px; | |||
height: 50px; | |||
border-radius: 5px; | |||
cursor: pointer; | |||
transition: transform 0.2s, box-shadow 0.2s; | |||
} | |||
.cuadros-container .cuadro.activo { | |||
box-shadow: 0 0 10px 3px rgba(255, 255, 0, 0.5); | |||
border: 1px solid #FFD700; | |||
animation: glow 2s ease-in-out infinite; | |||
} | |||
.descripcion-container h3, | |||
.atributos-container h4 { | |||
font-size: 1.7em; | |||
margin-top: unset; | |||
padding-top: unset | |||
} | |||
.descripcion-container p, | |||
.desc { | |||
font-size: 1.2em; | |||
margin-bottom: unset; | |||
} | |||
.descripcion-container { | |||
min-height: 24.7rem; | |||
max-height: 50%; | |||
padding: 4px 16px !important; | |||
} | |||
.desc { | |||
overflow-y: auto !important; | |||
max-height: inherit; | |||
margin-bottom: unset; | |||
} | |||
.desc * { | |||
font-size: inherit !important; | |||
line-height: inherit; | |||
} | |||
.descripcion-container .descLevel { | |||
margin-top: 5px; | |||
font-weight: bold; | |||
} | |||
.descripcion-container .desc::-webkit-scrollbar, | |||
.tabSkill--container::-webkit-scrollbar { | |||
width: 7px; | |||
height: 7px; | |||
} | |||
.descripcion-container .desc::-webkit-scrollbar-thumb, | |||
.tabSkill--container::-webkit-scrollbar-thumb { | |||
background-color: rgb(71 153 255); | |||
border-radius: 10px; | |||
} | |||
.descripcion-container .desc::-webkit-scrollbar-track, | |||
.tabSkill--container::-webkit-scrollbar-track { | |||
background-color: #f8f8f8a8; | |||
border-radius: 10px; | |||
} | |||
.descripcion-container, | |||
.atributos-container { | |||
padding: 12px 16px; | |||
border-radius: 8px; | |||
color: #fff; | |||
backdrop-filter: blur(2px); | |||
transition: all 0.3s ease; | |||
padding-bottom: 20px; | |||
align-content: center; | |||
text-shadow: | |||
-1px -1px 0 #000, | |||
1px -1px 0 #000, | |||
-1px 1px 0 #000, | |||
1px 1px 0 #000; | |||
} | |||
.tier-bronze .descripcion-container, | |||
.tier-bronze .atributos-container { | |||
background: linear-gradient(145deg, rgba(139, 69, 19, 0.15), rgba(160, 82, 45, 0.15)); | |||
background-color: #3a2e25; | |||
border: 2px solid #cd7f32; | |||
border-radius: 10px; | |||
color: #ffffff; | |||
box-shadow: | |||
inset 0 0 5px rgba(255, 255, 255, 0.05), | |||
0 0 10px rgba(205, 127, 50, 0.15); | |||
} | |||
.tier-silver .descripcion-container, | |||
.tier-silver .atributos-container { | |||
background: linear-gradient(145deg, rgba(220, 220, 220, 0.1), rgba(180, 180, 180, 0.1)); | |||
background-color: #2f2f33; | |||
border: 2px solid #c0c0c0; | |||
border-radius: 10px; | |||
color: #ffffff; | |||
box-shadow: | |||
inset 0 0 5px rgba(255, 255, 255, 0.07), | |||
0 0 12px rgba(192, 192, 192, 0.15); | |||
} | |||
.tier-gold .descripcion-container, | |||
.tier-gold .atributos-container { | |||
background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1)); | |||
background-color: #352a12; | |||
border: 2px solid #ffd700; | |||
border-radius: 10px; | |||
color: #ffffff; | |||
box-shadow: | |||
inset 0 0 6px rgba(255, 255, 255, 0.05), | |||
0 0 14px rgba(255, 215, 0, 0.2); | |||
} | |||
.tier-diamond .descripcion-container, | |||
.tier-diamond .atributos-container { | |||
background: linear-gradient(145deg, rgba(160, 250, 255, 0.2), rgba(80, 180, 200, 0.5)), | |||
url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='15,2 18,11 28,11 20,17 23,27 15,21 7,27 10,17 2,11 12,11' fill='%23ffffff' fill-opacity='0.25'/%3E%3C/svg%3E"); | |||
background-color: #2c4a53; | |||
background-blend-mode: soft-light; | |||
background-size: 45px 45px; | |||
border: 2px solid #9be8f5; | |||
border-radius: 10px; | |||
box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1), 0 0 15px rgba(100, 255, 255, 0.25); | |||
color: #ffffff; | |||
animation: glowDiamond 5s ease-in-out infinite, moveStars 5s linear infinite; | |||
position: relative; | |||
overflow: hidden; | |||
} | |||
.atributos-container { | |||
user-select: none; | |||
} | |||
.video-container { | |||
width: 42.4%; | |||
height: fit-content; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
background-color: #000; | |||
padding: 0; | |||
overflow: hidden; | |||
align-self: center; | |||
border-radius: 2%; | |||
box-shadow: 0 0 7px rgb(255 255 255 / 82%), 0 0 5px rgb(255 255 255 / 96%); | |||
} | |||
.attribute--cardsContainer { | |||
display: flex; | |||
justify-content: center; | |||
gap: 20px; | |||
flex-wrap: wrap; | |||
margin-top: 10px; | |||
background: unset; | |||
border: unset; | |||
} | |||
.cardAttribute { | |||
width: 80px; | |||
height: 90px; | |||
background-color: #473838; | |||
border-radius: 8px; | |||
display: flex; | |||
flex-direction: column; | |||
align-items: center; | |||
justify-content: center; | |||
text-align: center; | |||
padding: 5px; | |||
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5); | |||
transition: transform 0.2s; | |||
border: 1px solid #00000047; | |||
} | |||
.cardAttribute--icon { | |||
height: 28px; | |||
margin-bottom: 14px; | |||
} | |||
.cardAttribute--value { | |||
font-size: 14px !important; | |||
font-weight: bold; | |||
margin: 0 !important; | |||
color: white; | |||
border-bottom: unset; | |||
} | |||
.attribute-title, | |||
.card-skins-title { | |||
font-size: 1.4em; | |||
text-align: center; | |||
justify-self: center; | |||
letter-spacing: 1px; | |||
font-family: sans-serif !important; | |||
border-bottom: 2px solid #9d9c9c; | |||
color: white !important; | |||
padding-bottom: 8px; | |||
margin-bottom: 16px; | |||
width: 75%; | |||
} | |||
.card-skins { | |||
padding: 16px; | |||
border-radius: 12px; | |||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); | |||
margin-top: 20px; | |||
} | |||
.card-skins-title { | |||
display: block; | |||
border-bottom: unset; | |||
font-size: 18px; | |||
font-weight: bold; | |||
margin-bottom: 12px; | |||
} | |||
.skins--container { | |||
display: flex; | |||
gap: 16px; | |||
flex-wrap: wrap; | |||
justify-content: center; | |||
} | |||
.skins--imageSkin { | |||
width: 200px; | |||
height: auto; | |||
background-color: #fefefe; | |||
border-radius: 6px; | |||
border: 1px solid #ccc; | |||
transition: transform 0.2s; | |||
} | |||
.skins--imageSkin:hover { | |||
transform: scale(1.05); | |||
} | |||
.mw-body-content { | |||
line-height: 1.5 !important; | |||
} | |||
@keyframes fadeIn { | |||
from { | |||
opacity: 0; | |||
} | |||
to { | |||
opacity: 1; | |||
} | |||
} | |||
@keyframes glowDiamond { | |||
0%, | |||
100% { | |||
box-shadow: | |||
inset 0 0 8px rgba(255, 255, 255, 0.4), | |||
0 0 16px rgba(80, 255, 255, 0.6); | |||
} | |||
50% { | |||
box-shadow: | |||
inset 0 0 16px rgba(255, 255, 255, 0.6), | |||
0 0 24px rgba(160, 255, 255, 0.8); | |||
} | |||
} | |||
@keyframes moveStars { | |||
0% { | |||
background-position: 0 0; | |||
} | |||
100% { | |||
background-position: 90px -90px; | |||
} | |||
} | |||
@keyframes glow { | |||
0% { | |||
box-shadow: 0 0 2px 1px rgba(255, 255, 0, 0.35); | |||
} | |||
50% { | |||
box-shadow: 0 0 4px 2px rgba(255, 255, 0, 0.7); | |||
} | |||
100% { | |||
box-shadow: 0 0 2px 1px rgba(255, 255, 0, 0.35); | |||
} | |||
} | |||
@media (max-aspect-ratio: 3/4) { | |||
.desc { | |||
font-size: 30px; | |||
line-height: 1.5; | |||
overflow-y: auto !important; | |||
max-height: inherit; | |||
margin-bottom: unset; | |||
width: 100%; | |||
} | |||
.desc * { | |||
font-size: inherit !important; | |||
line-height: inherit; | |||
} | |||
.habilidades-container { | |||
display: flex; | |||
gap: 20px; | |||
flex-direction: column-reverse; | |||
} | |||
.habilidades-details { | |||
flex: 1; | |||
display: flex; | |||
flex-direction: column; | |||
width: 96%; | |||
align-self: center; | |||
} | |||
.video-container { | |||
width: 80%; | |||
height: fit-content; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
overflow: hidden; | |||
align-self: center; | |||
border-radius: 3%; | |||
margin-top: 2%; | |||
} | |||
.personaje-header img { | |||
right: 2%; | |||
width: 290px; | |||
top: 1.45vh; | |||
} | |||
.tap-btn { | |||
font-size: 30px; | |||
} | |||
.personaje-info .nome { | |||
font-size: 44px; | |||
} | |||
.personaje-info .tier, | |||
.personaje-info .classe { | |||
font-size: 30px; | |||
} | |||
.cuadros-container .cuadro { | |||
flex: 0 0 auto; | |||
width: 80px; | |||
height: 80px; | |||
} | |||
.personaje-box { | |||
padding: 32px; | |||
} | |||
.descripcion-container h3, | |||
.atributos-container h4 { | |||
font-size: 2.5em; | |||
margin-top: -12px; | |||
} | |||
.descripcion-container p { | |||
font-size: 2.3em; | |||
margin-bottom: 5px; | |||
} | |||
.descripcion-container, | |||
.atributos-container { | |||
padding: 22px 22px !important; | |||
} | |||
.atributos-container h2 { | |||
font-size: 1.3em !important; | |||
} | |||
.tab-btn { | |||
padding: 14px 22px; | |||
font-size: 34px; | |||
} | |||
} | |||
</style> | |||
Edição das 19h00min de 17 de julho de 2025
<img class="art-personaje" alt="Arte del personaje" />
<button class="tab-btn active" data-tab="habilidades">Habilidades</button>
<button class="tab-btn" data-tab="skins">Skins</button>
<script type="text/javascript">
(function () {
const dataEl = document.getElementById('persona-data');
if (!dataEl) {
console.error('Persona widget: no se encontró #persona-data');
return;
}
// Extração de dados
const nome = dataEl.dataset.nome || ;
const tier = dataEl.dataset.tier || ;
const classe = dataEl.dataset.classe || ;
const image = dataEl.dataset.image || ;
let habilidades = [];
let skins = [];
const tempRawHabs = (dataEl.dataset.habilidadesRaw || ).trim();
let tempRawSkins = (dataEl.dataset.skinsRaw || ).trim();
rawSkins = tempRawSkins.replace(//g, ).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(); // por si hay "=" en el valor
});
const { nome, icon, level, desc = , atr, video = } = habData;
if (nome && icon && level && atr) {
habilidades.push({
nome,
icon,
level: parseInt(level),
descripcion: desc, // estará vacío si no fue definido
atributos: atr,
video
});
} else {
console.warn("Habilidad omitida por falta de campos obligatorios:", line);
}
});
rawSkins.split('||').forEach(line => {
if (!line.trim()) return;
// Extraer pares clave=valor (por ejemplo: image=..., tooltip=...)
const obj = {};
line.split('|').forEach(part => {
const [key, ...rest] = part.split('=');
if (key && rest.length) {
obj[key.trim()] = rest.join('=').trim();
}
});
if (obj.image && obj.tooltip) {
skins.push({ image: obj.image, tooltip: obj.tooltip });
} else {
console.error("Error en la skin (falta image o tooltip):", line);
}
});
const tierLower = tier.toLowerCase();
let tierClass = ;
document.querySelector('.personaje-info .nome').textContent = nome;
document.querySelector('.personaje-info .tier').textContent = 'Tier: ' + tier;
document.querySelector('.personaje-info .classe').textContent = 'Classe: ' + classe;
document.querySelector('img.art-personaje').src = image;
const buttons = document.querySelectorAll('.tab-btn');
const contents = document.querySelectorAll('.tab-content');
buttons.forEach(btn => {
btn.addEventListener('click', () => {
buttons.forEach(b => b.classList.remove('active'));
contents.forEach(c => c.classList.remove('active'));
btn.classList.add('active');
document.getElementById(btn.dataset.tab).classList.add('active');
});
});
switch (tierLower) {
case 'bronze':
case 'bronce':
tierClass = 'tier-bronze';
break;
case 'silver':
case 'prata':
tierClass = 'tier-silver';
break;
case 'gold':
case 'ouro':
tierClass = 'tier-gold';
break;
case 'diamond':
case 'diamante':
tierClass = 'tier-diamond';
break;
}
if (tierClass) {
document.querySelector('.personaje-box').classList.add(tierClass);
}
// Render skins
document.getElementById('skins').innerHTML = generarHTMLSkins(skins);
// Render habilidades
const cuadrosContainer = document.querySelector('.cuadros-container');
const descripcionContainer = document.querySelector('.descripcion-container');
const videoContainer = document.querySelector('.video-container');
const cuadros = [];
habilidades.forEach(hab => {
const div = document.createElement('div');
div.className = 'cuadro';
div.innerHTML = `<img src="${hab.icon}" alt="${hab.nome}" style="width:100%;height:100%;object-fit:cover">`;
div.title = hab.nome;
hab.descripcion = hab.descripcion.replace(/(.*?)/g, '$1');
div.addEventListener('click', () => {
descripcionContainer.innerHTML = `
${hab.nome}
`+ generarHTMLAtributos(hab.atributos); + `
Level: ${hab.level}
${hab.descripcion}
`;
if (hab.video && hab.video !== ) {
videoContainer.innerHTML = `
<video width="100%" controls playsinline>
<source src="${hab.video}" type="video/webm">
</video>`;
} else {
videoContainer.innerHTML = ;
}
cuadros.forEach(c => c.classList.remove('activo'));
div.classList.add('activo');
});
cuadros.push(div);
cuadrosContainer.appendChild(div);
});
if (cuadros.length) cuadros[0].click();
function generarHTMLAtributos(str) {
const vals = str.split(',').map(v => v.trim());
const labels = [ 'Poder PVE', 'Poder PVP', 'Energía', 'Recarga'];
const icons = [
'/images/7/7a/Icon-pve.png',
'/images/5/5f/Icon-pvp.png',
'/images/3/38/Icon-energy.png',
'/images/b/b1/Icon-cooldown.png'
];
return `
${vals.map((v, i) => {
let f = v === '-' ? '-' : parseInt(v);
if (i === 1 && !isNaN(f)) f = (f > 0 ? '+' : ) + f;
return `
<span class="simple-tooltip simple-tooltip-inline tooltipstered" data-simple-tooltip="${labels[i]}
"> <img src="${icons[i]}" class="cardAttribute--icon">
${f}${i === 0 && f !== '-' ? ' seg' : }
`;
}).join()}
`;
}
function generarHTMLSkins(lista) {
return `
Skins
${lista.map(skin => `
<span class="simple-tooltip simple-tooltip-inline tooltipstered" data-simple-tooltip=" <img class="skins--imageSkin" src="${skin.image}" alt="">
`).join()}
`;
}
cuadrosContainer.addEventListener('wheel', (e) => {
if (e.deltaY !== 0) {
e.preventDefault();
cuadrosContainer.scrollLeft += e.deltaY;
}
});
dataEl.remove();
})();
</script> <style>
img {
pointer-events: none;
user-select: none;
}
.personaje-box {
background: #1e1e1e;
border-radius: 12px;
padding: 16px;
color: #fff;
font-family: 'Segoe UI', sans-serif;
width: 90%;
margin: auto;
border: 2px solid #444;
}
.personaje-header {
display: flex;
gap: 20px;
border-bottom: 2px solid #555;
padding-bottom: 10px;
flex-direction: column;
}
.personaje-header img {
width: 230px;
position: absolute;
right: 5%;
}
.personaje-info {
user-select: none;
}
.personaje-info .nome {
font-size: 35px;
font-weight: bold;
}
.personaje-info .tier,
.personaje-info .classe {
font-size: 18px;
color: #bbb;
}
.personaje-tabs {
margin-block: 4px;
display: flex;
gap: 12px;
justify-content: flex-start;
}
.tab-btn {
padding: 8px 20px;
background: #333;
color: white;
border: none;
border-radius: 8px;
font-size: 20px;
cursor: pointer;
}
.tab-btn.active {
background: #156bc7;
font-weight: bold;
}
.tab-content {
display: none;
animation: fadeIn 0.4s ease;
}
.tab-content.active {
display: block;
}
.habilidades-container {
display: flex;
gap: 20px;
}
.habilidades-details {
flex: 1;
display: flex;
flex-direction: column;
gap: 10px;
width: 50%;
justify-content: center;
}
.cuadros-container {
display: flex;
flex-wrap: nowrap;
gap: 10px;
width: 55%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 8px;
scrollbar-width: thin;
scrollbar-color: #555 transparent;
margin-bottom: 4px;
margin-top: 20px;
margin-left: 10px;
scroll-behavior: smooth;
}
.cuadros-container::-webkit-scrollbar {
height: 6px;
}
.cuadros-container::-webkit-scrollbar-track {
background: transparent;
}
.cuadros-container::-webkit-scrollbar-thumb {
background-color: #555;
border-radius: 3px;
}
.cuadros-container .cuadro {
flex: 0 0 auto;
width: 50px;
height: 50px;
border-radius: 5px;
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
}
.cuadros-container .cuadro.activo {
box-shadow: 0 0 10px 3px rgba(255, 255, 0, 0.5);
border: 1px solid #FFD700;
animation: glow 2s ease-in-out infinite;
}
.descripcion-container h3,
.atributos-container h4 {
font-size: 1.7em;
margin-top: unset;
padding-top: unset
}
.descripcion-container p,
.desc {
font-size: 1.2em;
margin-bottom: unset;
}
.descripcion-container {
min-height: 24.7rem;
max-height: 50%;
padding: 4px 16px !important;
}
.desc {
overflow-y: auto !important;
max-height: inherit;
margin-bottom: unset;
}
.desc * {
font-size: inherit !important;
line-height: inherit;
}
.descripcion-container .descLevel {
margin-top: 5px;
font-weight: bold;
}
.descripcion-container .desc::-webkit-scrollbar,
.tabSkill--container::-webkit-scrollbar {
width: 7px;
height: 7px;
}
.descripcion-container .desc::-webkit-scrollbar-thumb,
.tabSkill--container::-webkit-scrollbar-thumb {
background-color: rgb(71 153 255);
border-radius: 10px;
}
.descripcion-container .desc::-webkit-scrollbar-track,
.tabSkill--container::-webkit-scrollbar-track {
background-color: #f8f8f8a8;
border-radius: 10px;
}
.descripcion-container,
.atributos-container {
padding: 12px 16px;
border-radius: 8px;
color: #fff;
backdrop-filter: blur(2px);
transition: all 0.3s ease;
padding-bottom: 20px;
align-content: center;
text-shadow:
-1px -1px 0 #000,
1px -1px 0 #000,
-1px 1px 0 #000,
1px 1px 0 #000;
}
.tier-bronze .descripcion-container,
.tier-bronze .atributos-container {
background: linear-gradient(145deg, rgba(139, 69, 19, 0.15), rgba(160, 82, 45, 0.15));
background-color: #3a2e25;
border: 2px solid #cd7f32;
border-radius: 10px;
color: #ffffff;
box-shadow:
inset 0 0 5px rgba(255, 255, 255, 0.05),
0 0 10px rgba(205, 127, 50, 0.15);
}
.tier-silver .descripcion-container,
.tier-silver .atributos-container {
background: linear-gradient(145deg, rgba(220, 220, 220, 0.1), rgba(180, 180, 180, 0.1));
background-color: #2f2f33;
border: 2px solid #c0c0c0;
border-radius: 10px;
color: #ffffff;
box-shadow:
inset 0 0 5px rgba(255, 255, 255, 0.07),
0 0 12px rgba(192, 192, 192, 0.15);
}
.tier-gold .descripcion-container,
.tier-gold .atributos-container {
background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
background-color: #352a12;
border: 2px solid #ffd700;
border-radius: 10px;
color: #ffffff;
box-shadow:
inset 0 0 6px rgba(255, 255, 255, 0.05),
0 0 14px rgba(255, 215, 0, 0.2);
}
.tier-diamond .descripcion-container,
.tier-diamond .atributos-container {
background: linear-gradient(145deg, rgba(160, 250, 255, 0.2), rgba(80, 180, 200, 0.5)),
url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='15,2 18,11 28,11 20,17 23,27 15,21 7,27 10,17 2,11 12,11' fill='%23ffffff' fill-opacity='0.25'/%3E%3C/svg%3E");
background-color: #2c4a53;
background-blend-mode: soft-light;
background-size: 45px 45px;
border: 2px solid #9be8f5;
border-radius: 10px;
box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1), 0 0 15px rgba(100, 255, 255, 0.25);
color: #ffffff;
animation: glowDiamond 5s ease-in-out infinite, moveStars 5s linear infinite;
position: relative;
overflow: hidden;
}
.atributos-container {
user-select: none;
}
.video-container {
width: 42.4%;
height: fit-content;
display: flex;
align-items: center;
justify-content: center;
background-color: #000;
padding: 0;
overflow: hidden;
align-self: center;
border-radius: 2%;
box-shadow: 0 0 7px rgb(255 255 255 / 82%), 0 0 5px rgb(255 255 255 / 96%);
}
.attribute--cardsContainer {
display: flex;
justify-content: center;
gap: 20px;
flex-wrap: wrap;
margin-top: 10px;
background: unset;
border: unset;
}
.cardAttribute {
width: 80px;
height: 90px;
background-color: #473838;
border-radius: 8px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 5px;
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
transition: transform 0.2s;
border: 1px solid #00000047;
}
.cardAttribute--icon {
height: 28px;
margin-bottom: 14px;
}
.cardAttribute--value {
font-size: 14px !important;
font-weight: bold;
margin: 0 !important;
color: white;
border-bottom: unset;
}
.attribute-title,
.card-skins-title {
font-size: 1.4em;
text-align: center;
justify-self: center;
letter-spacing: 1px;
font-family: sans-serif !important;
border-bottom: 2px solid #9d9c9c;
color: white !important;
padding-bottom: 8px;
margin-bottom: 16px;
width: 75%;
}
.card-skins {
padding: 16px;
border-radius: 12px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
margin-top: 20px;
}
.card-skins-title {
display: block;
border-bottom: unset;
font-size: 18px;
font-weight: bold;
margin-bottom: 12px;
}
.skins--container {
display: flex;
gap: 16px;
flex-wrap: wrap;
justify-content: center;
}
.skins--imageSkin {
width: 200px;
height: auto;
background-color: #fefefe;
border-radius: 6px;
border: 1px solid #ccc;
transition: transform 0.2s;
}
.skins--imageSkin:hover {
transform: scale(1.05);
}
.mw-body-content {
line-height: 1.5 !important;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes glowDiamond {
0%,
100% {
box-shadow:
inset 0 0 8px rgba(255, 255, 255, 0.4),
0 0 16px rgba(80, 255, 255, 0.6);
}
50% {
box-shadow:
inset 0 0 16px rgba(255, 255, 255, 0.6),
0 0 24px rgba(160, 255, 255, 0.8);
}
}
@keyframes moveStars {
0% {
background-position: 0 0;
}
100% {
background-position: 90px -90px;
}
}
@keyframes glow {
0% {
box-shadow: 0 0 2px 1px rgba(255, 255, 0, 0.35);
}
50% {
box-shadow: 0 0 4px 2px rgba(255, 255, 0, 0.7);
}
100% {
box-shadow: 0 0 2px 1px rgba(255, 255, 0, 0.35);
}
}
@media (max-aspect-ratio: 3/4) {
.desc {
font-size: 30px;
line-height: 1.5;
overflow-y: auto !important;
max-height: inherit;
margin-bottom: unset;
width: 100%;
}
.desc * {
font-size: inherit !important;
line-height: inherit;
}
.habilidades-container {
display: flex;
gap: 20px;
flex-direction: column-reverse;
}
.habilidades-details {
flex: 1;
display: flex;
flex-direction: column;
width: 96%;
align-self: center;
}
.video-container {
width: 80%;
height: fit-content;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
align-self: center;
border-radius: 3%;
margin-top: 2%;
}
.personaje-header img {
right: 2%;
width: 290px;
top: 1.45vh;
}
.tap-btn {
font-size: 30px;
}
.personaje-info .nome {
font-size: 44px;
}
.personaje-info .tier,
.personaje-info .classe {
font-size: 30px;
}
.cuadros-container .cuadro {
flex: 0 0 auto;
width: 80px;
height: 80px;
}
.personaje-box {
padding: 32px;
}
.descripcion-container h3,
.atributos-container h4 {
font-size: 2.5em;
margin-top: -12px;
}
.descripcion-container p {
font-size: 2.3em;
margin-bottom: 5px;
}
.descripcion-container,
.atributos-container {
padding: 22px 22px !important;
}
.atributos-container h2 {
font-size: 1.3em !important;
}
.tab-btn {
padding: 14px 22px;
font-size: 34px;
}
}
</style>