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

De Wiki Gla
Ir para navegação Ir para pesquisar
m
Etiqueta: Revertido
m
 
(170 revisões intermediárias por 3 usuários não estão sendo mostradas)
Linha 1: Linha 1:
<script>
<style>
(function(){
    .island-grid {
  var css =
        display: flex;
  ".gx-overlay{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:2147483647}"+
        flex-wrap: wrap;
  ".gx-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.86)}"+
        justify-content: center;
  ".gx-modal{position:relative;display:flex;align-items:center;justify-content:center;pointer-events:none}"+
        gap: 10px;
  ".gx-box{position:relative;display:inline-block;background:#000;border-radius:12px;box-shadow:0 10px 40px rgba(0,0,0,.5);overflow:hidden;pointer-events:auto}"+
        padding: 12px 0;
  ".gx-img{display:block;max-width:min(92vw,1200px);max-height:92vh;width:auto;height:auto}"+
    }
  ".gx-close{position:absolute;top:6px;right:6px;width:34px;height:34px;border-radius:999px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.38);color:#fff;font-size:22px;line-height:32px;text-align:center;cursor:pointer}"+
 
  ".gifbox{cursor:pointer;text-decoration:underline;color:#0645ad}"+
    .island-banner {
  ".gifbox:visited{color:#0b0080}"+
        position: relative;
  ".gx-open{overflow:hidden!important}";
        width: 380px;
  var style=document.createElement("style");style.type="text/css";style.appendChild(document.createTextNode(css));document.head.appendChild(style);
        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;
    }


  var overlay=document.createElement("div");
    .island-banner .island-chests {
  overlay.className="gx-overlay";overlay.setAttribute("role","dialog");overlay.setAttribute("aria-modal","true");
        position: absolute;
  overlay.innerHTML='<div class="gx-backdrop"></div><div class="gx-modal"><div class="gx-box"><button class="gx-close" type="button" aria-label="Fechar">&times;</button><img class="gx-img" src="" alt="" loading="eager" decoding="async" referrerpolicy="no-referrer"></div></div>';
        top: 8px;
  document.body.appendChild(overlay);
        left: 8px;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        z-index: 2;
        pointer-events: none;
    }


  var backdrop=overlay.querySelector(".gx-backdrop");
    .island-banner .island-chest-group {
  var box=overlay.querySelector(".gx-box");
        position: relative;
  var img=overlay.querySelector(".gx-img");
        display: inline-block;
  var closeBtn=overlay.querySelector(".gx-close");
    }
  var lastActive=null;


  function openBox(url,altText){
     .island-banner .island-chest-group img {
    if(!url)return;
        display: block;
     lastActive=document.activeElement;
        width: auto;
    document.body.classList.add("gx-open");
        height: auto;
    img.removeAttribute("width");img.removeAttribute("height");
     }
    img.src=url; img.alt=altText||"";
    overlay.style.display="flex";
    // garante centralização mesmo antes do load
    box.style.width="auto"; box.style.height="auto";
    // após carregar, não deixa “caixa maior que o necessário”
    if(img.complete){fit()} else {img.addEventListener("load",fit,{once:true});}
     closeBtn.focus();
  }


  function fit(){
    .island-banner .island-chest-count {
     // nada de tamanhos fixos: a caixa segue a imagem escalada
     position: absolute;
     box.style.width="auto"; box.style.height="auto";
    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;
}


  function closeBox(){
     .island-banner .island-title {
     overlay.style.display="none";
        position: absolute;
    document.body.classList.remove("gx-open");
        bottom: 10px;
    img.src=""; img.alt="";
        left: 8px;
    if(lastActive && lastActive.focus) lastActive.focus();
        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;
    }


  overlay.addEventListener("click",function(e){
    @media (max-width: 768px) {
    if(e.target===overlay||e.target===backdrop) closeBox();
        .island-grid {
  });
            flex-direction: column;
  closeBtn.addEventListener("click",closeBox);
            align-items: stretch;
  document.addEventListener("keydown",function(e){ if(e.key==="Escape") closeBox(); });
        }


  document.addEventListener("click",function(e){
        .island-banner {
    var t=e.target;
            width: 100%;
    while(t && t!==document){
            max-width: none;
      if(t.classList && t.classList.contains("gifbox")) break;
        }
      t=t.parentNode;
     }
     }
     if(!t || t===document) return;
</style>
    e.preventDefault();
<script>
    var url=t.getAttribute("data-gif")||t.getAttribute("href");
     (function () {
    var alt=t.getAttribute("data-alt")||t.textContent.trim();
        function applyBackgrounds() {
    if(!url) return;
            document.querySelectorAll('.island-banner[data-bgimg]').forEach(function (el) {
    openBox(url,alt);
                var filename = el.getAttribute('data-bgimg');
  },false);
                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>
</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>