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

De Wiki Gla
Ir para navegação Ir para pesquisar
m
Etiqueta: Revertido
m
 
(191 revisões intermediárias por 3 usuários não estão sendo mostradas)
Linha 1: Linha 1:
<script>
<style>
(function() {
    .island-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 12px 0;
    }


     // Tabs functionality
     .island-banner {
    const buttons = document.querySelectorAll('.character-tab-btn');
        position: relative;
    const contents = document.querySelectorAll('.character-tab-content');
        width: 380px;
    buttons.forEach(btn => btn.addEventListener('click', () => {
        height: 90px;
         buttons.forEach(b => b.classList.remove('active'));
        overflow: hidden;
         contents.forEach(c => c.classList.remove('active'));
        border-radius: 8px;
         btn.classList.add('active');
        box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 10px;
         document.getElementById(btn.dataset.tab).classList.add('active');
         cursor: pointer;
     }));
         transition: transform 0.15s, box-shadow 0.15s;
         display: block;
         box-sizing: border-box;
     }


     activateCarouselArrows();
     .island-banner::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(105deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.1) 70%, transparent 100%);
        pointer-events: none;
        z-index: 1;
    }


     const skillsBar = document.querySelector('.character-skills-bar');
     .island-banner:hover {
    const descriptionBox = document.querySelector('.character-description-box');
        transform: translateY(-2px);
    const videoBox = document.querySelector('.character-video-box');
        box-shadow: rgba(0, 0, 0, 0.35) 0px 4px 12px;
     const skillIcons = [...skillsBar.querySelectorAll('.character-skill-icon')];
     }


     skillIcons.forEach(div => {
     .island-banner .island-chests {
         const name = div.dataset.name;
         position: absolute;
         const desc = div.dataset.desc.replace(/'''(.*?)'''/g, '<b>$1</b>');
         top: 8px;
         const attr = div.dataset.attr;
         left: 8px;
         const video = div.dataset.video;
         display: flex;
 
        flex-wrap: wrap;
         div.title = name;
         gap: 6px;
 
         z-index: 2;
         div.addEventListener('click', () => {
        pointer-events: none;
            descriptionBox.innerHTML = `
    }
                <div class="character-skill-title">
                    <h3>${name}</h3>
                    <div class="character-tooltip-container">
                        <button class="character-info-btn">i</button>
                        <span class="character-tooltip-text">
                        Extra information, tips or effects for this skill.
                        </span>
                    </div>
                </div>
                ${generateAttributesHTML(attr)}
                <div class="character-desc-text">${desc}</div>`;
 
            videoBox.innerHTML = video ? `
                <video width="100%" controls playsinline>
                <source src="${video}" type="video/webm">
                </video>` : '';


            skillIcons.forEach(c => c.classList.remove('active'));
     .island-banner .island-chest-group {
            div.classList.add('active');
         position: relative;
        });
         display: inline-block;
 
        ['data-name', 'data-desc', 'data-attr', 'data-video', 'data-index'].forEach(attr => div.removeAttribute(attr));
     });
 
    if (skillIcons.length) skillIcons[0].click();
 
    skillsBar.addEventListener('wheel', e => {
        if (e.deltaY) {
            e.preventDefault();
            skillsBar.scrollLeft += e.deltaY;
        }
    });
 
    function activateCarouselArrows() {
        const carousel = document.querySelector('.character-skins-carousel');
        const wrapper = document.querySelector('.character-skins-carousel-wrapper');
        const [leftBtn, rightBtn] = ['.character-skins-arrow.left', '.character-skins-arrow.right'].map(sel => document.querySelector(sel));
        let isPredictingScroll = false;
 
        const getScrollAmount = () => carousel.clientWidth * 0.6;
 
        const hideArrow = btn => {
            if (!btn.classList.contains('hiding') && btn.style.display !== 'none') {
                btn.classList.add('hiding');
                setTimeout(() => {
                    btn.style.display = 'none';
                    btn.classList.remove('hiding');
                }, 300);
            }
         };
 
         const showArrow = btn => {
            if (btn.style.display === 'none') {
                btn.style.display = 'inline-block';
                void btn.offsetWidth;
            }
            btn.classList.remove('hiding');
        };
 
        const setArrowsState = scrollLeft => {
            const maxScroll = carousel.scrollWidth - carousel.clientWidth;
            const hasLeft = scrollLeft > 5, hasRight = scrollLeft < maxScroll - 5;
            hasLeft ? showArrow(leftBtn) : hideArrow(leftBtn);
            hasRight ? showArrow(rightBtn) : hideArrow(rightBtn);
            wrapper.classList.toggle('has-left', hasLeft);
            wrapper.classList.toggle('has-right', hasRight);
            if (!hasLeft && !hasRight) { carousel.style.justifyContent = 'center'; } else { carousel.style.justifyContent = ''; }
        };
 
        const handleArrowClick = dir => {
            isPredictingScroll = true;
            const scrollLeft = carousel.scrollLeft, maxScroll = carousel.scrollWidth - carousel.clientWidth;
            const nextScroll = dir === 'left' ? Math.max(0, scrollLeft - getScrollAmount()) : Math.min(maxScroll, scrollLeft + getScrollAmount());
 
            setArrowsState(nextScroll);
            carousel.scrollTo({ left: nextScroll, behavior: 'smooth' });
 
            let last = -1, still = 0;
            const wait = setInterval(() => {
                const current = Math.round(carousel.scrollLeft);
                if (current === last) {
                    if (++still >= 2) {
                        clearInterval(wait);
                        isPredictingScroll = false;
                        setArrowsState(current);
                    }
                } else {
                    last = current;
                    still = 0;
                }
            }, 50);
        };
 
        carousel.addEventListener('scroll', () => {
            if (!isPredictingScroll) setArrowsState(carousel.scrollLeft);
        });
 
        new ResizeObserver(() => {
            if (!isPredictingScroll) setArrowsState(carousel.scrollLeft);
        }).observe(carousel);
 
        leftBtn.addEventListener('click', () => handleArrowClick('left'));
        rightBtn.addEventListener('click', () => handleArrowClick('right'));
        setArrowsState(carousel.scrollLeft);
     }
     }


     function generateAttributesHTML(str) {
     .island-banner .island-chest-group img {
        const vals = str.split(',').map(v => v.trim());
        display: block;
        const title = ['PVE Power','PVP Power','Energy','Cooldown'];
        width: auto;
        return `
        height: auto;
            <div class="character-attributes-cards">
                ${vals.map((v, i) => {
                    let f = v === '-' ? '-' : parseInt(v);
                    if (i === 2 && !isNaN(f)) f = (f > 0 ? '+' : '') + f;
                    return `
                        <div class="character-attribute-card">
                            <span class="character-attribute-title">${title[i]}</span>
                            <h2 class="character-attribute-value">${f}${i === 3 && f !== '-' ? ' sec' : ''}</h2>
                        </div>
                    `;
                }).join('')}
            </div>`;
     }
     }
})();
</script>


