Mudanças entre as edições de "Widget:Item"
Ir para navegação
Ir para pesquisar
m |
m |
||
| Linha 27: | Linha 27: | ||
text-align: center; | text-align: center; | ||
overflow: visible; | overflow: visible; | ||
} | |||
.item-wrapper:hover { | |||
z-index: 99999; | |||
} | } | ||
| Linha 57: | Linha 61: | ||
} | } | ||
.item | /* ===== TOOLTIP ===== */ | ||
.item-tooltip { | |||
display: none; | |||
position: absolute; | position: absolute; | ||
bottom: calc(100% + | bottom: calc(100% + 12px); | ||
left: 50%; | left: 50%; | ||
transform: translateX(-50%); | transform: translateX(-50%); | ||
width: | width: 230px; | ||
z-index: 99999; | |||
pointer-events: none; | |||
flex-direction: column; | |||
align-items: center; | |||
filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.55)); | |||
} | |||
.item-wrapper:hover .item-tooltip { | |||
display: flex; | |||
} | |||
.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-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; | |||
} | |||
.item-tooltip-arrow { | |||
display: block; | |||
width: 0; | |||
height: 0; | |||
border-left: 8px solid transparent; | |||
border-right: 8px solid transparent; | |||
border-top: 8px solid #1e1e30; | |||
flex-shrink: 0; | |||
} | |||
/* Deslocamento inteligente: tooltip empurrado para a direita */ | |||
.item-tooltip.tooltip-shift-right { | |||
left: 0; | |||
transform: none; | |||
align-items: flex-start; | |||
} | |||
.item-tooltip.tooltip-shift-right .item-tooltip-arrow { | |||
margin-left: var(--arrow-offset, 12px); | |||
} | |||
/* Deslocamento inteligente: tooltip empurrado para a esquerda */ | |||
.item-tooltip.tooltip-shift-left { | |||
left: auto; | |||
right: 0; | |||
transform: none; | |||
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 EDGE_MARGIN = 10; | |||
function positionTooltip(wrapper) { | |||
var tip = wrapper.querySelector('.item-tooltip'); | |||
if (!tip) return; | |||
tip.classList.remove('tooltip-shift-right', 'tooltip-shift-left'); | |||
tip.style.removeProperty('--arrow-offset'); | |||
var rect = wrapper.getBoundingClientRect(); | |||
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) { | |||
tip.classList.add('tooltip-shift-right'); | |||
tip.style.setProperty('--arrow-offset', arrowCenter + 'px'); | |||
} else if (centerX + halfTip > window.innerWidth - EDGE_MARGIN) { | |||
tip.classList.add('tooltip-shift-left'); | |||
tip.style.setProperty('--arrow-offset', arrowCenter + 'px'); | |||
} | |||
} | |||
document.addEventListener('mouseover', function (e) { | |||
var wrapper = e.target.closest | |||
? e.target.closest('.item-wrapper') | |||
: null; | |||
if (wrapper) positionTooltip(wrapper); | |||
}); | |||
})(); | |||
</script> | |||
</includeonly> | </includeonly> | ||