diff --git a/src/apps/gameboard/static/apps/gameboard/gameboard.js b/src/apps/gameboard/static/apps/gameboard/gameboard.js index 5d735cc..51f3eae 100644 --- a/src/apps/gameboard/static/apps/gameboard/gameboard.js +++ b/src/apps/gameboard/static/apps/gameboard/gameboard.js @@ -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); diff --git a/src/static_src/scss/_gameboard.scss b/src/static_src/scss/_gameboard.scss index 167c20b..38d4ecd 100644 --- a/src/static_src/scss/_gameboard.scss +++ b/src/static_src/scss/_gameboard.scss @@ -78,7 +78,8 @@ body.page-gameboard { .token { position: static; } - .token:hover .token-tooltip { display: none; } + .token:hover .token-tooltip, + .token:hover .tt { display: none; } // JS portal handles show/hide .token, .kit-item { font-size: 1.5rem; } diff --git a/src/templates/apps/gameboard/_partials/_applet-game-kit.html b/src/templates/apps/gameboard/_partials/_applet-game-kit.html index 0830a25..23661b2 100644 --- a/src/templates/apps/gameboard/_partials/_applet-game-kit.html +++ b/src/templates/apps/gameboard/_partials/_applet-game-kit.html @@ -7,45 +7,39 @@ {% if pass_token %}
-
-
-

{{ pass_token.tooltip_name }}

-

{{ pass_token.tooltip_description }}

- {% if pass_token.tooltip_shoptalk %} - {{ pass_token.tooltip_shoptalk }} - {% endif %} -

{{ pass_token.tooltip_expiry }}

-
+
+

{{ pass_token.tooltip_name }}

+

{{ pass_token.tooltip_description }}

+ {% if pass_token.tooltip_shoptalk %} +

{{ pass_token.tooltip_shoptalk }}

+ {% endif %} +

{{ pass_token.tooltip_expiry }}

{% endif %} {% if carte %}
-
-
-

{{ carte.tooltip_name }}

-

{{ carte.tooltip_description }}

- {% if carte.tooltip_shoptalk %} - {{ carte.tooltip_shoptalk }} - {% endif %} -

{{ carte.tooltip_expiry }}

-
+
+

{{ carte.tooltip_name }}

+

{{ carte.tooltip_description }}

+ {% if carte.tooltip_shoptalk %} +

{{ carte.tooltip_shoptalk }}

+ {% endif %} +

{{ carte.tooltip_expiry }}

{% endif %} {% if coin %}
-
-
-

{{ coin.tooltip_name }}

-

{{ coin.tooltip_description }}

- {% if coin.tooltip_shoptalk %} - {{ coin.tooltip_shoptalk }} - {% endif %} -

{{ coin.tooltip_expiry }}

-
+
+

{{ coin.tooltip_name }}

+

{{ coin.tooltip_description }}

+ {% if coin.tooltip_shoptalk %} +

{{ coin.tooltip_shoptalk }}

+ {% endif %} +

{{ coin.tooltip_expiry }}

{% endif %} @@ -53,15 +47,13 @@ {% with free_tokens.0 as token %}
-
-
-

{{ token.tooltip_name }}{% if free_count > 1 %} (×{{ free_count }}){% endif %}

-

{{ token.tooltip_description }}

- {% if token.tooltip_shoptalk %} - {{ token.tooltip_shoptalk }} - {% endif %} -

{{ token.tooltip_expiry }}

-
+
+

{{ token.tooltip_name }}{% if free_count > 1 %} (×{{ free_count }}){% endif %}

+

{{ token.tooltip_description }}

+ {% if token.tooltip_shoptalk %} +

{{ token.tooltip_shoptalk }}

+ {% endif %} +

{{ token.tooltip_expiry }}

{% endwith %} @@ -69,11 +61,9 @@ {% for deck in deck_variants %}
-
-
-

{{ deck.name }}

-

{{ deck.card_count }} cards

-
+
+

{{ deck.name }}

+

{{ deck.card_count }} cards

{% empty %}