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

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


         // ---- Tabs
    .island-banner {
         const tabBtns = $$('.tabs__btn');
        position: relative;
         const panels = $$('.tabs__panel');
        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;
    }


        tabBtns.forEach(btn => {
    .island-banner::before {
            btn.addEventListener('click', () => {
        content: "";
                const id = btn.dataset.tab;
        position: absolute;
                tabBtns.forEach(b => b.classList.remove('is-active'));
        top: 0;
                panels.forEach(p => p.classList.remove('is-active'));
        left: 0;
                btn.classList.add('is-active');
        right: 0;
                const panel = document.getElementById(id);
        bottom: 0;
                if (panel) panel.classList.add('is-active');
        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;
    }


        // ---- Skills
    .island-banner:hover {
         const iconsContainer = $('.skills__icons');
         transform: translateY(-2px);
         const iconItems = iconsContainer ? Array.from(iconsContainer.querySelectorAll('.skills__icon')) : [];
         box-shadow: rgba(0, 0, 0, 0.35) 0px 4px 12px;
        const descBox = $('.skills__desc');
    }
        const videoBox = $('.skills__video');


         const videosCache = {};
    .island-banner .island-chests {
         let totalVideos = 0, loadedVideos = 0, autoplay = false;
        position: absolute;
        top: 8px;
        left: 8px;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
         z-index: 2;
         pointer-events: none;
    }


        // placeholder do vídeo
    .island-banner .island-chest-group {
        let placeholder = null;
        position: relative;
        if (videoBox) {
        display: inline-block;
            placeholder = document.createElement('div');
    }
            placeholder.className = 'video-placeholder';
            placeholder.innerHTML = '<img src="/images/d/d5/Icon_gla.png" alt="Carregando...">';
            videoBox.appendChild(placeholder);
        }
        const removePlaceholder = () => {
            if (!placeholder) return;
            placeholder.classList.add('fade-out');
            placeholder.addEventListener('transitionend', () => {
                placeholder?.remove();
                placeholder = null;
            }, { once: true });
        };


        // pré-carrega vídeos
    .island-banner .island-chest-group img {
        iconItems.forEach(el => {
        display: block;
            const src = (el.dataset.video || '').trim();
        width: auto;
            const idx = el.dataset.index || '';
        height: auto;
            if (!src || !videoBox || videosCache[idx]) return;
    }


            totalVideos++;
    .island-banner .island-chest-count {
            const v = document.createElement('video');
    position: absolute;
            v.controls = true;
    left: 0;          /* era right: 0 */
            v.preload = 'auto';
    bottom: 0;
            v.playsInline = true;
    font-size: 12.5px;  /* era 11px */
            v.style.display = 'none';
    font-weight: bold;
            v.dataset.index = idx;
    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;
}


            const source = document.createElement('source');
    .island-banner .island-title {
            source.src = src;
        position: absolute;
            source.type = 'video/webm';
        bottom: 10px;
            v.appendChild(source);
        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;
    }


            v.addEventListener('canplay', () => {
    @media (max-width: 768px) {
                loadedVideos++;
        .island-grid {
                if (loadedVideos === 1) { v.pause(); v.currentTime = 0; }
            flex-direction: column;
                const active = document.querySelector('.skills__icon.is-active');
            align-items: stretch;
                if (active && active.dataset.index === idx) setTimeout(removePlaceholder, 180);
        }
                if (loadedVideos === totalVideos) autoplay = true;
            });


             v.addEventListener('error', () => {
        .island-banner {
                 loadedVideos++;
             width: 100%;
                 removePlaceholder();
            max-width: none;
                 if (loadedVideos === totalVideos) autoplay = true;
        }
    }
</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';
             });
             });
 
        }
            videoBox.appendChild(v);
        function initClickable() {
             videosCache[idx] = v;
             document.querySelectorAll('.island-banner[data-href]').forEach(function (el) {
        });
                if (el._icClick) return;
 
                el._icClick = true;
        if (totalVideos === 0) removePlaceholder();
                el.setAttribute('role', 'link');
 
                el.setAttribute('tabindex', '0');
        // clique nas skills
                el.addEventListener('click', function () {
        iconItems.forEach(el => {
                    var href = el.getAttribute('data-href');
            const name = el.dataset.name || '';
                    if (href) window.location.href = href;
            const desc = (el.dataset.desc || '').replace(/'''(.*?)'''/g, '<b>$1</b>');
                });
            const attrs = el.dataset.attrs || '';
                 el.addEventListener('keydown', function (e) {
            const idx = el.dataset.index || '';
                     if (e.key === 'Enter' || e.key === ' ') {
            const hasVideo = !!(el.dataset.video && el.dataset.video.trim() !== '');
                         e.preventDefault();
 
                         var href = el.getAttribute('data-href');
            el.title = name;
                         if (href) window.location.href = href;
 
            el.addEventListener('click', () => {
                if (!autoplay && loadedVideos > 0) autoplay = true;
 
                // título + atributos + texto
                if (descBox) {
                    descBox.innerHTML = `
          <div class="skill__title"><h3>${name}</h3></div>
          ${renderAttributes(attrs)}
          <div class="skill__text">${desc}</div>
        `;
                 }
 
                // vídeo
                Object.values(videosCache).forEach(v => { v.pause(); v.style.display = 'none'; });
                if (videoBox) {
                     if (hasVideo && videosCache[idx]) {
                        const v = videosCache[idx];
                        videoBox.style.display = 'block';
                        v.style.display = 'block';
                         v.currentTime = 0;
                         if (autoplay) v.play().catch(() => { });
                    } else {
                         videoBox.style.display = 'none';
                     }
                     }
                 }
                 });
 
                // estado ativo
                iconItems.forEach(i => i.classList.remove('is-active'));
                el.classList.add('is-active');
            });
        });
 
        // seleciona a primeira por padrão
        if (iconItems.length) iconItems[0].click();
 
        // scroll horizontal com roda do mouse
        if (iconsContainer) {
            iconsContainer.addEventListener('wheel', (e) => {
                if (e.deltaY) {
                    e.preventDefault();
                    iconsContainer.scrollLeft += e.deltaY;
                }
             });
             });
         }
         }
 
         function run() {
        // ---- Skins: setas
             applyBackgrounds();
        initSkinsArrows();
             initClickable();
         function initSkinsArrows() {
            const carousel = $('.skins__carousel');
            const left = $('.skins__arrow--left');
            const right = $('.skins__arrow--right');
            if (!carousel || !left || !right) return;
 
            const scrollAmt = () => Math.round(carousel.clientWidth * 0.6);
 
            function update() {
                const max = carousel.scrollWidth - carousel.clientWidth;
                const x = carousel.scrollLeft;
                left.disabled = x <= 0;
                right.disabled = x >= max - 1;
            }
            function go(dir) {
                const max = carousel.scrollWidth - carousel.clientWidth;
                const next = dir < 0
                    ? Math.max(0, carousel.scrollLeft - scrollAmt())
                    : Math.min(max, carousel.scrollLeft + scrollAmt());
                carousel.scrollTo({ left: next, behavior: 'smooth' });
             }
 
            left.addEventListener('click', () => go(-1));
            right.addEventListener('click', () => go(1));
            carousel.addEventListener('scroll', update);
            new ResizeObserver(update).observe(carousel);
             update();
         }
         }
 
         if (document.readyState === 'loading') {
        // ---- atributos (ordem fixa + espaços reservados)
             document.addEventListener('DOMContentLoaded', run);
         function renderAttributes(str) {
         } else {
            const vals = (str || '').split(',').map(v => v.trim());
             run();
            const pve = vals[0]; const pvp = vals[1]; const ene = vals[2]; const cd = vals[3];
 
            const energia = (!ene || ene === '-' || isNaN(parseInt(ene, 10))) ? '-' :
                ((parseInt(ene, 10) > 0 ? '+' : '') + parseInt(ene, 10));
             const recarga = (!cd || cd === '-' || isNaN(parseInt(cd, 10))) ? '-' :
                (parseInt(cd, 10) + ' seg');
 
            const rows = [
                ['Recarga', recarga],
                ['Energia', energia],
                ['Poder', (isNaN(parseInt(pve, 10)) ? '-' : parseInt(pve, 10))],
                ['Poder PvP', (isNaN(parseInt(pvp, 10)) ? '-' : parseInt(pvp, 10))]
            ];
 
            return `
      <div class="attrs">
         ${rows.map(([label, value]) => `
          <div class="attrs__row${value === '-' ? ' attrs__row--empty' : ''}">
            <span class="attrs__label">${label}:</span>
             <span class="attrs__value">${value}</span>
          </div>
        `).join('')}
      </div>
    `;
         }
         }
     })();
     })();
