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

De Wiki Gla
Ir para navegação Ir para pesquisar
m
 
(223 revisões intermediárias por 3 usuários não estão sendo mostradas)
Linha 1: Linha 1:
<div class="skillbox-container">
<style>
     <div class="skillbox-inner">
     .island-grid {
         <div class="skillbox-info-area">
         display: flex;
            <div class="skillbox-wrapper">
        flex-wrap: wrap;
                <div class="skillbox-tabs" id="skill-tabs"></div>
        justify-content: center;
                <div class="skillbox-tabs-separator"></div>
         gap: 10px;
                <div class="skillbox-desc" id="desc-text"></div>
         padding: 12px 0;
            </div>
     }
         </div>
         <div class="skillbox-video-area" id="skill-videos"></div>
     </div>
</div>


<script>
    .island-banner {
    (function () {
        position: relative;
         const raw = document.getElementById('skillbox-data');
        width: 380px;
         if (!raw) return;
        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;
    }


         const habilidades = [];
    .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;
    }


         for (let i = 1; i <= 15; i++) {
    .island-banner:hover {
            const nome = raw.dataset[`hab${i}`];
         transform: translateY(-2px);
            const descricao = raw.dataset[`de${i}`];
        box-shadow: rgba(0, 0, 0, 0.35) 0px 4px 12px;
            const videoFile = raw.dataset[`vid${i}`];
    }
            if (!nome || !videoFile || videoFile.trim() === '') continue;


            habilidades.push({
    .island-banner .island-chests {
                nome,
        position: absolute;
                descricao,
        top: 8px;
                videoUrl: `https://wiki.gla.com.br/index.php/Special:FilePath/${videoFile}`,
        left: 8px;
                id: `video${i}`
        display: flex;
            });
        flex-wrap: wrap;
         }
        gap: 6px;
        z-index: 2;
         pointer-events: none;
    }


        const tabsContainer = document.getElementById('skill-tabs');
    .island-banner .island-chest-group {
         const videoContainer = document.getElementById('skill-videos');
         position: relative;
         const descText = document.getElementById('desc-text');
         display: inline-block;
    }


        habilidades.forEach((hab, idx) => {
    .island-banner .island-chest-group img {
            const btn = document.createElement('button');
        display: block;
            btn.className = 'skillbox-tab' + (idx === 0 ? ' active' : '');
        width: auto;
            btn.dataset.video = hab.id;
        height: auto;
            btn.textContent = hab.nome;
    }
            tabsContainer.appendChild(btn);


            const videoWrapper = document.createElement('div');
    .island-banner .island-chest-count {
            videoWrapper.id = hab.id;
    position: absolute;
            videoWrapper.className = 'skillbox-video' + (idx === 0 ? ' active' : '');
    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;
}


            const video = document.createElement('video');
    .island-banner .island-title {
            video.className = 'skillbox-video-element';
        position: absolute;
            video.controls = true;
        bottom: 10px;
            video.preload = 'auto';
        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;
    }


            const source = document.createElement('source');
    @media (max-width: 768px) {
            source.src = hab.videoUrl;
        .island-grid {
             source.type = 'video/mp4';
             flex-direction: column;
             video.appendChild(source);
             align-items: stretch;
        }


             videoWrapper.appendChild(video);
        .island-banner {
            videoContainer.appendChild(videoWrapper);
            width: 100%;
        });
            max-width: none;
 
        }
        if (habilidades.length) {
    }
            habilidades[0].descricao = habilidades[0].descricao.replace(/'''(.*?)'''/g, '<b>$1</b>');
</style>
            descText.innerHTML = habilidades[0].descricao;
<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() {
         const tabs = document.querySelectorAll('.skillbox-tab');
            document.querySelectorAll('.island-banner[data-href]').forEach(function (el) {
        const videos = document.querySelectorAll('.skillbox-video');
                if (el._icClick) return;
 
                 el._icClick = true;
        tabs.forEach((tab, idx) => {
                el.setAttribute('role', 'link');
            tab.addEventListener('click', () => {
                 el.setAttribute('tabindex', '0');
                 tabs.forEach(t => t.classList.remove('active'));
                 el.addEventListener('click', function () {
                 tab.classList.add('active');
                    var href = el.getAttribute('data-href');
 
                    if (href) window.location.href = href;
                 habilidades[idx].descricao = habilidades[idx].descricao.replace(/'''(.*?)'''/g, '<b>$1</b>');
                });
                descText.innerHTML = habilidades[idx].descricao;
                 el.addEventListener('keydown', function (e) {
 
                     if (e.key === 'Enter' || e.key === ' ') {
                 videos.forEach(v => {
                         e.preventDefault();
                    const videoTag = v.querySelector('video');
                         var href = el.getAttribute('data-href');
                     if (v.id === habilidades[idx].id) {
                         if (href) window.location.href = href;
                         v.classList.add('active');
                         videoTag.currentTime = 0;
                        videoTag.play();
                    } else {
                        v.classList.remove('active');
                         videoTag.pause();
                     }
                     }
                 });
                 });
             });
             });
         });
         }
 
        function run() {
         raw.remove();
            applyBackgrounds();
            initClickable();
        }
         if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', run);
        } else {
            run();
        }
     })();
     })();
</script>
</script>
<style>
.skillbox-video {
    display: none;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    padding: 0;
}
.skillbox-video.active {
    display: flex;
    justify-content: center;
    align-items: center;
}
</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>