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

De Wiki Gla
Ir para navegação Ir para pesquisar
m
m
 
(7 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 1: Linha 1:
<includeonly>
<includeonly>
    <!--
      Tooltip: o HTML das passivas/descrição vem do Módulo:Item (Scribunto), função renderOne.
      Este widget só aplica estilos (.item-tooltip-passive-*) e o script de posição no hover.
      Se as passivas não aparecem, confira Módulo:ItemDB (dados) e Módulo:Item.lua na wiki.
    -->
     <style>
     <style>
         .reward-wrapper {
         .reward-wrapper {
Linha 27: Linha 32:
             text-align: center;
             text-align: center;
             overflow: visible;
             overflow: visible;
        }
        .item-wrapper:hover {
            z-index: 99999;
         }
         }


Linha 36: Linha 37:
             display: block;
             display: block;
             margin: 0 auto;
             margin: 0 auto;
        }
        .item-icon-placeholder {
            display: inline-block;
            width: 28px;
            height: 28px;
            margin: 2px auto 0;
            border-radius: 4px;
            background: linear-gradient(135deg, #3a3a52 0%, #252536 100%);
            border: 1px solid rgba(120, 120, 180, 0.35);
            box-sizing: border-box;
            vertical-align: middle;
        }
        /* Categoria special_item — destaque dourado (item especial no jogo) */
        .item-wrapper-special {
            filter: drop-shadow(0 0 6px rgba(200, 150, 60, 0.45));
        }
        .item-wrapper-special .item-tooltip-body {
            border-color: #8a7352;
            background-color: #221910;
            box-shadow:
                inset 0 1px 0 rgba(255, 220, 180, 0.04),
                0 4px 14px rgba(0, 0, 0, 0.5);
        }
        .item-wrapper-special .item-tooltip-name {
            color: #c9b078;
        }
        .item-wrapper-special .item-tooltip-cat {
            color: rgba(255, 250, 240, 0.88);
        }
        .item-wrapper-special .item-tooltip-sep {
            background: rgba(92, 74, 49, 0.75);
         }
         }


Linha 61: Linha 99:
         }
         }


         /* ===== TOOLTIP ===== */
        /* Reward dentro de wikitable:
          cria espaço para o badge de quantidade (que é absolute/bottom negativo)
          não sobrepor a linha horizontal da tabela. */
        .wikitable td .reward-items .item-wrapper {
            margin-bottom: 10px;
        }
 
         /* ===== TOOLTIP (estilo marrom / ouro — próximo ao jogo) ===== */


         .item-tooltip {
         .item-tooltip {
             display: none;
             display: none;
             position: absolute;
             width: 280px;
             bottom: calc(100% + 12px);
             max-width: min(280px, calc(100vw - 16px));
            left: 50%;
            transform: translateX(-50%);
            width: 230px;
            z-index: 99999;
             pointer-events: none;
             pointer-events: none;
             flex-direction: column;
             flex-direction: column;
             align-items: center;
             align-items: center;
             filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.55));
             filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.65));
         }
         }


         .item-wrapper:hover .item-tooltip {
         .item-tooltip.tooltip-visible {
             display: flex;
             display: flex;
            position: fixed;
            z-index: 999999;
         }
         }


Linha 85: Linha 128:
             flex-direction: column;
             flex-direction: column;
             width: 100%;
             width: 100%;
             background: linear-gradient(180deg, #2a2a3d 0%, #1e1e30 100%);
             background-color: #1a110d;
             border: 1px solid rgba(100, 100, 160, 0.3);
             border: 2px solid #5c4838;
             border-radius: 8px;
             border-radius: 0;
             padding: 12px 16px;
             padding: 11px 14px 12px;
             box-sizing: border-box;
             box-sizing: border-box;
             font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
             font-family: Tahoma, "Segoe UI", Arial, sans-serif;
            /* Brilho interno quase imperceptível (sem degradê no fundo) */
            box-shadow: inset 0 1px 0 rgba(255, 245, 220, 0.035);
         }
         }


         .item-tooltip-name {
         .item-tooltip-name {
             display: block;
             display: block;
             font-size: 14px;
             font-size: 15px;
             font-weight: 700;
             font-weight: 700;
             color: #ffffff;
             color: #c4a96a;
             text-align: center;
             text-align: center;
             line-height: 1.3;
             line-height: 1.25;
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
         }
         }


         .item-tooltip-cat {
         .item-tooltip-cat {
             display: block;
             display: block;
             font-size: 10px;
             font-size: 11px;
             color: #7e7e9e;
             color: rgba(255, 252, 248, 0.82);
             text-align: center;
             text-align: center;
             margin-top: 3px;
             margin-top: 4px;
             text-transform: uppercase;
             text-transform: none;
             letter-spacing: 0.8px;
             letter-spacing: 0.02em;
             font-weight: 600;
             font-weight: 700;
         }
         }


