This commit is contained in:
Ross
2025-12-06 19:22:42 +00:00
parent 1752d892f5
commit 502f875c4d
3 changed files with 20 additions and 10 deletions
+4 -4
View File
@@ -121,11 +121,11 @@
const f = fi.files && fi.files[0];
if(f && f.name){
const base = f.name.replace(/\.[^/.]+$/, '');
const title = base.replace(/[_-]+/g, ' ').split(/\s+/).map(function(w){ return w.length? (w.charAt(0).toUpperCase() + w.slice(1)) : ''; }).join(' ').trim();
if(title) nameInput.value = title;
}
const title = base.replace(/[_-]+/g, ' ').split(/\s+/).map(function(w){ return w.length? (w.charAt(0).toUpperCase() + w.slice(1)) : ''; }).join(' ').trim();
if(title) nameInput.value = title;
}
} catch(e){ /* ignore */ }
}
} catch(e){ /* ignore */ }
});
// Make sure clicking the visual label triggers the input if not already clickable
const outerLabel = fi.closest('.file').querySelector('.file-label');
+10
View File
@@ -78,6 +78,16 @@
.toptrump-card .stat-bar{flex:1;height:12px;background:rgba(255,255,255,0.06);border-radius:8px;overflow:hidden}
.toptrump-card .stat-fill{height:100%;background:linear-gradient(90deg,var(--accent),#ffdd57);}
.toptrump-card .fact-list{margin-top:0.5rem;padding-left:1rem}
/* Modal form styling for create/edit */
.modal.is-active .modal-background{background-color:rgba(10,10,10,0.6)}
.modal .modal-content > div{display:flex; justify-content:center}
.modal .card-form.card{max-width:820px; width:100%; padding:1.25rem; border-radius:10px; box-shadow:0 18px 50px rgba(2,6,23,0.35); border:1px solid rgba(0,0,0,0.08); background:var(--card-bg)}
.modal .card-form .field{margin-bottom:0.75rem}
.modal .card-form .label{font-weight:700}
.modal .card-form .file-label .file-cta{background:rgba(0,0,0,0.03); border-radius:6px}
.modal .card-form .buttons{justify-content:flex-end}
.modal .card-form .button.is-primary{min-width:110px}
.modal .card-form .background-picker .bg-option{width:56px;height:40px}
</style>
</head>
<body>
+6 -6
View File
@@ -3,7 +3,7 @@
{% block content %}
<div class="level">
<div class="level-left">
<div class="level-item">
<div class="level-item">
<button class="button is-primary" hx-get="{% url 'cards:create' %}" hx-target="#modal-root" hx-swap="innerHTML">Add Dinosaur</button>
</div>
<div class="level-item">
@@ -17,11 +17,11 @@
</div>
</div>
</div>
{% if card_count is not None %}
<div class="level-item">
<span class="tag is-light">{{ card_count }} card{% if card_count > 1 %}s{% endif %}</span>
</div>
{% endif %}
{% if card_count is not None %}
<div class="level-item">
<span class="tag is-light">{{ card_count }} card{% if card_count > 1 %}s{% endif %}</span>
</div>
{% endif %}
<div id="htmx-form"></div>