.
This commit is contained in:
@@ -121,11 +121,11 @@
|
|||||||
const f = fi.files && fi.files[0];
|
const f = fi.files && fi.files[0];
|
||||||
if(f && f.name){
|
if(f && f.name){
|
||||||
const base = f.name.replace(/\.[^/.]+$/, '');
|
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();
|
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;
|
if(title) nameInput.value = title;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch(e){ /* ignore */ }
|
}
|
||||||
|
} catch(e){ /* ignore */ }
|
||||||
});
|
});
|
||||||
// Make sure clicking the visual label triggers the input if not already clickable
|
// Make sure clicking the visual label triggers the input if not already clickable
|
||||||
const outerLabel = fi.closest('.file').querySelector('.file-label');
|
const outerLabel = fi.closest('.file').querySelector('.file-label');
|
||||||
|
|||||||
@@ -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-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 .stat-fill{height:100%;background:linear-gradient(90deg,var(--accent),#ffdd57);}
|
||||||
.toptrump-card .fact-list{margin-top:0.5rem;padding-left:1rem}
|
.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>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="level">
|
<div class="level">
|
||||||
<div class="level-left">
|
<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>
|
<button class="button is-primary" hx-get="{% url 'cards:create' %}" hx-target="#modal-root" hx-swap="innerHTML">Add Dinosaur</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
@@ -17,11 +17,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if card_count is not None %}
|
{% if card_count is not None %}
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
<span class="tag is-light">{{ card_count }} card{% if card_count > 1 %}s{% endif %}</span>
|
<span class="tag is-light">{{ card_count }} card{% if card_count > 1 %}s{% endif %}</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div id="htmx-form"></div>
|
<div id="htmx-form"></div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user