fan-card title symmetry; pips → Minor; tray Sig card
- title slot: <h3> → <p>; font-size 0.1 → 0.087 (deck) / 0.093 → 0.08 (sig/sea); text-wrap: balance — kills upright/reversal asymmetry & all per-card squeeze hacks - trump 8 hyphen → U+2011, trump 9 space → U+00A0 (mig 0021) so titles wrap as intended - pips (Earthman 1–10) → MINOR arcana (mig 0022); StageCard._arcanaDisplay() picks the right label - PICK SEA: re-clicking a deposited slot now restores the server-rolled reversed state (sea.js _populate toggle) - tray Sig card: render same .sig-stage-card.sea-sig-card (rank + icon, -5deg) as Sea center; --sig-card-w sized off --tray-cell-size - title_squeeze_class kept as no-op for template compat - 0020 (Self-Unimportance rename) included from prior turn Code architected by Disco DeDisco <discodedisco@outlook.com> Git commit message Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
41
src/apps/epic/migrations/0020_self_unimportance.py
Normal file
41
src/apps/epic/migrations/0020_self_unimportance.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""Trump 8 rename: Losing Self-Importance → Self-Unimportance.
|
||||
|
||||
The renamed form fits on one fan-card line above the Sublimating/Sedimentary
|
||||
qualifier without a scaleX squeeze.
|
||||
"""
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def forward(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="MAJOR", number=8,
|
||||
).update(name="Self-Unimportance", slug="self-unimportance")
|
||||
|
||||
|
||||
def reverse(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="MAJOR", number=8,
|
||||
).update(name="Losing Self-Importance", slug="losing-self-importance")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("epic", "0019_explicit_virtues_italic_word"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(forward, reverse_code=reverse),
|
||||
]
|
||||
61
src/apps/epic/migrations/0021_trump9_nbsp.py
Normal file
61
src/apps/epic/migrations/0021_trump9_nbsp.py
Normal file
@@ -0,0 +1,61 @@
|
||||
"""Long-title wrap fixes for trumps 8 and 9.
|
||||
|
||||
Trump 8 "Self-Unimportance" → swap the hyphen for U+2011 (non-breaking
|
||||
hyphen) so it stays glued and the title sits on one line above
|
||||
Sublimating / Sedimentary.
|
||||
|
||||
Trump 9 "Erasing Personal History" → insert U+00A0 (non-breaking space)
|
||||
between "Personal" and "History" so the browser keeps them together,
|
||||
forcing "Erasing" alone on line 1 and "Personal History," on line 2.
|
||||
"""
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
# Trump 8
|
||||
OLD_8 = "Self-Unimportance"
|
||||
NEW_8 = "Self‑Unimportance"
|
||||
|
||||
# Trump 9
|
||||
OLD_9 = "Erasing Personal History"
|
||||
NEW_9 = "Erasing Personal History"
|
||||
|
||||
|
||||
def forward(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="MAJOR", number=8,
|
||||
).update(name=NEW_8)
|
||||
TarotCard.objects.filter(
|
||||
deck_variant=earthman, arcana="MAJOR", number=9,
|
||||
).update(name=NEW_9)
|
||||
|
||||
|
||||
def reverse(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="MAJOR", number=8,
|
||||
).update(name=OLD_8)
|
||||
TarotCard.objects.filter(
|
||||
deck_variant=earthman, arcana="MAJOR", number=9,
|
||||
).update(name=OLD_9)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("epic", "0020_self_unimportance"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(forward, reverse_code=reverse),
|
||||
]
|
||||
42
src/apps/epic/migrations/0022_pips_to_minor_arcana.py
Normal file
42
src/apps/epic/migrations/0022_pips_to_minor_arcana.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""Reclassify Earthman pip cards (number 1-10) from MIDDLE to MINOR arcana.
|
||||
|
||||
The 0004 reseed initially lumped pips + court cards under MIDDLE; pips
|
||||
should be MINOR arcana, with MIDDLE reserved for the Earthman court
|
||||
cards (Maid/Jack/Queen/King at numbers 11-14).
|
||||
"""
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def forward(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", number__lte=10,
|
||||
).update(arcana="MINOR")
|
||||
|
||||
|
||||
def reverse(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="MINOR", number__lte=10,
|
||||
).update(arcana="MIDDLE")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("epic", "0021_trump9_nbsp"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(forward, reverse_code=reverse),
|
||||
]
|
||||
@@ -211,8 +211,8 @@ class DeckVariant(models.Model):
|
||||
|
||||
class TarotCard(models.Model):
|
||||
MAJOR = "MAJOR"
|
||||
MINOR = "MINOR"
|
||||
MIDDLE = "MIDDLE" # Earthman court cards (M/J/Q/K)
|
||||
MINOR = "MINOR" # pip cards (numbers 1-10)
|
||||
MIDDLE = "MIDDLE" # Earthman court cards (M/J/Q/K, numbers 11-14)
|
||||
ARCANA_CHOICES = [
|
||||
(MAJOR, "Major Arcana"),
|
||||
(MINOR, "Minor Arcana"),
|
||||
@@ -323,6 +323,14 @@ class TarotCard(models.Model):
|
||||
return self.name.split(': ', 1)[1]
|
||||
return self.name
|
||||
|
||||
@property
|
||||
def title_squeeze_class(self):
|
||||
"""No-op kept for template compatibility. Title fit is now handled by
|
||||
a smaller base `font-size` on `.fan-card-name`/`.fan-card-reversal-*`
|
||||
plus `text-wrap: balance` (see `_card-deck.scss`) — every long-title
|
||||
card fits naturally without per-card CSS hacks."""
|
||||
return ''
|
||||
|
||||
@property
|
||||
def suit_icon(self):
|
||||
if self.icon:
|
||||
|
||||
@@ -25,9 +25,12 @@ var SeaDeal = (function () {
|
||||
_infoData = StageCard.buildInfoData(card);
|
||||
_infoIdx = 0;
|
||||
|
||||
// Reset SPIN
|
||||
stageCard.classList.remove('stage-card--reversed');
|
||||
statBlock.classList.remove('is-reversed');
|
||||
// Sync SPIN state to the card's reversal axis — `card.reversed` is set
|
||||
// server-side at deck-fetch time (apps.epic.utils.stack_reversal_probability)
|
||||
// and persisted in `_seaHand`, so re-clicking a deposited slot must
|
||||
// restore that state, not reset to upright.
|
||||
stageCard.classList.toggle('stage-card--reversed', !!card.reversed);
|
||||
statBlock.classList.toggle('is-reversed', !!card.reversed);
|
||||
_closeInfo();
|
||||
}
|
||||
|
||||
@@ -105,13 +108,6 @@ var SeaDeal = (function () {
|
||||
_viewingPos = posSelector;
|
||||
_seaHand[posSelector] = { card: card, isLevity: isLevity };
|
||||
_populate(card, isLevity);
|
||||
// Server pre-rolled the reversal axis at deck-fetch time
|
||||
// (apps.epic.utils.stack_reversal_probability). Honor it here so the
|
||||
// card lands face-reversed if rolled.
|
||||
if (card.reversed) {
|
||||
statBlock.classList.add('is-reversed');
|
||||
stageCard.classList.add('stage-card--reversed');
|
||||
}
|
||||
_fillSlot(posSelector, card, isLevity);
|
||||
_showStage(isLevity);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,15 @@ var StageCard = (function () {
|
||||
return a === 'MAJOR' || a === 'MAJOR ARCANA';
|
||||
}
|
||||
|
||||
// Map either form (model code or display) to the rendered label.
|
||||
function _arcanaDisplay(card) {
|
||||
var a = (card.arcana || '').toUpperCase();
|
||||
if (a === 'MAJOR' || a === 'MAJOR ARCANA') return 'Major Arcana';
|
||||
if (a === 'MINOR' || a === 'MINOR ARCANA') return 'Minor Arcana';
|
||||
if (a === 'MIDDLE' || a === 'MIDDLE ARCANA') return 'Middle Arcana';
|
||||
return '';
|
||||
}
|
||||
|
||||
// Paint the stage-card's upright + reversal faces from a normalized card
|
||||
// object + the active polarity ('levity' | 'gravity'). Reversal-qualifier
|
||||
// falls back to the current polarity's qualifier when blank (6F behavior).
|
||||
@@ -117,7 +126,7 @@ var StageCard = (function () {
|
||||
if (nameGroupEl) nameGroupEl.textContent = emanationOverride ? '' : (card.name_group || '');
|
||||
|
||||
var arcanaEl = stageCard.querySelector('.fan-card-arcana');
|
||||
if (arcanaEl) arcanaEl.textContent = isMajor ? 'Major Arcana' : 'Middle Arcana';
|
||||
if (arcanaEl) arcanaEl.textContent = _arcanaDisplay(card);
|
||||
|
||||
var nameEl = stageCard.querySelector('.fan-card-name');
|
||||
var qAbove = stageCard.querySelector('.sig-qualifier-above');
|
||||
|
||||
@@ -33,14 +33,14 @@ function initGameKitTooltips() {
|
||||
if (portal.classList.contains('active') && activeToken) {
|
||||
const tokenRect = activeToken.getBoundingClientRect();
|
||||
const portalRect = portal.getBoundingClientRect();
|
||||
// Expand left to cover button overflow outside portal edge
|
||||
const expandedPortalRect = {
|
||||
left: portalRect.left - 24,
|
||||
top: portalRect.top,
|
||||
right: portalRect.right,
|
||||
bottom: portalRect.bottom,
|
||||
};
|
||||
const rects = [tokenRect, expandedPortalRect];
|
||||
const rects = [tokenRect, portalRect];
|
||||
// Include the DON/DOFF button group's actual bounding rect so the
|
||||
// portions of those buttons that hang past the portal's left edge
|
||||
// (and above its top edge) stay inside the hover-tolerance region.
|
||||
// Was previously a hardcoded 24px left expansion which didn't
|
||||
// cover top overhang and underestimated wider button labels.
|
||||
const equipBtns = portal.querySelector('.tt-equip-btns');
|
||||
if (equipBtns) rects.push(equipBtns.getBoundingClientRect());
|
||||
if (miniPortal.classList.contains('active')) rects.push(miniPortal.getBoundingClientRect());
|
||||
const left = Math.min(...rects.map(r => r.left));
|
||||
const top = Math.min(...rects.map(r => r.top));
|
||||
@@ -244,7 +244,19 @@ function initGameKitTooltips() {
|
||||
const tokenRect = token.getBoundingClientRect();
|
||||
const halfW = portal.offsetWidth / 2;
|
||||
const rawLeft = tokenRect.left + tokenRect.width / 2;
|
||||
const clampedLeft = Math.max(halfW + 8, Math.min(rawLeft, window.innerWidth - halfW - 8));
|
||||
// Extra left clearance — the DON/DOFF button group is absolute-
|
||||
// positioned with `left: -1rem` inside the portal and spills further
|
||||
// left by its own width. Measure the actual overhang so the clamp
|
||||
// keeps the buttons inside the viewport rather than just the portal.
|
||||
let leftOverhang = 0;
|
||||
const equipBtns = portal.querySelector('.tt-equip-btns');
|
||||
if (equipBtns) {
|
||||
const portalRect = portal.getBoundingClientRect();
|
||||
const btnsRect = equipBtns.getBoundingClientRect();
|
||||
leftOverhang = Math.max(0, portalRect.left - btnsRect.left);
|
||||
}
|
||||
const minLeft = halfW + 8 + leftOverhang;
|
||||
const clampedLeft = Math.max(minLeft, Math.min(rawLeft, window.innerWidth - halfW - 8));
|
||||
portal.style.left = Math.round(clampedLeft) + 'px';
|
||||
|
||||
// Show above when token is in lower viewport half; below when in upper half
|
||||
|
||||
Reference in New Issue
Block a user