Spaces:
Running
Running
File size: 7,030 Bytes
1d0beb6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Deck Viewer</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
min-height: 100vh;
padding: 20px;
color: #fff;
}
h1 {
text-align: center;
margin-bottom: 10px;
font-size: 2rem;
background: linear-gradient(90deg, #ff6b9d, #c44dff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.stats {
text-align: center;
margin-bottom: 30px;
color: #aaa;
}
.deck-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 15px;
max-width: 1400px;
margin: 0 auto;
}
.card-item {
background: rgba(255, 255, 255, 0.05);
border-radius: 12px;
padding: 10px;
text-align: center;
transition: transform 0.2s, box-shadow 0.2s;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.card-item:hover {
transform: translateY(-5px);
box-shadow: 0 10px 30px rgba(196, 77, 255, 0.3);
}
.card-item img {
width: 100%;
border-radius: 8px;
margin-bottom: 8px;
}
.card-name {
font-size: 0.85rem;
color: #fff;
margin-bottom: 4px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-type {
font-size: 0.75rem;
padding: 2px 8px;
border-radius: 10px;
display: inline-block;
margin-bottom: 4px;
}
.card-type.member {
background: #4CAF50;
}
.card-type.live {
background: #2196F3;
}
.card-type.energy {
background: #FF9800;
}
.card-count {
font-size: 1.2rem;
font-weight: bold;
color: #ff6b9d;
}
.card-id {
font-size: 0.65rem;
color: #666;
margin-top: 4px;
}
.loading {
text-align: center;
font-size: 1.5rem;
color: #aaa;
padding: 50px;
}
</style>
</head>
<body>
<h1>Deck Viewer</h1>
<div class="stats" id="stats">Loading...</div>
<div class="deck-grid" id="deck-grid">
<div class="loading">Loading cards...</div>
</div>
<script>
// Deck data extracted from decktest.txt
const deckData = {
"PL!-bp3-026-L": 1,
"PL!-pb1-008-R": 4,
"PL!-pb1-015-R": 2,
"PL!-sd1-002-SD": 2,
"PL!HS-bp2-012-N": 4,
"PL!N-bp1-026-L": 3,
"PL!N-bp1-034-PE": 1,
"PL!N-bp1-035-PE": 1,
"PL!N-bp1-036-PE": 1,
"PL!N-bp1-037-PE": 1,
"PL!N-bp1-038-PE": 1,
"PL!N-bp3-004-R": 2,
"PL!N-bp3-016-N": 2,
"PL!N-bp3-022-N": 4,
"PL!N-bp3-027-L": 4,
"PL!N-bp3-031-L": 4,
"PL!N-bp3-037-PE": 1,
"PL!N-bp3-038-PE": 1,
"PL!N-bp3-039-PE": 1,
"PL!N-bp4-020-N": 4,
"PL!N-bp4-038-PE": 1,
"PL!N-bp4-039-PE": 1,
"PL!N-bp4-040-PE": 1,
"PL!N-bp4-041-PE": 1,
"PL!N-pb1-004-R": 1,
"PL!N-pb1-008-R": 2,
"PL!N-pb1-034-N": 4,
"PL!N-sd1-011-SD": 3,
"PL!S-pb1-004-R": 3,
"PL!SP-bp1-020-N": 4,
"PL!SP-bp2-009-R+": 4
};
async function loadCards() {
try {
const response = await fetch('data/cards.json');
const cardsDb = await response.json();
const grid = document.getElementById('deck-grid');
grid.innerHTML = '';
let totalCards = 0;
let memberCount = 0;
let liveCount = 0;
let energyCount = 0;
for (const [cardId, count] of Object.entries(deckData)) {
totalCards += count;
const card = cardsDb[cardId];
const item = document.createElement('div');
item.className = 'card-item';
if (card) {
const type = card.type || 'Unknown';
const typeClass = type.includes('メンバー') ? 'member' :
type.includes('ライブ') ? 'live' :
type.includes('エネルギー') ? 'energy' : '';
if (typeClass === 'member') memberCount += count;
else if (typeClass === 'live') liveCount += count;
else if (typeClass === 'energy') energyCount += count;
item.innerHTML = `
<img src="${card.img}" alt="${card.name}" loading="lazy">
<div class="card-name">${card.name}</div>
<span class="card-type ${typeClass}">${type}</span>
<div class="card-count">×${count}</div>
<div class="card-id">${cardId}</div>
`;
} else {
item.innerHTML = `
<div style="height:200px;background:#333;border-radius:8px;display:flex;align-items:center;justify-content:center;">?</div>
<div class="card-name">Unknown Card</div>
<div class="card-count">×${count}</div>
<div class="card-id">${cardId}</div>
`;
}
grid.appendChild(item);
}
document.getElementById('stats').textContent =
`Total: ${totalCards} cards | Members: ${memberCount} | Live: ${liveCount} | Energy: ${energyCount} | Unique: ${Object.keys(deckData).length}`;
} catch (error) {
document.getElementById('deck-grid').innerHTML =
`<div class="loading">Error loading cards: ${error.message}</div>`;
}
}
loadCards();
</script>
</body>
</html>
|