<style>
     .island-banner .island-chest-count {
.character-box {
     position: absolute;
    padding: 24px;
     left: 0;         /* era right: 0 */
    color: #fff;
     bottom: 0;
    font-family: 'Orbitron', 'Noto Sans', Arial, sans-serif;
     font-size: 12.5px; /* era 11px */
    width: 98%;
    margin: 28px auto;
    position: relative;
    user-select: none;
    background: #1c2025;
    border-radius: 18px;
    box-shadow: 0 2px 24px #0008;
    max-width: 1200px;
}
.character-header {
    display: flex;
     align-items: flex-start;
    gap: 24px;
    margin-bottom: 10px;
}
.character-icon {
    width: 88px;
    height: 88px;
    border-radius: 9px;
    object-fit: cover;
    border: 3px solid #2bd8d3;
    background: #181b1e;
}
.character-info-block {
     display: flex;
     flex-direction: column;
    gap: 4px;
}
.character-name {
    font-size: 3.3em;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #fff;
     margin-bottom: 2px;
    text-shadow: 2px 2px 0 #1ca8b6;
}
.character-classes {
     font-size: 1.12em;
    color: #2bd8d3;
    margin-bottom: 3px;
     font-weight: bold;
     font-weight: bold;
    display: flex;
    gap: 10px;
}
.character-desc {
    background: #1a252e;
    color: #b6eaff;
    border-radius: 7px;
    padding: 9px 16px;
    font-size: 1.21em;
    margin-top: 5px;
    box-shadow: 0 1px 4px #0003;
    max-width: 650px;
}
.character-tabs {
    margin: 20px 0 8px 0;
    display: flex;
    gap: 16px;
}
.character-tab-btn {
    padding: 7px 28px;
    font-size: 1.14em;
    border: none;
    border-radius: 6px;
    background: #393a40;
     color: #fff;
     color: #fff;
     font-weight: bold;
     background: rgba(0, 0, 0, 0.75);
     cursor: pointer;
     padding: 1px 3px;
     transition: background .18s;
     border-radius: 3px;
     outline: none;
     line-height: 1;
     letter-spacing: 1px;
     white-space: nowrap;
}
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
.character-tab-btn.active {
     z-index: 10;
    background: #2bd8d3;
     color: #191c1d;
}
}


