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

De Wiki Gla
Ir para navegação Ir para pesquisar
m
m
Linha 1: Linha 1:
<style>
<style>
    /* Estilo inspirado no Menu Quest da Tibia Wiki - botões de redirecionamento */
     .weekly-bosses {
     .weekly-bosses {
         display: flex;
         display: flex;
Linha 11: Linha 10:
     .weekly-bosses__btn {
     .weekly-bosses__btn {
         display: inline-block;
         display: inline-block;
         border: 0.14em solid #F5A00F;
         border: 0.14em solid #2a4a6a;
         padding: 5px 0;
         padding: 5px 0;
         text-align: center;
         text-align: center;
Linha 22: Linha 21:
         transition: all 0.2s ease;
         transition: all 0.2s ease;
         min-width: 120px;
         min-width: 120px;
        overflow: hidden;
     }
     }


Linha 32: Linha 32:


     .weekly-bosses__btn:hover {
     .weekly-bosses__btn:hover {
         box-shadow: 0 0 0.5em #3E3F40;
         box-shadow: 0 0 0.5em #2a4a6a;
         color: #F5A00F;
         color: #F5A00F;
         transform: translateY(-2px);
         transform: translateY(-2px);
        border-color: #3a5a7a;
     }
     }


     .weekly-bosses__btn:focus-within {
     .weekly-bosses__btn:focus-within {
         outline: 2px solid #F5A00F;
         outline: 2px solid #2a4a6a;
         outline-offset: 2px;
         outline-offset: 2px;
     }
     }


     .weekly-bosses__btn img {
     .weekly-bosses__btn-img {
         width: 48px;
         overflow: hidden;
         height: 48px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto 4px;
        min-height: 64px;
    }
 
    .weekly-bosses__btn-img img {
        max-width: none;
        width: auto;
        height: auto;
        min-width: 64px;
         min-height: 64px;
         object-fit: contain;
         object-fit: contain;
        object-position: 50% 50%;
         image-rendering: pixelated;
         image-rendering: pixelated;
         image-rendering: -moz-crisp-edges;
         image-rendering: -moz-crisp-edges;
         image-rendering: crisp-edges;
         image-rendering: crisp-edges;
         display: block;
         display: block;
        margin: 0 auto 4px;
     }
     }


Linha 96: Linha 109:
                     }
                     }
                 });
                 });
            });
        }
        function applyImageStyles() {
            document.querySelectorAll(".weekly-bosses__btn").forEach(function (el) {
                var wrap = el.querySelector(".weekly-bosses__btn-img");
                var img = el.querySelector(".weekly-bosses__btn-img img, .weekly-bosses__btn img");
                if (!img) return;
                var size = el.getAttribute("data-imgsize");
                var x = el.getAttribute("data-imgx");
                var y = el.getAttribute("data-imgy");
                var px = size ? (size.replace(/[^0-9]/g, "") || "80") : "80";
                if (size) {
                    img.style.minWidth = px + "px";
                    img.style.minHeight = px + "px";
                    img.style.width = px + "px";
                    img.style.height = px + "px";
                    if (wrap) {
                        wrap.style.width = px + "px";
                        wrap.style.height = px + "px";
                        wrap.style.minHeight = px + "px";
                    }
                }
                var ox = (x === "" || x === null) ? "50%" : x;
                var oy = (y === "" || y === null) ? "50%" : y;
                img.style.objectPosition = ox + " " + oy;
             });
             });
         }
         }
         function run() {
         function run() {
             applyBackgrounds();
             applyBackgrounds();
            applyImageStyles();
             initClickable();
             initClickable();
         }
         }

Edição das 04h33min de 22 de fevereiro de 2026

