Compare commits
3 Commits
7712cf1d56
...
d728900c24
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d728900c24 | ||
|
|
2dae861f30 | ||
|
|
98354fd27b |
@@ -4,7 +4,7 @@ All other Major Arcana already have fa-hand-dots from migration 0010.
|
||||
"""
|
||||
from django.db import migrations
|
||||
|
||||
ICONS = {0: 'fa-hat-cowboy', 1: 'fa-hat-wizard'}
|
||||
ICONS = {0: 'fa-hat-cowboy-side', 1: 'fa-hat-wizard'}
|
||||
|
||||
|
||||
def assign_icons(apps, schema_editor):
|
||||
|
||||
25
src/apps/epic/migrations/0013_fix_nomad_icon.py
Normal file
25
src/apps/epic/migrations/0013_fix_nomad_icon.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Fix The Nomad icon: fa-hat-cowboy → fa-hat-cowboy-side."""
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def fix_nomad_icon(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=0, icon="fa-hat-cowboy"
|
||||
).update(icon="fa-hat-cowboy-side")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("epic", "0012_delete_stray_pentacles"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(fix_nomad_icon, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
@@ -269,7 +269,10 @@ var SeaDeal = (function () {
|
||||
if (!pos || !_seaHand[pos]) return;
|
||||
|
||||
if (slot.classList.contains('sea-card-slot--focused')) {
|
||||
// Second tap/click — open modal
|
||||
// Second tap/click — dismiss selection glow, open modal
|
||||
overlay.querySelectorAll('.sea-card-slot--focused').forEach(function (s) {
|
||||
s.classList.remove('sea-card-slot--focused');
|
||||
});
|
||||
var h = _seaHand[pos];
|
||||
_viewingPos = pos;
|
||||
_populate(h.card, h.isLevity);
|
||||
|
||||
@@ -51,7 +51,7 @@ class TarotCardSuitIconTest(SimpleTestCase):
|
||||
"""TarotCard.suit_icon — icon class resolution."""
|
||||
|
||||
def test_major_with_icon_returns_icon(self):
|
||||
self.assertEqual(_card('MAJOR', 0, icon='fa-hat-cowboy').suit_icon, 'fa-hat-cowboy')
|
||||
self.assertEqual(_card('MAJOR', 0, icon='fa-hat-cowboy-side').suit_icon, 'fa-hat-cowboy-side')
|
||||
|
||||
def test_major_without_icon_returns_empty(self):
|
||||
self.assertEqual(_card('MAJOR', 5).suit_icon, '')
|
||||
|
||||
112
src/functional_tests/management/commands/setup_sea_session.py
Normal file
112
src/functional_tests/management/commands/setup_sea_session.py
Normal file
@@ -0,0 +1,112 @@
|
||||
"""
|
||||
Management command for manual single-gamer PICK SEA testing.
|
||||
|
||||
Creates a room at SKY_SELECT with one seated gamer whose sky is already
|
||||
confirmed, so the PICK SEA overlay is immediately visible on page load.
|
||||
|
||||
Usage:
|
||||
python src/manage.py setup_sea_session
|
||||
python src/manage.py setup_sea_session --base-url http://192.168.1.42:8000
|
||||
python src/manage.py setup_sea_session --room <uuid> # reuse existing room
|
||||
"""
|
||||
|
||||
from django.contrib.auth import BACKEND_SESSION_KEY, HASH_SESSION_KEY, SESSION_KEY
|
||||
from django.contrib.sessions.backends.db import SessionStore
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils import timezone
|
||||
|
||||
from apps.epic.models import Character, DeckVariant, GateSlot, Room, TableSeat, TarotCard
|
||||
from apps.lyric.models import User
|
||||
|
||||
|
||||
GAMER_EMAIL = "founder@test.io"
|
||||
|
||||
|
||||
def _make_session(user):
|
||||
session = SessionStore()
|
||||
session[SESSION_KEY] = str(user.pk)
|
||||
session[BACKEND_SESSION_KEY] = "apps.lyric.authentication.PasswordlessAuthenticationBackend"
|
||||
session[HASH_SESSION_KEY] = user.get_session_auth_hash()
|
||||
session.save()
|
||||
return session.session_key
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Set up a SKY_SELECT room with sky confirmed and print a PICK SEA URL"
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument("--base-url", default="http://localhost:8000")
|
||||
parser.add_argument("--room", default=None, help="UUID of an existing room to reuse")
|
||||
|
||||
def handle(self, *args, **options):
|
||||
base_url = options["base_url"].rstrip("/")
|
||||
earthman = DeckVariant.objects.get(slug="earthman")
|
||||
|
||||
# ── User ─────────────────────────────────────────────────────────────
|
||||
user, _ = User.objects.get_or_create(email=GAMER_EMAIL)
|
||||
user.is_staff = True
|
||||
user.is_superuser = True
|
||||
user.equipped_deck = None
|
||||
user.save()
|
||||
user.unlocked_decks.add(earthman)
|
||||
|
||||
# ── Room ─────────────────────────────────────────────────────────────
|
||||
if options["room"]:
|
||||
room = Room.objects.get(pk=options["room"])
|
||||
else:
|
||||
room = Room.objects.create(
|
||||
name="Sea Select Test Room",
|
||||
owner=user,
|
||||
visibility=Room.PUBLIC,
|
||||
)
|
||||
|
||||
# ── Gate slot ────────────────────────────────────────────────────────
|
||||
slot = room.gate_slots.get(slot_number=1)
|
||||
slot.gamer = user
|
||||
slot.status = GateSlot.FILLED
|
||||
slot.save()
|
||||
|
||||
room.gate_status = Room.OPEN
|
||||
room.table_status = Room.SKY_SELECT
|
||||
room.save()
|
||||
|
||||
# ── Significator ─────────────────────────────────────────────────────
|
||||
sig_card = TarotCard.objects.filter(
|
||||
deck_variant=earthman, arcana="MAJOR"
|
||||
).first()
|
||||
|
||||
# ── Table seat (PC = levity pole) ────────────────────────────────────
|
||||
seat, _ = TableSeat.objects.update_or_create(
|
||||
room=room, slot_number=1,
|
||||
defaults={
|
||||
"gamer": user,
|
||||
"role": "PC",
|
||||
"role_revealed": True,
|
||||
"deck_variant": earthman,
|
||||
"significator": sig_card,
|
||||
},
|
||||
)
|
||||
|
||||
# ── Confirmed Character (sky already done) ───────────────────────────
|
||||
char, created = Character.objects.get_or_create(
|
||||
seat=seat,
|
||||
retired_at__isnull=True,
|
||||
defaults={
|
||||
"significator": sig_card,
|
||||
"confirmed_at": timezone.now(),
|
||||
},
|
||||
)
|
||||
if not created and char.confirmed_at is None:
|
||||
char.confirmed_at = timezone.now()
|
||||
char.significator = sig_card
|
||||
char.save()
|
||||
|
||||
# ── URL ──────────────────────────────────────────────────────────────
|
||||
room_path = f"/gameboard/room/{room.pk}/"
|
||||
session_key = _make_session(user)
|
||||
url = f"{base_url}/lyric/dev-login/{session_key}/?next={room_path}"
|
||||
|
||||
self.stdout.write(f"\nRoom: {base_url}{room_path}")
|
||||
self.stdout.write(f"Gamer: {GAMER_EMAIL} (PC / levity / earthman)")
|
||||
self.stdout.write(f"Sig: {sig_card}")
|
||||
self.stdout.write(f"\nURL:\n {url}\n")
|
||||
@@ -835,28 +835,44 @@ $sea-card-h: 6.5rem;
|
||||
// Levity drawn card — secUser bg, priUser text + border (matches stage card polarity)
|
||||
.sea-card-slot--filled.sea-card-slot--levity {
|
||||
color: rgba(var(--priUser), 0.9);
|
||||
background: rgba(var(--secUser), 0.85);
|
||||
background: rgba(var(--secUser), 1);
|
||||
border-color: rgba(var(--priUser), 1);
|
||||
}
|
||||
// Gravity drawn card — priUser bg, secUser text + border
|
||||
.sea-card-slot--filled.sea-card-slot--gravity {
|
||||
color: rgba(var(--secUser), 0.9);
|
||||
background: rgba(var(--priUser), 0.85);
|
||||
background: rgba(var(--priUser), 1);
|
||||
border-color: rgba(var(--secUser), 0.6);
|
||||
}
|
||||
|
||||
// Deposited — fully opaque by default; Cover/Cross are semi-transparent
|
||||
.sea-card-slot--visible { opacity: 1; transition: opacity 1s ease; }
|
||||
.sea-card-slot--visible { opacity: 1; transition: opacity 1s ease, box-shadow 0.15s ease; }
|
||||
|
||||
.sea-pos-cover .sea-card-slot--visible { opacity: 0.3; }
|
||||
.sea-pos-cross .sea-card-slot--visible { opacity: 0.15; }
|
||||
@keyframes sea-cover-appear {
|
||||
0% { opacity: 0; }
|
||||
50% { opacity: 1; }
|
||||
100% { opacity: 0.3; }
|
||||
}
|
||||
|
||||
@keyframes sea-cross-appear {
|
||||
0% { opacity: 0; }
|
||||
50% { opacity: 1; }
|
||||
100% { opacity: 0.15; }
|
||||
}
|
||||
|
||||
.sea-pos-cover .sea-card-slot--visible { opacity: 0.3; animation: sea-cover-appear 2s ease; }
|
||||
.sea-pos-cross .sea-card-slot--visible { opacity: 0.15; animation: sea-cross-appear 2s ease; }
|
||||
|
||||
// Hover: reveal fully (snappy)
|
||||
.sea-pos-cover .sea-card-slot--visible:hover,
|
||||
.sea-pos-cross .sea-card-slot--visible:hover { opacity: 1; transition: opacity 0.15s ease; }
|
||||
|
||||
// Focused (first tap): persist at opacity 1 until clicked outside
|
||||
.sea-card-slot--focused { opacity: 1 !important; transition: opacity 0.15s ease; }
|
||||
// Focused (first tap): persist at opacity 1 + selection glow until modal opens
|
||||
.sea-card-slot--focused {
|
||||
opacity: 1 !important;
|
||||
transition: opacity 0.15s ease, box-shadow 0.15s ease;
|
||||
box-shadow: 0 0 0.5rem 0.25rem rgba(var(--ninUser), 0.35), 0 0 0.4rem rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
|
||||
// Cover + Cross — absolutely overlaid on the Sig card in .sea-pos-center
|
||||
.sea-pos-center { position: relative; }
|
||||
|
||||
Reference in New Issue
Block a user