.character-tab-content {
    .island-banner .island-title {
    display: none;
        position: absolute;
}
        bottom: 10px;
.character-tab-content.active {
        left: 8px;
    display: block;
        font-size: 1.35em;
    margin-top: 10px;
        font-weight: bold;
}
        color: #fff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
        line-height: 1.2;
        z-index: 2;
        pointer-events: none;
        text-transform: uppercase;
    }


.character-skills-bar {
     @media (max-width: 768px) {
     display: flex;
        .island-grid {
    flex-wrap: nowrap;
            flex-direction: column;
    gap: 14px;
            align-items: stretch;
    padding: 6px 0 10px 2px;
        }
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #2bd8d3 #181b1e;
    margin-bottom: 6px;
}
.character-skill-icon {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 1px 5px #0004;
    transition: border 0.2s, box-shadow 0.2s, transform 0.12s;
    background: #181b1e;
    display: flex;
    align-items: center;
    justify-content: center;
}
.character-skill-icon.active {
    border: 2.5px solid #2bd8d3;
    box-shadow: 0 0 0 3px #2bd8d366;
    transform: scale(1.11);
}
.character-skill-icon img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}


.character-main-content {
        .island-banner {
    display: flex;
            width: 100%;
    gap: 24px;
            max-width: none;
    margin-top: 10px;
        }
}
     }
.character-description-box {
    flex: 1 1 60%;
    display: flex;
    flex-direction: column;
    gap: 13px;
    background: #181b1e;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 0 16px #0003;
    min-width: 350px;
    max-width: 600px;
}
.character-desc-text {
    color: #fff;
    font-size: 1.1em;
}
.character-skill-title h3 {
    font-size: 2.3em;
    letter-spacing: 1.6px;
    margin-bottom: 3px;
    color: #2bd8d3;
}
.character-attributes-cards {
    display: flex;
    gap: 17px;
    margin-bottom: 9px;
}
.character-attribute-card {
    background: #2bd8d320;
    border-radius: 6px;
    padding: 10px;
    min-width: 80px;
    text-align: center;
    color: #fff;
    font-weight: 600;
}
.character-attribute-title {
    font-size: 1.1em;
    color: #b6eaff;
}
.character-attribute-value {
    font-size: 1.22em;
    color: #fff;
}
 
.character-video-box {
    flex: 1 1 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #181b1e;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 0 16px #0003;
    min-width: 350px;
    max-width: 600px;
    min-height: 240px;
    margin-left: 10px;
}
 
.character-tooltip-container {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}
.character-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 #000;
    font-size: 40px;
    padding: 0;
    line-height: 24px;
    text-align: center;
}
.character-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;
}
.character-tooltip-container:hover .character-tooltip-text {
    visibility: visible;
    opacity: 1;
}
 
@media (max-width: 1050px) {
    .character-main-content { flex-direction: column; }
    .character-video-box, .character-description-box { max-width: 100%; min-width: 0; }
}
</style>
</style>
<script>
    (function () {
        function applyBackgrounds() {
            document.querySelectorAll('.island-banner[data-bgimg]').forEach(function (el) {
                var filename = el.getAttribute('data-bgimg');
                if (!filename) return;
                var url;
                if (typeof mw !== 'undefined' && mw.util && mw.util.getUrl) {
                    url = mw.util.getUrl('Especial:FilePath/' + filename);
                } else {
                    url = '/index.php?title=Especial:FilePath/' + encodeURIComponent(filename);
                }
                el.style.backgroundImage = 'url(' + url + ')';
                el.style.backgroundSize = 'cover';
                el.style.backgroundPosition = 'center';
                el.style.backgroundRepeat = 'no-repeat';
            });
        }
        function initClickable() {
            document.querySelectorAll('.island-banner[data-href]').forEach(function (el) {
                if (el._icClick) return;
                el._icClick = true;
                el.setAttribute('role', 'link');
                el.setAttribute('tabindex', '0');
                el.addEventListener('click', function () {
                    var href = el.getAttribute('data-href');
                    if (href) window.location.href = href;
                });
                el.addEventListener('keydown', function (e) {
                    if (e.key === 'Enter' || e.key === ' ') {
                        e.preventDefault();
                        var href = el.getAttribute('data-href');
                        if (href) window.location.href = href;
                    }
                });
            });
        }
        function run() {
            applyBackgrounds();
            initClickable();
        }
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', run);
        } else {
            run();
        }
    })();