</script>
</script>
<style>
/* -------------------- Base / resets -------------------- */
img { pointer-events: none; user-select: none; }
video { max-height: 33.25em; object-fit: fill; }
.mw-body { padding: unset !important; }
.mw-body-content { line-height: 1.5 !important; }
/* Se sua wiki injeta parágrafos soltos acima, mantenha: */
.mw-body-content p { display: none; }
/* -------------------- Character container -------------------- */
.character {
  position: relative;
  width: 100%;
  margin: 0 auto;
  color: #000;
  font-family: 'Noto Sans', sans-serif !important;
  user-select: none;
}
.character p { display: unset; }
/* Header + banner + art */
.character__header {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.character__banner {
  position: absolute;
  inset: 0;
  z-index: -9;
  background-size: cover;
  background-position: center;
}
.character__banner::before{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(to right, rgba(0,0,0,.6), rgba(0,0,0,.2));
}
.character__art {
  position: absolute;
  right: 3.5rem;
  top: -3.1rem;
  width: 34.3vw; height: auto;
  z-index: 1; pointer-events: none;
}
/* Topbar: avatar, nome e tags */
.character__topbar {
  display:flex; flex-direction:column; align-items:flex-start;
  padding: 8px 20px; padding-top:4px;
}
.character__namebox { display:flex; align-items:center; gap:14px; }
.character__avatar { margin-top:8px; width:100px; height:100px; object-fit:none; }
.character__name {
  font-family:'Orbitron', sans-serif; font-weight:900;
  font-size:56px; color:#fff;
  text-shadow: 0 0 6px #000, 0 0 9px #000;
}
.character__tags { display:flex; gap:9px; flex-wrap:wrap; margin-left:.28rem; }
.character__tag {
  background:#353420; color:#fff; border-radius:4px;
  padding:1px 6px; font-size:.9em; font-weight:bold;
  outline:2px solid #000; box-shadow:0 0 2px rgb(0 0 0 / 70%);
}
.character.tier-bronze  .character__tag--tier { outline-color:#7b4e2f !important; }
.character.tier-silver  .character__tag--tier { outline-color:#d6d2d2 !important; }
.character.tier-gold    .character__tag--tier { outline-color:#fcd300 !important; }
.character.tier-diamond .character__tag--tier { outline-color:#60dae2 !important; }
/* -------------------- Tabs -------------------- */
.tabs { margin:4px 0 4px 8px; display:flex; gap:12px; justify-content:flex-start; }
.tabs__btn{
  padding:5px 20px; background:#333; color:#fff;
  border:2px solid transparent; border-radius:8px;
  font-size:20px; font-weight:600; line-height:1; cursor:pointer;
  transition: background .15s ease, border-color .15s ease;
}
.tabs__btn.is-active{ background:#156bc7; border-color:#156bc7; }
.tabs__panel{
  display:none; background:#26211cd6; padding:0 8px 8px;
  position:relative; z-index:3;
}
.tabs__panel.is-active{ display:block; }
/* -------------------- Skills -------------------- */
.skills { display:flex; gap:20px; }
.skills__icons{
  display:flex; gap:10px; flex-wrap:nowrap;
  width:100%; overflow-x:auto; overflow-y:hidden;
  padding:10px 0 3px 1px; margin-bottom:6px;
  position:relative; z-index:4; justify-content:flex-start;
  scrollbar-width: thin; scrollbar-color:#ababab transparent; scroll-behavior:smooth;
}
.skills__icons::-webkit-scrollbar { height:6px; }
.skills__icons::-webkit-scrollbar-track { background:transparent; }
.skills__icons::-webkit-scrollbar-thumb { background:#151515; border-radius:3px; }
.skills__icon{
  flex:0 0 auto; width:50px; height:50px; border-radius:5px; cursor:pointer;
  transition: transform .2s, box-shadow .2s;
}
.skills__icon.is-active{ box-shadow:0 0 0 1.5px #FFD700; }
.skills__icon img{ width:100%; height:100%; object-fit:cover; }
/* Descrição da skill */
.skills__desc{
  flex:1; width:50%; display:flex; flex-direction:column; gap:10px; justify-content:center;
  min-height:27.5rem; height:100%;
  padding:4px 16px !important; padding-top:0 !important;
  background:#26211C; color:#fff; border-radius:8px;
  position:relative; z-index:99;
  box-shadow:0 6px 18px rgba(0,0,0,.28); backdrop-filter: blur(2px);
  text-shadow:-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.skill__title h3{
  font-size:2.7em; margin:0; padding-top:0; text-align:center; color:#fff;
}
.skill__text{ font-size:1.2em; margin:0; }
.skill__text *{ font-size:inherit !important; line-height:inherit; }
/* Atributos (ordem fixa, linhas reservadas) */
.attrs{ display:flex; flex-direction:column; gap:4px; margin:4px 0 10px; }
.skills__desc .attrs, .skills__desc .attrs *{ text-shadow:none; font-family:'Noto Sans', sans-serif; }
.attrs__row{
  min-height:22px; display:flex; align-items:center; gap:6px;
}
.attrs__row--empty{ visibility:hidden; }
.attrs__label{ font-weight:700; color:#f0c87b; font-size:.95rem; }
.attrs__value{ color:#fff; font-weight:800; font-size:1.05rem; letter-spacing:.01em; }
/* Vídeo da skill */
.skills__video{
  position:relative; width:43%;
  background:#000; display:flex; align-items:center; justify-content:center;
  border-radius:2%; overflow:hidden; z-index:999;
  box-shadow:0 8px 24px rgba(0,0,0,.35);
}
.video-placeholder{
  position:absolute; inset:0; background:#000;
  display:flex; align-items:center; justify-content:center;
  z-index:2; opacity:1; transition:opacity .9s ease;
}
.video-placeholder img{ width:120px; height:auto; animation:breathe 2.5s ease-in-out infinite; filter:drop-shadow(0 0 6px rgba(255,255,255,.3)); }
.video-placeholder.fade-out{ opacity:0; }
@keyframes breathe { 0%,100%{ transform:scale(1); opacity:1; } 50%{ transform:scale(1.07); opacity:.85; } }
video::-webkit-media-controls{ opacity:0; transition:opacity .3s; }
video:hover::-webkit-media-controls{ opacity:1; }
/* -------------------- Skins -------------------- */
.skins__title{
  display:block; width:47%; margin-bottom:10px; padding-bottom:0;
  font-family:'Noto Sans', sans-serif !important; font-weight:700;
  font-size:40px; color:#fff; text-align:center; border-bottom:none;
}
.skins__wrapper{
  min-height:21.1rem; max-height:60%;
  padding:0 16px 1px !important;
  background:#26211C; color:#fff; border-radius:8px;
  position:relative; z-index:99;
  box-shadow:0 8px 24px rgba(0,0,0,.35); backdrop-filter: blur(2px);
  display:flex; gap:10px; justify-content:center; align-items:center;
  text-shadow:-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  overflow:visible; transition: all .3s ease;
}
/* Gradientes laterais quando houver rolagem */
.skins__wrapper::before, .skins__wrapper::after{
  content:""; position:absolute; top:0; width:60px; height:100%;
  pointer-events:none; opacity:0; transition:opacity .4s ease; z-index:3;
}
.skins__wrapper::before{ left:0;  background:linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); }
.skins__wrapper::after { right:0; background:linear-gradient(to left,  rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); }
.skins__wrapper.has-left::before, .skins__wrapper.has-right::after{ opacity:1; }
.skins__carousel{
  display:flex; gap:1vw; flex-grow:1;
  overflow-x:auto; padding:10px 0; scroll-behavior:smooth;
}
.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{ mask-image: linear-gradient(to right, black 0px, black calc(100% - 40px), transparent 100%); }
.skins__carousel.no-mask  { mask-image:none; }
.skins__carousel::-webkit-scrollbar{ display:none; }
.skins__arrow{
  background:none; border:none; color:#fff; font-size:36px; cursor:pointer; padding:8px; z-index:5;
  transition: opacity .3s ease, transform .3s ease;
}
.skins__arrow--left { margin-right:8px; }
.skins__arrow--right{ margin-left:8px; }
.skins__arrow.hidden{ opacity:0; transform:scale(.8); pointer-events:none; visibility:hidden; }
.skin-card{
  position:relative; width:12vw; height:39vh; flex:0 0 auto;
  border:2px solid #697EC9 !important; border-radius:8px; overflow:hidden;
  background:#111; box-shadow:0 2px 10px rgba(0,0,0,.25);
}
.skin-card::before{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:2;
  box-shadow: inset 0 0 8px rgba(180,180,180,.18);
}
.skins--imageBanner{ width:100%; height:109%; }
.skins--imageBanner img{ width:100%; height:100%; object-fit:cover; filter:brightness(.5); scale:1.1; }
.skins--imageSkin img{
  position:absolute; bottom:10px; left:50%; transform:translateX(-50%);
  height:140px; width:auto; z-index:2; transition:transform .2s;
}
/* -------------------- Responsive (tela alta / mobile) -------------------- */
@media (max-aspect-ratio: 3/4){
  .skills { flex-direction:column-reverse; gap:20px; }
  .skills__desc{ padding:22px !important; }
  .skills__icons{ width:98%; place-self:center; padding:10px 0 16px 1px; }
  .skills__icon{ width:80px; height:80px; }
  .skill__title h3{ font-size:3.6em; margin-top:-14px; }
  .skill__text{ font-size:2.3em; margin-bottom:5px; }
  .skills__video{ width:80%; border-radius:3%; margin-top:2%; align-self:center; }
  .character__art{ display:none; width:370px; height:290px; right:.5rem; top:1.1rem; z-index:1; }
  .tabs__btn{ padding:10px 20px; font-size:26px; }
  .tabs__panel{ position:relative; z-index:1; padding:0 8px 20px; }
  .character__tag{ padding:0 5px; font-size:1.4em; }
  .attrs__row{ min-height:26px; }
  .attrs__label{ font-size:1.2rem; }
  .attrs__value{ font-size:1.25rem; }
  .skins__carousel{ gap:20px; }
  .skin-card{ width:236px; height:400px; }
  .skins--imageSkin img{ height:170px; }
  .skins__title{ width:100% !important; }
  .skins__arrow{ display:none !important; }
  .skins__wrapper::before, .skins__wrapper::after{ background:unset; }
  video::-webkit-media-controls{ opacity:unset; transition:unset; }
  video:hover::-webkit-media-controls{ opacity:unset; }
}
</style>

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>