Linha 116: Linha 162:
             display: block;
             display: block;
             height: 1px;
             height: 1px;
             background: linear-gradient(90deg, transparent 0%, rgba(120, 120, 180, 0.35) 50%, transparent 100%);
             background: #5c4a31;
             margin: 9px 0;
            /* Encosta nas bordas internas da caixa (ignora padding lateral) */
             width: 100%;
            margin: 8px -14px 10px;
            width: calc(100% + 28px);
             max-width: none;
             flex-shrink: 0;
         }
         }


Linha 124: Linha 173:
             display: block;
             display: block;
             font-size: 12px;
             font-size: 12px;
             color: #b0b0cc;
             color: #92a8d4;
             line-height: 1.5;
             line-height: 1.5;
             text-align: center;
             text-align: center;
            font-weight: 600;
            margin-top: 2px;
        }
        .item-tooltip-level {
            display: block;
            font-size: 12px;
            color: rgba(255, 252, 248, 0.9);
            text-align: left;
            margin-top: 0;
            font-weight: 700;
            width: 100%;
        }
        .item-tooltip-passives {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 8px;
            width: 100%;
        }
        .item-tooltip-passive-row {
            display: flex;
            align-items: center;
            gap: 8px;
            text-align: left;
        }
        .item-tooltip-passive-badge {
            flex-shrink: 0;
            width: 22px;
            height: 22px;
            box-sizing: border-box;
            border-radius: 50%;
            background: #2c2824;
            border: 1px solid #4a433c;
            color: #e8e4dc;
            font-size: 11px;
            font-weight: 700;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .item-tooltip-passive-text {
            flex: 1;
            font-size: 11px;
            color: #9a9490;
            line-height: 1.45;
            font-weight: 600;
         }
         }


         .item-tooltip-footer {
         .item-tooltip-footer {
             display: flex;
             display: flex;
             justify-content: center;
             justify-content: flex-end;
            align-items: center;
             gap: 14px;
             gap: 14px;
             margin-top: 10px;
             margin-top: 12px;
             padding-top: 8px;
             padding-top: 10px;
             border-top: 1px solid rgba(120, 120, 180, 0.18);
             border-top: 1px solid transparent;
            width: 100%;
         }
         }


         .item-tooltip-val {
         .item-tooltip-val {
             font-size: 11px;
             font-size: 12px;
             color: #e8c84a;
             color: #b8a06e;
             font-weight: 600;
             font-weight: 700;
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
         }
         }


         .item-tooltip-lvl {
         .item-tooltip-lvl {
             font-size: 11px;
             font-size: 11px;
             color: #6ab4ff;
             color: rgba(255, 252, 248, 0.88);
             font-weight: 600;
             font-weight: 700;
         }
         }


        /* Seta — cor sólida igual ao fundo */
         .item-tooltip-arrow {
         .item-tooltip-arrow {
             display: block;
             display: block;
Linha 156: Linha 261:
             border-left: 8px solid transparent;
             border-left: 8px solid transparent;
             border-right: 8px solid transparent;
             border-right: 8px solid transparent;
             border-top: 8px solid #1e1e30;
             border-top: 8px solid #1a110d;
            border-bottom: none;
             flex-shrink: 0;
             flex-shrink: 0;
         }
         }


         /* Deslocamento inteligente: tooltip empurrado para a direita */
        .item-tooltip.tooltip-below {
            flex-direction: column-reverse;
        }
 
        .item-tooltip.tooltip-below .item-tooltip-arrow {
            border-top: none;
            border-bottom: 8px solid #1a110d;
        }
 
         /* Deslocamento horizontal */
         .item-tooltip.tooltip-shift-right {
         .item-tooltip.tooltip-shift-right {
            left: 0;
            transform: none;
             align-items: flex-start;
             align-items: flex-start;
         }
         }
Linha 171: Linha 284:
         }
         }


        /* Deslocamento inteligente: tooltip empurrado para a esquerda */
         .item-tooltip.tooltip-shift-left {
         .item-tooltip.tooltip-shift-left {
            left: auto;
            right: 0;
            transform: none;
             align-items: flex-end;
             align-items: flex-end;
         }
         }