</script>

Edição atual tal como às 00h06min de 13 de março de 2026

<style>

   .island-grid {
       display: flex;
       flex-wrap: wrap;
       justify-content: center;
       gap: 10px;
       padding: 12px 0;
   }
   .island-banner {
       position: relative;
       width: 380px;
       height: 90px;
       overflow: hidden;
       border-radius: 8px;
       box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 10px;
       cursor: pointer;
       transition: transform 0.15s, box-shadow 0.15s;
       display: block;
       box-sizing: border-box;
   }
   .island-banner::before {
       content: "";
       position: absolute;
       top: 0;
       left: 0;
       right: 0;
       bottom: 0;
       background: linear-gradient(105deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.1) 70%, transparent 100%);
       pointer-events: none;
       z-index: 1;
   }
   .island-banner:hover {
       transform: translateY(-2px);
       box-shadow: rgba(0, 0, 0, 0.35) 0px 4px 12px;
   }
   .island-banner .island-chests {
       position: absolute;
       top: 8px;
       left: 8px;
       display: flex;
       flex-wrap: wrap;
       gap: 6px;
       z-index: 2;
       pointer-events: none;
   }
   .island-banner .island-chest-group {
       position: relative;
       display: inline-block;
   }
   .island-banner .island-chest-group img {
       display: block;
       width: auto;
       height: auto;
   }
   .island-banner .island-chest-count {
   position: absolute;
   left: 0;          /* era right: 0 */
   bottom: 0;
   font-size: 12.5px;  /* era 11px */
   font-weight: bold;
   color: #fff;
   background: rgba(0, 0, 0, 0.75);
   padding: 1px 3px;
   border-radius: 3px;
   line-height: 1;
   white-space: nowrap;
   box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
   z-index: 10;

}

   .island-banner .island-title {
       position: absolute;
       bottom: 10px;
       left: 8px;
       font-size: 1.35em;
       font-weight: bold;
       color: #fff;
       text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
       line-height: 1.2;
       z-index: 2;
       pointer-events: none;
       text-transform: uppercase;
   }
   @media (max-width: 768px) {
       .island-grid {
           flex-direction: column;
           align-items: stretch;
       }
       .island-banner {
           width: 100%;
           max-width: none;
       }
   }

</style> <script>

   (function () {
       function applyBackgrounds() {
           document.querySelectorAll('.island-banner[data-bgimg]').forEach(function (el) {
               var filename = el.getAttribute('data-bgimg');
               if (!filename) return;
               var url;
               if (typeof mw !== 'undefined' && mw.util && mw.util.getUrl) {
                   url = mw.util.getUrl('Especial:FilePath/' + filename);
               } else {
                   url = '/index.php?title=Especial:FilePath/' + encodeURIComponent(filename);
               }
               el.style.backgroundImage = 'url(' + url + ')';
               el.style.backgroundSize = 'cover';
               el.style.backgroundPosition = 'center';
               el.style.backgroundRepeat = 'no-repeat';
           });
       }
       function initClickable() {
           document.querySelectorAll('.island-banner[data-href]').forEach(function (el) {
               if (el._icClick) return;
               el._icClick = true;
               el.setAttribute('role', 'link');
               el.setAttribute('tabindex', '0');
               el.addEventListener('click', function () {
                   var href = el.getAttribute('data-href');
                   if (href) window.location.href = href;
               });
               el.addEventListener('keydown', function (e) {
                   if (e.key === 'Enter' || e.key === ' ') {
                       e.preventDefault();
                       var href = el.getAttribute('data-href');
                       if (href) window.location.href = href;
                   }
               });
           });
       }
       function run() {
           applyBackgrounds();
           initClickable();
       }
       if (document.readyState === 'loading') {
           document.addEventListener('DOMContentLoaded', run);
       } else {
           run();
       }
   })();

</script>