SIG SELECT: non-major reversal display; face wrapper divs; middle arcana reversal seed — TDD

- sig-select.js: three-way reversal branch — major (qualifier + concept name),
  non-major w. reversal (suit qualifier word on own line + card title),
  non-major fallback (polarity qualifier only)
- template: .fan-card-face-upright + .fan-card-face-reversal wrapper divs for
  compact centred text groups; arcana label sits between them
- _card-deck.scss: wrapper divs display:flex; padding-top on reversal group
  equalises gap to MIDDLE ARCANA label on both sides; removes margin:auto overcorrect
- migration 0007: populates reversal qualifier word per suit on Earthman Middle
  Arcana court cards (Seething/Gloomy/Nervous/Vacant); clears The Schizo's
  incorrectly inherited Territoriality reversal

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-04-28 20:09:23 -04:00
parent 505744312b
commit 2757ae855f
6 changed files with 157 additions and 26 deletions

View File

@@ -0,0 +1,73 @@
"""Populate TarotCard.reversal for Earthman Middle Arcana court cards.
Each suit has a fixed reversal qualifier that replaces the polarity qualifier
(Elevated/Graven) when the card is spun to its reversed face:
Brands → Seething Grails → Gloomy Blades → Nervous Crowns → Vacant
Also clears the incorrectly inherited reversal on The Schizo (card 1), which
mistakenly carried 'Territoriality' from The Occultist (card 2).
"""
from django.db import migrations
SUIT_REVERSAL_QUALIFIER = {
"BRANDS": "Seething",
"GRAILS": "Gloomy",
"BLADES": "Nervous",
"CROWNS": "Vacant",
}
RANK_NAMES = {11: "Maid", 12: "Jack", 13: "Queen", 14: "King"}
def populate_reversals(apps, schema_editor):
TarotCard = apps.get_model("epic", "TarotCard")
DeckVariant = apps.get_model("epic", "DeckVariant")
try:
earthman = DeckVariant.objects.get(slug="earthman")
except DeckVariant.DoesNotExist:
return
# Middle Arcana court cards
for suit, qualifier in SUIT_REVERSAL_QUALIFIER.items():
TarotCard.objects.filter(
deck_variant=earthman,
arcana="MIDDLE",
suit=suit,
number__in=list(RANK_NAMES.keys()),
).update(reversal=qualifier)
# Clear The Schizo's incorrectly inherited reversal (belongs to The Occultist)
TarotCard.objects.filter(
deck_variant=earthman,
arcana="MAJOR",
number=1,
).update(reversal="")
def clear_reversals(apps, schema_editor):
TarotCard = apps.get_model("epic", "TarotCard")
DeckVariant = apps.get_model("epic", "DeckVariant")
try:
earthman = DeckVariant.objects.get(slug="earthman")
except DeckVariant.DoesNotExist:
return
TarotCard.objects.filter(
deck_variant=earthman, arcana="MIDDLE",
suit__in=list(SUIT_REVERSAL_QUALIFIER.keys()),
number__in=list(RANK_NAMES.keys()),
).update(reversal="")
TarotCard.objects.filter(deck_variant=earthman, arcana="MAJOR", number=1).update(
reversal="Territoriality"
)
class Migration(migrations.Migration):
dependencies = [
("epic", "0006_add_deck_variant_to_tableseat"),
]
operations = [
migrations.RunPython(populate_reversals, reverse_code=clear_reversals),
]

View File

@@ -132,9 +132,22 @@ var SigSelect = (function () {
stageCard.querySelector('.sig-qualifier-above').textContent = isMajor ? '' : qualifier;
stageCard.querySelector('.sig-qualifier-below').textContent = isMajor ? qualifier : '';
// Reversed face — same qualifier, polarity-resolved reversal title
stageCard.querySelector('.fan-card-reversal-qualifier').textContent = qualifier;
stageCard.querySelector('.fan-card-reversal-name').textContent = cardEl.dataset.reversal || '';
// Reversed face.
// - Major arcana: polarity qualifier + reversal concept name
// - Non-major w. reversal: suit qualifier word replaces polarity qualifier;
// card name (title) stays the same — two separate lines
// - Non-major w/o reversal: fall back to mirroring the polarity qualifier
var reversal = cardEl.dataset.reversal || '';
if (isMajor) {
stageCard.querySelector('.fan-card-reversal-qualifier').textContent = qualifier;
stageCard.querySelector('.fan-card-reversal-name').textContent = reversal;
} else if (reversal) {
stageCard.querySelector('.fan-card-reversal-qualifier').textContent = reversal;
stageCard.querySelector('.fan-card-reversal-name').textContent = title;
} else {
stageCard.querySelector('.fan-card-reversal-qualifier').textContent = qualifier;
stageCard.querySelector('.fan-card-reversal-name').textContent = '';
}
// Populate stat block keyword faces and reset to upright
statBlock.classList.remove('is-reversed');