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

De Wiki Gla
Ir para navegação Ir para pesquisar
m
m
 
(201 revisões intermediárias por 3 usuários não estão sendo mostradas)
Linha 1: Linha 1:
  <div class="map-container" id="map">
<style>
     <!-- Caveiras e elementos serão inseridos via JS -->
     .island-grid {
  </div>
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 12px 0;
    }


  <script>
     .island-banner {
     const skulls = [
         position: relative;
      {
         width: 380px;
         x: 410, y: 220,
         height: 90px;
         title: "White Skull",
         overflow: hidden;
         desc: "Boss: White Skull<br>Área sombria, cuidado com os ataques surpresa!"
         border-radius: 8px;
      },
         box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 10px;
      {
         cursor: pointer;
         x: 650, y: 125,
         transition: transform 0.15s, box-shadow 0.15s;
         title: "Red Fang",
         display: block;
         desc: "Boss: Red Fang<br>Possui resistência a fogo. Traga ataques de gelo!"
         box-sizing: border-box;
      },
    }
      {
        x: 250, y: 410,
         title: "Void Wraith",
         desc: "Boss: Void Wraith<br>Evite ataques diretos. Usa magia de sombras."
      },
      {
         x: 248, y: 320,
         title: "Night Howler",
        desc: "Boss: Night Howler<br>Ataca com velocidade e confusão. Use proteção contra atordoamento!"
      }
    ];


     const hearts = [
     .island-banner::before {
      { x: 280, y: 210, desc: "Cura escondida: Quebre a caixa para obter uma cura." },
        content: "";
      { x: 312, y: 196 },
        position: absolute;
      { x: 245, y: 358, desc: "Após o chefe, o jogador com menos vida receberá uma cura automática." }
        top: 0;
    ];
        left: 0;
 
        right: 0;
    const puzzleButton = {
        bottom: 0;
      x: 244,
        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%);
      y: 217,
        pointer-events: none;
      videoUrl: "https://www.youtube.com/embed/10rhyP32vdw"
        z-index: 1;
    };
    }
 
    const map = document.getElementById("map");
 
    // Adiciona as caveiras
    skulls.forEach((skull, index) => {
      const icon = document.createElement("img");
      icon.src = "/images/d/dc/Whiteskull.png";
      icon.className = "skull-icon";
      icon.style.left = skull.x + "px";
      icon.style.top = skull.y + "px";
      icon.dataset.index = index;
 
      const popup = document.createElement("div");
      popup.className = "popup";
      popup.innerHTML = `<strong>${skull.title}</strong><br>${skull.desc}`;
      popup.style.left = (skull.x + 30) + "px";
      popup.style.top = (skull.y - 10) + "px";


      icon.addEventListener("click", () => {
     .island-banner:hover {
        popup.style.display = popup.style.display === "block" ? "none" : "block";
         transform: translateY(-2px);
      });
         box-shadow: rgba(0, 0, 0, 0.35) 0px 4px 12px;
 
      document.addEventListener("click", (e) => {
        if (!icon.contains(e.target) && !popup.contains(e.target)) {
          popup.style.display = "none";
        }
      });
 
      map.appendChild(icon);
      map.appendChild(popup);
     });
 
    // Adiciona os corações
    hearts.forEach((heart, index) => {
      const icon = document.createElement("img");
      const desc = heart.desc || "Pegue o coração para se curar";
      icon.src = "/images/d/d9/Heart.png";
      icon.className = "heart-icon";
      icon.style.left = heart.x + "px";
      icon.style.top = heart.y + "px";
      icon.dataset.index = index;
 
      const popup = document.createElement("div");
      popup.className = "popup";
      popup.innerHTML = `<strong>Cura</strong><br>${desc}`;
      popup.style.left = (heart.x + 30) + "px";
      popup.style.top = (heart.y - 10) + "px";
 
      icon.addEventListener("click", () => {
         popup.style.display = popup.style.display === "block" ? "none" : "block";
      });
 
      document.addEventListener("click", (e) => {
        if (!icon.contains(e.target) && !popup.contains(e.target)) {
          popup.style.display = "none";
         }
      });
 
      map.appendChild(icon);
      map.appendChild(popup);
    });
 
    // Ícone do Puzzle
    const button = document.createElement("img");
    button.className = "puzzle-button";
    button.src = "/images/d/de/Engrenagem.png";
    button.alt = "Puzzle";
    button.style.left = puzzleButton.x + "px";
    button.style.top = puzzleButton.y + "px";
 
    const popup = document.createElement("div");
    popup.className = "popup";
    popup.style.left = (puzzleButton.x + 60) + "px";
    popup.style.top = (puzzleButton.y - 10) + "px";
    popup.innerHTML = `
      <strong>Desafio Puzzle</strong><br>
      <iframe width="400" height="260"
        src="${puzzleButton.videoUrl}"
        frameborder="0"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
        allowfullscreen>
      </iframe>
    `;
 
    button.addEventListener("click", () => {
      popup.style.display = popup.style.display === "block" ? "none" : "block";
    });
 
    document.addEventListener("click", (e) => {
      if (!button.contains(e.target) && !popup.contains(e.target)) {
        popup.style.display = "none";
      }
    });
 
    map.appendChild(button);
    map.appendChild(popup);
// CSS
    document.head.insertAdjacentHTML('beforeend', `
  <style>
    .map-container {
      position: relative;
      width: 811px;
      height: 554px;
      background: url('/images/5/55/SabaodyMap.png') no-repeat center center;
      background-size: cover;
     }
     }


     .skull-icon {
     .island-banner .island-chests {
      position: absolute;
        position: absolute;
      width: 24px;
        top: 8px;
      height: 24px;
        left: 8px;
      cursor: pointer;
        display: flex;
      transition: transform 0.2s, filter 0.2s;
        flex-wrap: wrap;
        gap: 6px;
        z-index: 2;
        pointer-events: none;
     }
     }


     .heart-icon {
     .island-banner .island-chest-group {
      position: absolute;
        position: relative;
      width: 26px;
        display: inline-block;
      height: 26px;
      padding: 1px;
      cursor: pointer;
      transition: transform 0.2s, filter 0.2s;
     }
     }


     .skull-icon:hover,
     .island-banner .island-chest-group img {
    .heart-icon:hover,
        display: block;
    .puzzle-button:hover {
        width: auto;
      transform: scale(1.3);
        height: auto;
      filter: brightness(1.5);
     }
     }


     .popup {
     .island-banner .island-chest-count {
      position: absolute;
    position: absolute;
      background: #1e1e1e;
    left: 0;         /* era right: 0 */
      color: #fff;
    bottom: 0;
      padding: 10px 14px;
    font-size: 12.5px; /* era 11px */
      border-radius: 8px;
    font-weight: bold;
      border: 1px solid #444;
    color: #fff;
      box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.75);
      display: none;
    padding: 1px 3px;
      z-index: 10;
    border-radius: 3px;
      max-width: 500px;
    line-height: 1;
      font-size: 14px;
    white-space: nowrap;
      animation: fadeIn 0.3s ease-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
    z-index: 10;
}


     .popup iframe {
     .island-banner .island-title {
      border-radius: 6px;
        position: absolute;
      margin-top: 6px;
        bottom: 10px;
      max-width: 100%;
        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;
     }
     }


     .puzzle-button {
     @media (max-width: 768px) {
      position: absolute;
        .island-grid {
      cursor: pointer;
            flex-direction: column;
      z-index: 999;
            align-items: stretch;
      width: 28px;
        }
      height: 28px;
      transition: transform 0.2s, filter 0.2s;
    }


    @keyframes fadeIn {
        .island-banner {
      from { opacity: 0; transform: translateY(-5px); }
            width: 100%;
      to { opacity: 1; transform: translateY(0); }
            max-width: none;
        }
     }
     }
  </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>
</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>