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

De Wiki Gla
Ir para navegação Ir para pesquisar
(Página substituída por 'function activarFlechasCarrusel() { const carousel = document.querySelector('.skins-carousel'); const wrapper = document.querySelector('.skins-carousel-wrapper'...')
Etiqueta: Substituído
Linha 1: Linha 1:
<div class="personaje-box">
function activarFlechasCarrusel() {
     <div class="personaje-header">
     const carousel = document.querySelector('.skins-carousel');
        <div class="personaje-topbar">
    const wrapper = document.querySelector('.skins-carousel-wrapper');
            <div class="personaje-nome-box">
    const leftBtn = document.querySelector('.skins-arrow.left');
                <img src="/images/6/63/Franky_ts_medal.png" class="topbar-icon">
     const rightBtn = document.querySelector('.skins-arrow.right');
                <div class="personaje-nome-category">
                    <div class="nome"></div>
                    <div class="classes"></div>
                </div>
            </div>
        </div>
        <div class="topbar-description">Franky (TS) é um personagem do tier diamante.</div>
        <div class="personaje-tabs">
            <button class="tab-btn" data-tab="arma">Arma</button>
            <button class="tab-btn active" data-tab="habilidades">Habilidades</button>
            <button class="tab-btn" data-tab="skins">Skins</button>
        </div>
    </div>
    <img class="art-personaje" alt="Arte del personaje">
     <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>
            <div class="video-container"></div>
        </div>
    </div>


     <div class="tab-content" id="skins">
     const skinCard = carousel.querySelector('.skin-card');
     </div>
     if (!skinCard) return;
</div>


<script type="text/javascript">
    const cardStyle = getComputedStyle(skinCard);
    (function () {
    const cardWidth = skinCard.offsetWidth + parseInt(cardStyle.marginRight || 0) + parseInt(cardStyle.marginLeft || 0);
        const dataEl = document.getElementById('persona-data');
    const scrollAmount = cardWidth;
        if (!dataEl) {
            console.error('Persona widget: no se encontró #persona-data');
            return;
        }


        // Extração de dados
    function hideArrow(btn) {
        const nome = dataEl.dataset.nome || '';
        if (!btn.classList.contains('desapareciendo') && btn.style.display !== 'none') {
        const tier = dataEl.dataset.tier || '';
            btn.classList.add('desapareciendo');
        const classe = dataEl.dataset.classe || '';
            setTimeout(() => {
        const image = dataEl.dataset.image || '';
                 btn.style.display = 'none';
        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();
            });
 
            const { nome, icon, level, desc = '', atr, video = '' } = habData;
 
            if (nome && icon && level && atr) {
                habilidades.push({
                    nome,
                    icon,
                    level: parseInt(level),
                    descripcion: desc,
                    atributos: atr,
                    video
                });
            } else {
                console.warn("Habilidad omitida por falta de campos obligatorios:", line);
            }
        });
 
        function activarFlechasCarrusel() {
            const carousel = document.querySelector('.skins-carousel');
            const wrapper = document.querySelector('.skins-carousel-wrapper');
            const leftBtn = document.querySelector('.skins-arrow.left');
            const rightBtn = document.querySelector('.skins-arrow.right');
 
            const skinCard = carousel.querySelector('.skin-card');
            if (!skinCard) return;
 
            const cardStyle = getComputedStyle(skinCard);
            const cardWidth = skinCard.offsetWidth + parseInt(cardStyle.marginRight || 0) + parseInt(cardStyle.marginLeft || 0);
            const scrollAmount = cardWidth;
 
            // Funciones para mostrar/ocultar con animación
            function hideArrow(btn) {
                if (!btn.classList.contains('desapareciendo') && btn.style.display !== 'none') {
                    btn.classList.add('desapareciendo');
                    setTimeout(() => {
                        btn.style.display = 'none';
                        btn.classList.remove('desapareciendo');
                    }, 300);
                }
            }
 
            function showArrow(btn) {
                 if (btn.style.display === 'none') {
                    btn.style.display = 'inline-block';
                    void btn.offsetWidth;
                }
                 btn.classList.remove('desapareciendo');
                 btn.classList.remove('desapareciendo');
             }
             }, 300);
 
            function updateArrows() {
                const scrollLeft = Math.round(carousel.scrollLeft);
                const maxScrollLeft = Math.round(carousel.scrollWidth - carousel.clientWidth);
 
                const hasLeft = scrollLeft > 5;
                const hasRight = scrollLeft < maxScrollLeft - 5;
 
                // Mostrar u ocultar flechas
                if (hasLeft) {
                    showArrow(leftBtn);
                } else {
                    hideArrow(leftBtn);
                }
 
                if (hasRight) {
                    showArrow(rightBtn);
                } else {
                    hideArrow(rightBtn);
                }
 
                wrapper.classList.toggle('has-left', hasLeft);
                wrapper.classList.toggle('has-right', hasRight);
            }
 
            // Movimiento izquierdo
            leftBtn.addEventListener('click', () => {
                const scrollLeft = carousel.scrollLeft;
                const nextScroll = Math.max(0, scrollLeft - scrollAmount);
                carousel.scrollTo({ left: nextScroll, behavior: 'smooth' });
            });
 
            // Movimiento derecho
            rightBtn.addEventListener('click', () => {
                const scrollLeft = carousel.scrollLeft;
                const maxScrollLeft = carousel.scrollWidth - carousel.clientWidth;
                const nextScroll = Math.min(maxScrollLeft, scrollLeft + scrollAmount);
                carousel.scrollTo({ left: nextScroll, behavior: 'smooth' });
            });
 
            // Actualizar en tiempo real durante scroll
            carousel.addEventListener('scroll', () => {
                updateArrows();
            });
 
            // También en caso de redimensionar
            new ResizeObserver(updateArrows).observe(carousel);
 
            // Ejecutar al inicio
            updateArrows();
        }
 
 
 
 
        rawSkins.split('||').forEach(line => {
            if (!line.trim()) return;
 
            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('.nome').textContent = nome;
        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);
        activarFlechasCarrusel();
        // 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 = `<div class="titulo-habilidad">
                <h3>${hab.nome}</h3>
                <div class="tooltip-container">
                <button class="info-btn">i</button>
                <span class="tooltip-text">
                    Información adicional sobre la habilidad, consejos o efectos especiales.
                </span>
                </div>
            </div>` + generarHTMLAtributos(hab.atributos) + `
            <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 hideArrow(btn) {
            if (!btn.classList.contains('hidden') && btn.style.display !== 'none') {
                btn.classList.add('hidden');
                setTimeout(() => {
                    btn.style.display = 'none';
                    btn.classList.remove('hidden');
                }, 300);
            }
        }
        function showArrow(btn) {
            if (btn.style.display === 'none') {
                btn.style.display = 'inline-block';
                void btn.offsetWidth;
            }
            btn.classList.remove('hidden');
        }
        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 & SPOTLIGHTS</span>
            <div class="skins-carousel-wrapper">
                <button class="skins-arrow left">«</button>
                <div class="skins-carousel">
                ${lista.map(skin => `
                    <div class="skin-card">
                    <img class="skins--imageBanner" src="https://one-piece-artworks.com/app/view/assets/img/geNiZAK" alt="banner">
                    <img class="skins--imageSkin" src="${skin.image}" alt="skin">
                    </div>
                `).join('')}
                </div>
                <button class="skins-arrow right">»</button>
            </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 {
        padding: 16px;
        color: #000000;
        font-family: 'Segoe UI', sans-serif;
        width: 90%;
        margin: auto;
    }
    .personaje-topbar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 16px;
    }
    .personaje-nome-box {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .topbar-icon {
        width: 90px;
        height: 90px;
        object-fit: none;
        background: #60dae2;
    }
    .nome {
        font-size: 60px;
        font-family: 'Orbitron', sans-serif;
        font-weight: 900;
    }
    .topbar-description {
        font-size: 16px;
        margin-top: 6px;
        background: #6AF3FB;
        width: fit-content;
        padding-inline: 16px;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }
    .personaje-header {
        display: flex;
        gap: 10px;
        flex-direction: column;
    }
    .art-personaje {
        width: 665px;
        position: absolute;
        right: 5%;
        top: 0.8%;
    }
    .personaje-info {
        user-select: none;
    }
    .personaje-info .tier,
    .personaje-info .classe {
        font-size: 18px;
        color: #bbb;
    }
    .personaje-tabs {
        margin-block: 4px;
        display: flex;
        gap: 12px;
        justify-content: flex-start;
        margin-left: 8px;
    }
    .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;
        background: #26211cd6;
        padding-inline: 8px;
        padding-bottom: 8px;
    }
    .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: 56%;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 3px;
        scrollbar-width: thin;
        scrollbar-color: #ababab transparent;
        margin-bottom: 6px;
        padding-top: 10px;
        margin-left: 1px;
        scroll-behavior: smooth;
    }
    .cuadros-container::-webkit-scrollbar {
        height: 6px;
    }
    .cuadros-container::-webkit-scrollbar-track {
        background: transparent;
    }
    .cuadros-container::-webkit-scrollbar-thumb {
        background-color: #151515;
        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;
    }
    .titulo-habilidad {
        position: relative;
        display: flex;
        justify-content: center;
        /* centra el h3 */
        align-items: center;
        margin-bottom: 8px;
        padding-right: 32px;
        /* espacio para que no choque el botón */
    }
    .titulo-habilidad h3 {
        font-size: 1.6em;
        color: white;
        text-align: center;
        margin: 0;
        width: 100%;
    }
    .tooltip-container {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    .info-btn {
        border: none;
        color: #D3DBDC;
        background-color: #787878;
        font-weight: bold;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        font-family: 'Noto Sans';
        cursor: pointer;
        transition: 0.2s;
        box-shadow: 0 0 3px #000000;
        font-size: 40px;
        padding: 0;
        line-height: 24px;
        text-align: center;
    }
    .tooltip-text {
        visibility: hidden;
        width: 220px;
        background-color: #222;
        color: #fff;
        text-align: left;
        padding: 8px 10px;
        border-radius: 8px;
        position: absolute;
        z-index: 10;
        bottom: 130%;
        left: 50%;
        transform: translate(-85%, 110%);
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        pointer-events: none;
    }
    .tooltip-container:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }
    .descripcion-container h3 {
        font-size: 2.7em;
        margin-top: unset;
        padding-top: unset;
        text-align: center;
    }
    .descripcion-container p,
    .desc {
        font-size: 1.2em;
        margin-bottom: unset;
    }
    .descripcion-container {
        min-height: 25.1rem;
        max-height: 50%;
        padding: 4px 16px !important;
        background: #26211C;
        border-radius: 8px;
        position: relative;
        /*overflow: hidden;*/
        box-shadow: 0 0 7px rgb(255 255 255 / 82%), 0 0 5px rgb(255 255 255 / 96%);
        color: #fff;
        backdrop-filter: blur(2px);
        transition: all 0.3s ease;
        padding-bottom: 20px;
        padding-top: 0px !important;
        text-shadow:
            -1px -1px 0 #000,
            1px -1px 0 #000,
            -1px 1px 0 #000,
            1px 1px 0 #000;
    }
    .desc {
        overflow-y: auto !important;
        max-height: inherit;
        margin-bottom: unset;
        margin-top: 10px;
    }
    .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: #151515a8;
        border-radius: 10px;
    }
    /*.tier-bronze .descripcion-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 {
        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 {
        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 {
        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;
    }*/
    .tier-diamond .personaje-header {
        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: #4b8292;
        background-blend-mode: soft-light;
        background-size: 45px 45px;
        box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1), 0 0 15px rgba(100, 255, 255, 0.25);
        animation: moveStars 5s linear infinite;
        padding-bottom: 10px;
        position: relative;
        overflow: hidden;
    }
    .video-container {
        width: 43%;
        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%);
        z-index: 999;
    }
    .attribute--cardsContainer {
        display: flex;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
        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);
    }
    .skins-carousel-wrapper {
        display: flex;
        align-items: center;
        position: relative;
        padding: 0;
        transition: padding 0.5s ease;
    }
    .skins-carousel-wrapper::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        width: 60px;
        height: 100%;
        pointer-events: none;
        background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
        opacity: 0;
        transition: opacity 0.4s ease;
        z-index: 3;
    }
    .skins-carousel-wrapper.has-left::before {
        opacity: 1;
    }
    .skins-carousel-wrapper::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        width: 60px;
        height: 100%;
        pointer-events: none;
        background: linear-gradient(to left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
        opacity: 0;
        transition: opacity 0.4s ease;
        z-index: 3;
    }
    .skins-carousel-wrapper.has-right::after {
        opacity: 1;
    }
    .has-left {
        padding-left: 60px;
    }
    .has-left .skins-carousel {
        mask-image: linear-gradient(to right, transparent 0px, black 40px, black 100%);
    }
    .has-right {
        padding-right: 60px;
    }
    .has-right .skins-carousel {
        mask-image: linear-gradient(to right, black 0px, black calc(100% - 40px), transparent 100%);
    }
    .skins-arrow {
        opacity: 1;
        transform: scale(1);
        transition: opacity 0.3s ease, transform 0.3s ease;
        display: inline-block;
    }
    .skins-arrow.hidden {
        opacity: 0;
        transform: scale(0.8);
        pointer-events: none;
        visibility: hidden;
    }
    .card-skins-title {
        display: block;
        border-bottom: unset;
        font-size: 40px;
        font-weight: bold;
        justify-self: auto;
        padding-bottom: unset;
        margin-bottom: 10px;
        width: 55%;
    }
    .skins-carousel-wrapper {
        min-height: 21.1rem;
        max-height: 60%;
        padding: 4px 16px !important;
        background: #26211C;
        border-radius: 8px;
        position: relative;
        box-shadow: 0 0 7px rgb(255 255 255 / 82%), 0 0 5px rgb(255 255 255 / 96%);
        color: #fff;
        backdrop-filter: blur(2px);
        transition: all 0.3s ease;
        padding-bottom: 20px;
        padding-top: 0px !important;
        text-shadow:
            -1px -1px 0 #000,
            1px -1px 0 #000,
            -1px 1px 0 #000,
            1px 1px 0 #000;
        flex: 1;
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: center;
        align-items: center;
        overflow: visible;
    }
    .skins-carousel {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        scroll-behavior: smooth;
        padding: 10px 0;
        flex-grow: 1;
    }
    .skins-carousel.both-mask {
        mask-image: linear-gradient(to right, transparent 0px, black 40px, black calc(100% - 40px), transparent 100%);
    }
    .skins-carousel.left-mask {
        mask-image: linear-gradient(to right, transparent 0px, black 40px, black 100%);
     }
     }


     .skins-carousel.right-mask {
     function showArrow(btn) {
         mask-image: linear-gradient(to right, black 0px, black calc(100% - 40px), transparent 100%);
         if (btn.style.display === 'none') {
    }
            btn.style.display = 'inline-block';
 
            void btn.offsetWidth;
    .skins-carousel.no-mask {
        mask-image: none;
    }
 
 
    .skins-carousel::-webkit-scrollbar {
        display: none;
    }
 
    .skin-card {
        position: relative;
        width: 200px;
        height: 320px;
        flex: 0 0 auto;
        border: 2px solid #697EC9;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 0 8px #00f2ff70;
        background: #111;
    }
 
    .skin-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        border-radius: inherit;
        z-index: 2;
        box-shadow: inset 0 0 12px 6px rgba(180, 180, 180, 0.25);
    }
 
    .skins--imageBanner {
        width: 100%;
        height: 109%;
        scale: 1.1;
        object-fit: cover;
        filter: brightness(0.5);
    }
 
    .skins--imageSkin {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        height: 140px;
        width: auto;
        z-index: 2;
        transition: transform 0.2s;
    }
 
    .skins--imageSkin:hover {
        transform: translateX(-50%) scale(1.05);
    }
 
    .skins-arrow {
        background: none;
        border: none;
        color: white;
        font-size: 36px;
        cursor: pointer;
        padding: 8px;
        z-index: 5;
        transition: 0.2s;
    }
 
    .skins-arrow.left {
        margin-right: 8px;
    }
 
    .skins-arrow.right {
        margin-left: 8px;
    }
 
 
    .mw-body-content {
        line-height: 1.5 !important;
    }
 
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
 
        to {
            opacity: 1;
         }
         }
        btn.classList.remove('desapareciendo');
     }
     }


     @keyframes glowDiamond {
     function updateArrows() {
        const scrollLeft = Math.round(carousel.scrollLeft);
        const maxScrollLeft = Math.round(carousel.scrollWidth - carousel.clientWidth);


         0%,
         const hasLeft = scrollLeft > 5;
         100% {
         const hasRight = scrollLeft < maxScrollLeft - 5;
            box-shadow:
                inset 0 0 8px rgba(255, 255, 255, 0.4),
                0 0 16px rgba(80, 255, 255, 0.6);
        }


         50% {
         if (hasLeft) showArrow(leftBtn);
            box-shadow:
         else hideArrow(leftBtn);
                inset 0 0 16px rgba(255, 255, 255, 0.6),
                0 0 24px rgba(160, 255, 255, 0.8);
         }
    }


    @keyframes moveStars {
         if (hasRight) showArrow(rightBtn);
         0% {
         else hideArrow(rightBtn);
            background-position: 0 0;
         }


         100% {
         wrapper.classList.toggle('has-left', hasLeft);
            background-position: 90px -90px;
         wrapper.classList.toggle('has-right', hasRight);
         }
     }
     }


     @keyframes glow {
     function scrollToAndTrack(targetScroll) {
         0% {
         carousel.scrollTo({ left: targetScroll, behavior: 'smooth' });
            box-shadow: 0 0 2px 1px rgba(255, 255, 0, 0.35);
        }


         50% {
         // Track scroll position every few ms until it's "stable"
             box-shadow: 0 0 4px 2px rgba(255, 255, 0, 0.7);
        let lastPosition = null;
        }
        let stableCount = 0;
 
        const checkInterval = setInterval(() => {
        100% {
             const current = carousel.scrollLeft;
            box-shadow: 0 0 2px 1px rgba(255, 255, 0, 0.35);
            if (current === lastPosition) {
         }
                stableCount++;
                if (stableCount >= 3) {
                    clearInterval(checkInterval);
                    updateArrows(); // final check
                }
            } else {
                stableCount = 0;
                lastPosition = current;
            }
         }, 50);
     }
     }


     @media (max-aspect-ratio: 3/4) {
     leftBtn.addEventListener('click', () => {
         .desc {
         const scrollLeft = carousel.scrollLeft;
            font-size: 30px;
        const nextScroll = Math.max(0, scrollLeft - scrollAmount);
            line-height: 1.5;
         scrollToAndTrack(nextScroll);
            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 {
    rightBtn.addEventListener('click', () => {
            flex: 1;
        const scrollLeft = carousel.scrollLeft;
            display: flex;
        const maxScrollLeft = carousel.scrollWidth - carousel.clientWidth;
            flex-direction: column;
        const nextScroll = Math.min(maxScrollLeft, scrollLeft + scrollAmount);
            width: 96%;
        scrollToAndTrack(nextScroll);
            align-self: center;
    });
        }


        .video-container {
    // Recalcular siempre que haya scroll (por si es manual)
            width: 80%;
    carousel.addEventListener('scroll', updateArrows);
            height: fit-content;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            align-self: center;
            border-radius: 3%;
            margin-top: 2%;
        }


        .art-personaje {
    new ResizeObserver(updateArrows).observe(carousel);
            right: 2%;
            width: 290px;
            top: 1.45vh;
        }


        .tap-btn {
    updateArrows();
            font-size: 30px;
}
        }
 
        .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 {
            font-size: 2.5em;
            margin-top: -12px;
        }
 
        .descripcion-container p {
            font-size: 2.3em;
            margin-bottom: 5px;
        }
 
        .descripcion-container {
            padding: 22px 22px !important;
        }
 
        .tab-btn {
            padding: 14px 22px;
            font-size: 34px;
        }
    }
</style>

Edição das 02h59min de 19 de julho de 2025

function activarFlechasCarrusel() {

   const carousel = document.querySelector('.skins-carousel');
   const wrapper = document.querySelector('.skins-carousel-wrapper');
   const leftBtn = document.querySelector('.skins-arrow.left');
   const rightBtn = document.querySelector('.skins-arrow.right');
   const skinCard = carousel.querySelector('.skin-card');
   if (!skinCard) return;
   const cardStyle = getComputedStyle(skinCard);
   const cardWidth = skinCard.offsetWidth + parseInt(cardStyle.marginRight || 0) + parseInt(cardStyle.marginLeft || 0);
   const scrollAmount = cardWidth;
   function hideArrow(btn) {
       if (!btn.classList.contains('desapareciendo') && btn.style.display !== 'none') {
           btn.classList.add('desapareciendo');
           setTimeout(() => {
               btn.style.display = 'none';
               btn.classList.remove('desapareciendo');
           }, 300);
       }
   }
   function showArrow(btn) {
       if (btn.style.display === 'none') {
           btn.style.display = 'inline-block';
           void btn.offsetWidth;
       }
       btn.classList.remove('desapareciendo');
   }
   function updateArrows() {
       const scrollLeft = Math.round(carousel.scrollLeft);
       const maxScrollLeft = Math.round(carousel.scrollWidth - carousel.clientWidth);
       const hasLeft = scrollLeft > 5;
       const hasRight = scrollLeft < maxScrollLeft - 5;
       if (hasLeft) showArrow(leftBtn);
       else hideArrow(leftBtn);
       if (hasRight) showArrow(rightBtn);
       else hideArrow(rightBtn);
       wrapper.classList.toggle('has-left', hasLeft);
       wrapper.classList.toggle('has-right', hasRight);
   }
   function scrollToAndTrack(targetScroll) {
       carousel.scrollTo({ left: targetScroll, behavior: 'smooth' });
       // Track scroll position every few ms until it's "stable"
       let lastPosition = null;
       let stableCount = 0;
       const checkInterval = setInterval(() => {
           const current = carousel.scrollLeft;
           if (current === lastPosition) {
               stableCount++;
               if (stableCount >= 3) {
                   clearInterval(checkInterval);
                   updateArrows(); // final check
               }
           } else {
               stableCount = 0;
               lastPosition = current;
           }
       }, 50);
   }
   leftBtn.addEventListener('click', () => {
       const scrollLeft = carousel.scrollLeft;
       const nextScroll = Math.max(0, scrollLeft - scrollAmount);
       scrollToAndTrack(nextScroll);
   });
   rightBtn.addEventListener('click', () => {
       const scrollLeft = carousel.scrollLeft;
       const maxScrollLeft = carousel.scrollWidth - carousel.clientWidth;
       const nextScroll = Math.min(maxScrollLeft, scrollLeft + scrollAmount);
       scrollToAndTrack(nextScroll);
   });
   // Recalcular siempre que haya scroll (por si es manual)
   carousel.addEventListener('scroll', updateArrows);
   new ResizeObserver(updateArrows).observe(carousel);
   updateArrows();

}