<style>

   .weekly-bosses {
       display: flex;
       flex-wrap: wrap;
       gap: 12px;
       justify-content: center;
       padding: 16px 0;
   }
   .weekly-bosses__btn {
       display: inline-block;
       border: 0.14em solid #2a4a6a;
       padding: 5px 0;
       text-align: center;
       color: #F5A00F;
       font-weight: bold;
       font-size: 14px;
       border-radius: 10px;
       background: linear-gradient(120deg, rgba(18, 34, 45, 1) 0%, rgba(22, 40, 55, 1) 25%, rgba(26, 46, 65, 1) 50%, rgba(30, 52, 74, 1) 75%, rgba(34, 58, 84, 1) 100%);
       cursor: pointer;
       transition: all 0.2s ease;
       min-width: 120px;
       overflow: hidden;
   }
   .weekly-bosses__btn a {
       display: block;
       color: inherit;
       text-decoration: none;
       padding: 8px 16px;
   }
   .weekly-bosses__btn:hover {
       box-shadow: 0 0 0.5em #2a4a6a;
       color: #F5A00F;
       transform: translateY(-2px);
       border-color: #3a5a7a;
   }
   .weekly-bosses__btn:focus-within {
       outline: 2px solid #2a4a6a;
       outline-offset: 2px;
   }
   .weekly-bosses__btn-img {
       overflow: hidden;
       display: flex;
       justify-content: center;
       align-items: center;
       margin: 0 auto 4px;
       min-height: 64px;
   }
   .weekly-bosses__btn-img img {
       max-width: none;
       width: auto;
       height: auto;
       min-width: 64px;
       min-height: 64px;
       object-fit: contain;
       object-position: 50% 50%;
       image-rendering: pixelated;
       image-rendering: -moz-crisp-edges;
       image-rendering: crisp-edges;
       display: block;
   }
   .weekly-bosses__btn table {
       margin: 0 auto;
   }
   @media (max-width: 600px) {
       .weekly-bosses {
           flex-direction: column;
       }
       .weekly-bosses__btn {
           width: 100%;
       }
   }

</style>

<script>

   (function () {
       function applyBackgrounds() {
           document.querySelectorAll(".weekly-bosses__btn[data-background]").forEach(function (el) {
               el.style.background = el.getAttribute("data-background") || "#2a3544";
           });
       }
       function initClickable() {
           document.querySelectorAll(".weekly-bosses__btn[data-href], .weekly-bosses__btn[data-link]").forEach(function (el) {
               if (el._wbClick) return;
               el._wbClick = true;
               el.setAttribute("role", "link");
               el.setAttribute("tabindex", "0");
               el.style.cursor = "pointer";
               el.addEventListener("click", function (e) {
                   e.preventDefault();
                   var url = el.getAttribute("data-href");
                   if (!url && el.getAttribute("data-link")) {
                       url = (typeof mw !== "undefined" && mw.util && mw.util.getUrl) ? mw.util.getUrl(el.getAttribute("data-link")) : ("/index.php?title=" + encodeURIComponent(el.getAttribute("data-link")));
                   }
                   if (url) window.location.href = url;
               });
               el.addEventListener("keydown", function (e) {
                   if (e.key === "Enter" || e.key === " ") {
                       e.preventDefault();
                       el.click();
                   }
               });
           });
       }
       function applyImageStyles() {
           document.querySelectorAll(".weekly-bosses__btn").forEach(function (el) {
               var wrap = el.querySelector(".weekly-bosses__btn-img");
               var img = el.querySelector(".weekly-bosses__btn-img img, .weekly-bosses__btn img");
               if (!img) return;
               var size = el.getAttribute("data-imgsize");
               var x = el.getAttribute("data-imgx");
               var y = el.getAttribute("data-imgy");
               var px = size ? (size.replace(/[^0-9]/g, "") || "80") : "80";
               if (size) {
                   img.style.minWidth = px + "px";
                   img.style.minHeight = px + "px";
                   img.style.width = px + "px";
                   img.style.height = px + "px";
                   if (wrap) {
                       wrap.style.width = px + "px";
                       wrap.style.height = px + "px";
                       wrap.style.minHeight = px + "px";
                   }
               }
               var ox = (x === "" || x === null) ? "50%" : x;
               var oy = (y === "" || y === null) ? "50%" : y;
               img.style.objectPosition = ox + " " + oy;
           });
       }
       function run() {
           applyBackgrounds();
           applyImageStyles();
           initClickable();
       }
       if (document.readyState === "loading") {
           document.addEventListener("DOMContentLoaded", run);
       } else {
           run();
       }
   })();

</script>