Linha 186: Linha 295:
     <script>
     <script>
         (function () {
         (function () {
             var TIP_WIDTH = 230;
             var TIP_WIDTH = 280;
             var EDGE_MARGIN = 10;
             var MARGIN = 8;
            var GAP = 6;
            var activeTip = null;
            var activeWrapper = null;
 
            function showTooltip(wrapper) {
                hideTooltip();


            function positionTooltip(wrapper) {
                 var tip = wrapper.querySelector('.item-tooltip');
                 var tip = wrapper.querySelector('.item-tooltip');
                 if (!tip) return;
                 if (!tip) return;


                 tip.classList.remove('tooltip-shift-right', 'tooltip-shift-left');
                activeWrapper = wrapper;
                activeTip = tip;
 
                document.body.appendChild(tip);
                tip.classList.add('tooltip-visible');
                 tip.classList.remove('tooltip-below', 'tooltip-shift-right', 'tooltip-shift-left');
                 tip.style.removeProperty('--arrow-offset');
                 tip.style.removeProperty('--arrow-offset');


                 var rect = wrapper.getBoundingClientRect();
                 var rect = wrapper.getBoundingClientRect();
                var tipH = tip.offsetHeight;
                var tipW = tip.offsetWidth || TIP_WIDTH;
                 var centerX = rect.left + rect.width / 2;
                 var centerX = rect.left + rect.width / 2;
                var halfTip = TIP_WIDTH / 2;
                var arrowCenter = Math.max(12, Math.min(TIP_WIDTH - 12, rect.width / 2));


                 if (centerX - halfTip < EDGE_MARGIN) {
                 var above = rect.top - tipH - GAP;
                var below = rect.bottom + GAP;
                var top;
 
                if (above >= MARGIN) {
                    top = above;
                } else if (below + tipH <= window.innerHeight - MARGIN) {
                    top = below;
                    tip.classList.add('tooltip-below');
                } else {
                    top = Math.max(MARGIN, Math.min(above, window.innerHeight - MARGIN - tipH));
                }
 
                var left = centerX - tipW / 2;
 
                if (left < MARGIN) {
                    left = Math.max(MARGIN, rect.left);
                     tip.classList.add('tooltip-shift-right');
                     tip.classList.add('tooltip-shift-right');
                     tip.style.setProperty('--arrow-offset', arrowCenter + 'px');
                     tip.style.setProperty('--arrow-offset', Math.max(12, centerX - left) + 'px');
                 } else if (centerX + halfTip > window.innerWidth - EDGE_MARGIN) {
                 } else if (left + tipW > window.innerWidth - MARGIN) {
                    left = Math.min(window.innerWidth - MARGIN - tipW, rect.right - tipW);
                     tip.classList.add('tooltip-shift-left');
                     tip.classList.add('tooltip-shift-left');
                     tip.style.setProperty('--arrow-offset', arrowCenter + 'px');
                     tip.style.setProperty('--arrow-offset', Math.max(12, (left + tipW) - centerX) + 'px');
                }
 
                tip.style.top = top + 'px';
                tip.style.left = left + 'px';
            }
 
            function hideTooltip() {
                if (activeTip && activeWrapper) {
                    activeTip.classList.remove('tooltip-visible', 'tooltip-below', 'tooltip-shift-right', 'tooltip-shift-left');
                    activeTip.style.top = '';
                    activeTip.style.left = '';
                    activeTip.style.removeProperty('--arrow-offset');
                    activeWrapper.appendChild(activeTip);
                    activeTip = null;
                    activeWrapper = null;
                 }
                 }
             }
             }


             document.addEventListener('mouseover', function (e) {
             document.addEventListener('mouseover', function (e) {
                 var wrapper = e.target.closest
                 var el = e.target;
                     ? e.target.closest('.item-wrapper')
                var wrapper = el.closest ? el.closest('.item-wrapper') : null;
                    : null;
                if (wrapper && wrapper !== activeWrapper) {
                 if (wrapper) positionTooltip(wrapper);
                     showTooltip(wrapper);
                }
            });
 
            document.addEventListener('mouseout', function (e) {
                if (!activeWrapper) return;
                var wrapper = e.target.closest ? e.target.closest('.item-wrapper') : null;
                 if (wrapper === activeWrapper && !activeWrapper.contains(e.relatedTarget)) {
                    hideTooltip();
                }
             });
             });
         })();
         })();
     </script>
     </script>
</includeonly>
</includeonly>

Edição atual tal como às 22h58min de 8 de abril de 2026