Mudanças entre as edições de "Widget:Item"
Ir para navegação
Ir para pesquisar
m |
m |
||
| (3 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
| Linha 32: | Linha 32: | ||
display: block; | display: block; | ||
margin: 0 auto; | margin: 0 auto; | ||
} | |||
/* Categoria special_item (Módulo:Item.lua adiciona .item-wrapper-special) */ | |||
.item-wrapper-special { | |||
filter: drop-shadow(0 0 4px rgba(232, 200, 74, 0.55)); | |||
} | |||
.item-wrapper-special .item-tooltip-body { | |||
border-color: rgba(232, 200, 74, 0.45); | |||
background: linear-gradient(180deg, #2d2a22 0%, #1e1c18 100%); | |||
} | |||
.item-wrapper-special .item-tooltip-cat { | |||
color: #d4b44a; | |||
} | } | ||
| Linha 57: | Linha 71: | ||
} | } | ||
.item-wrapper | /* Reward dentro de wikitable: | ||
cria espaço para o badge de quantidade (que é absolute/bottom negativo) | |||
position: | não sobrepor a linha horizontal da tabela. */ | ||
.wikitable td .reward-items .item-wrapper { | |||
margin-bottom: 10px; | |||
} | |||
/* ===== TOOLTIP ===== */ | |||
.item-tooltip { | |||
display: none; | |||
width: 230px; | |||
pointer-events: none; | |||
flex-direction: column; | |||
align-items: center; | |||
filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.55)); | |||
} | |||
.item-tooltip.tooltip-visible { | |||
display: flex; | |||
position: fixed; | |||
z-index: 999999; | |||
} | |||
.item-tooltip-body { | |||
display: flex; | |||
flex-direction: column; | |||
width: 100%; | |||
background: linear-gradient(180deg, #2a2a3d 0%, #1e1e30 100%); | |||
border: 1px solid rgba(100, 100, 160, 0.3); | |||
border-radius: 8px; | |||
padding: 12px 16px; | |||
box-sizing: border-box; | box-sizing: border-box; | ||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |||
color: # | } | ||
font-size: | .item-tooltip-name { | ||
display: block; | |||
font-size: 14px; | |||
font-weight: 700; | |||
color: #ffffff; | |||
text-align: center; | |||
line-height: 1.3; | |||
} | |||
.item-tooltip-cat { | |||
display: block; | |||
font-size: 10px; | |||
color: #7e7e9e; | |||
text-align: center; | |||
margin-top: 3px; | |||
text-transform: uppercase; | |||
letter-spacing: 0.8px; | |||
font-weight: 600; | font-weight: 600; | ||
line-height: 1. | } | ||
.item-tooltip-sep { | |||
display: block; | |||
height: 1px; | |||
background: linear-gradient(90deg, transparent 0%, rgba(120, 120, 180, 0.35) 50%, transparent 100%); | |||
margin: 9px 0; | |||
width: 100%; | |||
} | |||
.item-tooltip-desc { | |||
display: block; | |||
font-size: 12px; | |||
color: #b0b0cc; | |||
line-height: 1.5; | |||
text-align: center; | text-align: center; | ||
} | } | ||
.item- | .item-tooltip-footer { | ||
display: flex; | |||
justify-content: center; | |||
gap: 14px; | |||
margin-top: 10px; | |||
padding-top: 8px; | |||
border- | border-top: 1px solid rgba(120, 120, 180, 0.18); | ||
border- | } | ||
border- | |||
.item-tooltip-val { | |||
font-size: 11px; | |||
color: #e8c84a; | |||
font-weight: 600; | |||
} | |||
.item-tooltip-lvl { | |||
font-size: 11px; | |||
color: #6ab4ff; | |||
font-weight: 600; | |||
} | |||
/* Seta padrão: aponta para baixo (tooltip acima do item) */ | |||
.item-tooltip-arrow { | |||
display: block; | |||
width: 0; | |||
height: 0; | |||
border-left: 8px solid transparent; | |||
border-right: 8px solid transparent; | |||
border-top: 8px solid #1e1e30; | |||
border-bottom: none; | |||
flex-shrink: 0; | |||
} | |||
/* Tooltip abaixo do item: inverte a ordem e a seta */ | |||
.item-tooltip.tooltip-below { | |||
flex-direction: column-reverse; | |||
} | |||
.item-tooltip.tooltip-below .item-tooltip-arrow { | |||
border-top: none; | |||
border-bottom: 8px solid #2a2a3d; | |||
} | |||
/* Deslocamento horizontal */ | |||
.item-tooltip.tooltip-shift-right { | |||
align-items: flex-start; | |||
} | |||
.item-tooltip.tooltip-shift-right .item-tooltip-arrow { | |||
margin-left: var(--arrow-offset, 12px); | |||
} | |||
.item-tooltip.tooltip-shift-left { | |||
align-items: flex-end; | |||
} | |||
.item-tooltip.tooltip-shift-left .item-tooltip-arrow { | |||
margin-right: var(--arrow-offset, 12px); | |||
} | } | ||
</style> | </style> | ||
<script> | |||
(function () { | |||
var TIP_WIDTH = 230; | |||
var MARGIN = 8; | |||
var GAP = 6; | |||
var activeTip = null; | |||
var activeWrapper = null; | |||
function showTooltip(wrapper) { | |||
hideTooltip(); | |||
var tip = wrapper.querySelector('.item-tooltip'); | |||
if (!tip) return; | |||
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'); | |||
var rect = wrapper.getBoundingClientRect(); | |||
var tipH = tip.offsetHeight; | |||
var tipW = tip.offsetWidth || TIP_WIDTH; | |||
var centerX = rect.left + rect.width / 2; | |||
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.style.setProperty('--arrow-offset', Math.max(12, centerX - left) + 'px'); | |||
} else if (left + tipW > window.innerWidth - MARGIN) { | |||
left = Math.min(window.innerWidth - MARGIN - tipW, rect.right - tipW); | |||
tip.classList.add('tooltip-shift-left'); | |||
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) { | |||
var el = e.target; | |||
var wrapper = el.closest ? el.closest('.item-wrapper') : null; | |||
if (wrapper && wrapper !== activeWrapper) { | |||
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> | |||
</includeonly> | </includeonly> | ||