TOOLTIPS: game kit applet refactor — .token-tooltip → .tt + double-tooltip fix

- _applet-game-kit.html: all 5 token blocks use .tt + child classes (.tt-title,
  .tt-description, .tt-shoptalk, .tt-expiry); removed .token-tooltip-body wrapper
- gameboard.js: 4× querySelector('.token-tooltip') → querySelector('.tt')
- _gameboard.scss: extend hover suppressor to .tt so CSS hover doesn't show inline
  .tt when JS portal is active (fixed double tooltip visual bug)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-04-15 22:39:01 -04:00
parent de4ac60aec
commit 10a6809dcf
3 changed files with 37 additions and 46 deletions

View File

@@ -41,7 +41,7 @@ function initGameKitTooltips() {
if (!inRect(e.clientX, e.clientY, { left, top, right, bottom })) closePortals();
} else if (!portal.classList.contains('active')) {
for (const tokenEl of gameKit.querySelectorAll('.token')) {
if (!tokenEl.querySelector('.token-tooltip')) continue;
if (!tokenEl.querySelector('.tt')) continue;
if (inRect(e.clientX, e.clientY, tokenEl.getBoundingClientRect())) {
showPortals(tokenEl);
break;
@@ -116,7 +116,7 @@ function initGameKitTooltips() {
function showPortals(token) {
equipping = false;
activeToken = token;
const tooltip = token.querySelector('.token-tooltip');
const tooltip = token.querySelector('.tt');
portal.innerHTML = tooltip.innerHTML;
portal.classList.add('active');
portal.style.display = 'block';
@@ -161,14 +161,14 @@ function initGameKitTooltips() {
document.addEventListener('mouseover', (e) => {
const tokenEl = e.target.closest('#id_game_kit .token');
if (!tokenEl || !tokenEl.querySelector('.token-tooltip')) return;
if (!tokenEl || !tokenEl.querySelector('.tt')) return;
if (!portal.classList.contains('active') || activeToken !== tokenEl) {
showPortals(tokenEl);
}
});
gameKit.querySelectorAll('.token').forEach(tokenEl => {
if (!tokenEl.querySelector('.token-tooltip')) return;
if (!tokenEl.querySelector('.tt')) return;
tokenEl.addEventListener('mouseenter', () => {
if (!portal.classList.contains('active') || activeToken !== tokenEl) {
showPortals(tokenEl);