A.5-polish FLIP-to-back for non-polarized image-equipped decks — TDD. User-spec'd feature 2026-05-25 PM after browser-verifying A.5: the FLIP button on my_sign.html cycles polarity for polarized decks (Earthman) — gravity/levity swap w. a 3D-spin animation, stat block updates to the new polarity's emanation/reversal qualifiers. For non-polarized decks (Minchiate today, future RWS-with-images, future classic-playing decks), polarity has no meaning — clicking FLIP just runs an animation that doesn't change anything content-wise. User wants FLIP repurposed for non-polarized decks: reveal the card-back image while leaving the stat block untouched, so the gesture has visible payoff w/o forcing a meaningless polarity-state change. Implementation thread: server-side page wrapper carries a new data-deck-polarized="{{ user.equipped_deck.is_polarized|yesno:'true,false' }}" attr so the in-page JS can branch on it without making an API call or guessing from card data; stage-card scaffold conditionally renders a hidden <img.sig-stage-card-back-img> element when equipped_deck.has_card_images AND NOT is_polarized (image-equipped polarized decks would still cycle polarity per existing flow — back-image element absent for them, no resource waste). JS branch in flipBtn.click: if (pageEl.dataset.deckPolarized === 'false') { stageCard.classList.toggle('is-flipped-to-back') } else { _flipPolarityAnimated() } — same .is-reversed class toggle on the btn itself so visual feedback is consistent across both modes (btn rotates to signal "flipped state on"). SCSS: .sig-stage-card-back-img joins the existing .sig-stage-card-img filter chain (same contour stroke + silhouette black shadow — back image gets identical visual treatment to the front so the flip reads as same-deck consistency); default display: none; .sig-stage-card.is-flipped-to-back flips visibility — hides front, shows back. Stat block + arcana-key stroke color stay put per user spec — FLIP for non-polarized is purely a visual reveal, no polarity-cycle or content swap. 3 new ITs in MySignViewTest: data-deck-polarized="true" for default Earthman; data-deck-polarized="false" + back-img element present w. correct v2-convention back asset URL when user switches to Minchiate; polarized deck omits the back-img element. No JS unit test (Jasmine spec) for the flipBtn branch — visual verify covers the hover/click interaction; the IT covers the server-side conditional render that determines whether the branch can fire. No FT (the existing my_sign FTs cover the polarized-flip flow already; non-polarized-flip is a CSS class toggle, low-risk for regression). Tests: 3 new green; 9/9 MySignViewTest class green; 1303/1303 IT+UT total green (71s; +3 from 82813e9's 1300). Out of scope: my_sea's central sig card doesn't have a FLIP btn (no analogous behavior to add there); room.html FLIP behavior will be covered in A.8 if applicable; Sea Stage modal FLIP behavior (if any) lands in the my-sea fetch-endpoint extension later in A.5

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-25 01:31:42 -04:00
parent 82813e9fc1
commit 1963ad4c71
3 changed files with 82 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
data-save-url="{% url 'billboard:save_sign' %}"
{% if current_significator %}data-current-card-id="{{ current_significator.id }}"{% endif %}
data-current-reversed="{{ current_significator_reversed|yesno:'true,false' }}"
data-deck-polarized="{{ request.user.equipped_deck.is_polarized|yesno:'true,false' }}"
data-polarity="{% if current_significator_reversed %}levity{% else %}gravity{% endif %}">
{# Stage frame — always reserved at the top of the page; SAVE SIGN + #}
@@ -35,6 +36,16 @@
{# DeckVariant.has_card_images). Hidden by default; CSS shows it #}
{# when .sig-stage-card carries .sig-stage-card--image. #}
<img class="sig-stage-card-img" alt="" style="display:none">
{# Sprint A.5 — for non-polarized image-equipped decks (Minchiate, #}
{# future RWS-with-images), the FLIP btn flips the card to its #}
{# back instead of cycling polarity (which has no meaning for #}
{# non-polarized decks). Pre-rendered back-image element; CSS #}
{# toggles visibility via `.sig-stage-card.is-flipped-to-back`. #}
{% if request.user.equipped_deck.has_card_images and not request.user.equipped_deck.is_polarized %}
<img class="sig-stage-card-back-img" alt=""
src="{{ request.user.equipped_deck.back_image_url }}"
style="display:none">
{% endif %}
<div class="fan-card-corner fan-card-corner--tl">
<span class="fan-corner-rank"></span>
<i class="fa-solid stage-suit-icon" style="display:none"></i>
@@ -351,7 +362,20 @@
if (flipBtn) {
flipBtn.addEventListener('click', function () {
if (!_currentCard) return;
_flipPolarityAnimated();
// Sprint A.5 — non-polarized decks (Minchiate, RWS): FLIP
// shows the deck card-back instead of cycling polarity (no
// gravity/levity to toggle on these decks). Stat block stays
// unchanged — user spec 2026-05-25 PM. Polarized decks
// (Earthman) keep the existing polarity-flip animation.
if (pageEl.dataset.deckPolarized === 'false') {
stageCard.classList.toggle('is-flipped-to-back');
if (flipBtn) flipBtn.classList.toggle(
'is-reversed',
stageCard.classList.contains('is-flipped-to-back')
);
} else {
_flipPolarityAnimated();
}
});
}
if (spinBtn) {