character card redesign

This commit is contained in:
Vassili Minaev 2026-05-06 22:07:51 -06:00
parent bd1e37ba34
commit 9f7162f567
2 changed files with 203 additions and 57 deletions

View file

@ -1,44 +1,48 @@
.image-stack {
position: relative;
width: 300px;
height: 360px;
body {
background-color: #1f002b;
}
.image-stack .layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
/* =====================
Grid
===================== */
.characters-grid {
display: flex;
flex-wrap: wrap;
gap: 32px;
padding: 24px;
}
.image-stack .bg {
z-index: 1;
.character-slot {
display: flex;
flex-direction: column;
align-items: center;
}
.image-stack .fg {
padding: 50px;
z-index: 2;
/* =====================
Deathclock
===================== */
.deathclock-title {
color: #e8c858;
text-align: center;
font-size: 1.75em;
font-weight: bold;
font-family: Georgia, "Times New Roman", serif;
text-transform: uppercase;
}
.image-stack .frame {
z-index: 3;
}
.deathclock-wrapper {
min-height: 150px;
margin: 0;
display: grid;
place-items: center;
width: 226px;
display: flex;
justify-content: center;
align-items: center;
padding: 0px 8px 8px;
font-family: "Courier New", monospace;
overflow: hidden;
}
.deathclock {
display: flex;
gap: 5px;
padding: 5px;
padding: 2px;
}
.digit {
@ -53,7 +57,7 @@
inset: 0;
border-radius: 10px;
background: linear-gradient(#1d1d1d, #050505);
color: #f2e7c9;
color: #e8c858;
font-size: 56px;
font-weight: bold;
line-height: 95px;
@ -82,7 +86,7 @@
height: 50%;
overflow: hidden;
background: linear-gradient(#202020, #080808);
color: #f2e7c9;
color: #e8c858;
font-size: 56px;
font-weight: bold;
text-align: center;
@ -114,21 +118,13 @@
}
@keyframes flipTop {
from {
transform: rotateX(0deg);
}
to {
transform: rotateX(-90deg);
}
from { transform: rotateX(0deg); }
to { transform: rotateX(-90deg); }
}
@keyframes flipBottom {
from {
transform: rotateX(90deg);
}
to {
transform: rotateX(0deg);
}
from { transform: rotateX(90deg); }
to { transform: rotateX(0deg); }
}
.shine {
@ -136,13 +132,160 @@
inset: 0;
border-radius: 10px;
pointer-events: none;
background:
linear-gradient(
background: linear-gradient(
115deg,
rgba(255,255,255,0.12),
transparent 35%,
transparent 70%,
rgba(255,255,255,0.05)
);
);
z-index: 10;
}
}
/* =====================
Trading Card
===================== */
.trading-card {
width: 226px;
background: linear-gradient(170deg, #3a0a4f 0%, #2c003e 50%, #320848 100%);
border: 2px solid #9a7a28;
border-top: none;
border-radius: 0 0 12px 12px;
box-shadow:
0 0 0 1px #4a1060,
0 16px 40px rgba(0, 0, 0, 0.8),
0 4px 12px rgba(184, 148, 58, 0.12);
overflow: hidden;
position: relative;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.trading-card:hover {
transform: translateY(-6px);
box-shadow:
0 0 0 1px #c8a84b,
0 22px 50px rgba(0, 0, 0, 0.9),
0 6px 20px rgba(200, 168, 75, 0.28);
}
/* Inner border inlay */
.trading-card::before {
content: '';
position: absolute;
inset: 5px;
border: 1px solid rgba(250, 204, 21, 0.18);
border-top: none;
border-radius: 0 0 8px 8px;
pointer-events: none;
z-index: 20;
}
/* Diagonal gloss sheen */
.trading-card::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(
135deg,
rgba(255, 255, 255, 0.055) 0%,
transparent 45%
);
pointer-events: none;
z-index: 15;
border-radius: inherit;
}
/* =====================
Card Name Band
===================== */
.card-name-band {
background: linear-gradient(to right,
#150020 0%, #2c003e 25%, #3a0a4f 50%, #2c003e 75%, #150020 100%
);
border-bottom: 2px solid #9a7a28;
padding: 9px 14px 8px;
text-align: center;
position: relative;
z-index: 5;
}
.card-name-band a {
color: #e8c858;
font-size: 0.88rem;
font-weight: bold;
text-decoration: none;
text-shadow:
0 0 14px rgba(232, 200, 64, 0.35),
0 1px 4px rgba(0, 0, 0, 0.95);
letter-spacing: 0.08em;
font-family: Georgia, "Times New Roman", serif;
text-transform: uppercase;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-name-band a:hover {
color: #ffe070;
text-shadow:
0 0 20px rgba(255, 220, 80, 0.55),
0 1px 4px rgba(0, 0, 0, 0.95);
text-decoration: none;
}
/* =====================
Image Stack
===================== */
.image-stack {
position: relative;
width: 100%;
height: 272px;
}
.image-stack .layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
}
.image-stack .bg {
z-index: 1;
}
.image-stack .fg {
top: 15%;
height: 72%;
padding: 0 12%;
z-index: 2;
}
.image-stack .frame {
z-index: 3;
}
/* =====================
Card Info Band
===================== */
.card-info-band {
background: linear-gradient(to right,
#150020 0%, #2c003e 25%, #3a0a4f 50%, #2c003e 75%, #150020 100%
);
border-top: 2px solid #9a7a28;
padding: 7px 14px 9px;
text-align: center;
color: #fcd34d;
font-size: 0.72rem;
font-style: italic;
letter-spacing: 0.1em;
position: relative;
z-index: 5;
font-family: Georgia, "Times New Roman", serif;
}

View file

@ -96,7 +96,7 @@ frappe.pages['characters'].on_page_load = function(wrapper) {
}
function render_cards(docs, wrapper) {
const container = $('<div class="row m-2"></div>');
const container = $('<div class="characters-grid"></div>');
function days_until(deathdate) {
const targetDate = new Date(deathdate.replace(' ', 'T'));
@ -111,18 +111,21 @@ function render_cards(docs, wrapper) {
docs.forEach(doc => {
const card = $(`
<div class="col-md-4 mb-3">
<div class="card p-3">
<div class="deathclock-wrapper">
<div class="deathclock" data-value="${days_until(doc.death)}"></div>
<div class="character-slot">
<div class="deathclock-title">Death Clock</div>
<div class="deathclock-wrapper">
<div class="deathclock" data-value="${days_until(doc.death)}"></div>
</div>
<div class="trading-card">
<div class="card-name-band">
<a href="/desk/character/${doc.name}">${doc.name}</a>
</div>
<h5><a href="/desk/character/${doc.name}">${doc.name}</a></h5>
<p>${doc.type}</p>
<div class="image-stack">
<img src="${doc.background_image}" class="layer bg">
<img src="${doc.profile_picture}" class="layer fg">
<img src="${doc.frame_image}" class="layer frame">
</div>
<div class="image-stack">
<img src="${doc.background_image}" class="layer bg">
<img src="${doc.profile_picture}" class="layer fg">
<img src="${doc.frame_image}" class="layer frame">
</div>
<div class="card-info-band">Species &bull; Class &bull; Level</div>
</div>
</div>
`);