rm old record key
This commit is contained in:
@@ -192,7 +192,7 @@ export function renderMigrationPage(
|
||||
.sort((a, b) => a.card - b.card)
|
||||
|
||||
const cardsHtml = sortedGroups.map(({ card, totalCp, rare, isUnique }) => {
|
||||
const rarityClass = isUnique ? 'unique' : rare >= 4 ? 'shiny' : rare >= 1 ? 'rare' : ''
|
||||
const rarityClass = isUnique ? 'unique' : rare >= 1 ? 'rare' : ''
|
||||
const effectsHtml = rarityClass ? `
|
||||
<div class="card-status pattern-${rarityClass}"></div>
|
||||
<div class="card-status color-${rarityClass}"></div>
|
||||
|
||||
@@ -17,8 +17,7 @@ export interface CardCollection {
|
||||
// Get rarity class name
|
||||
function getRarityClass(card: UserCard): string {
|
||||
if (card.unique) return 'unique'
|
||||
if (card.rare >= 4) return 'shiny' // first(5), second(4)
|
||||
if (card.rare >= 1) return 'rare' // third(3), fourth(2), fifth(1)
|
||||
if (card.rare >= 1) return 'rare'
|
||||
return ''
|
||||
}
|
||||
|
||||
@@ -89,8 +88,7 @@ export function renderCardPage(
|
||||
// Count by rarity
|
||||
const rarityCount = {
|
||||
normal: cards.filter(c => !c.unique && c.rare === 0).length,
|
||||
rare: cards.filter(c => !c.unique && c.rare >= 1 && c.rare < 4).length,
|
||||
shiny: cards.filter(c => !c.unique && c.rare >= 4).length,
|
||||
rare: cards.filter(c => !c.unique && c.rare >= 1).length,
|
||||
unique: cards.filter(c => c.unique).length,
|
||||
}
|
||||
|
||||
@@ -139,10 +137,6 @@ export function renderCardPage(
|
||||
<span class="stat-value">${rarityCount.unique}</span>
|
||||
<span class="stat-label">Unique</span>
|
||||
</div>
|
||||
<div class="stat rare-shiny">
|
||||
<span class="stat-value">${rarityCount.shiny}</span>
|
||||
<span class="stat-label">Shiny</span>
|
||||
</div>
|
||||
<div class="stat rare-rare">
|
||||
<span class="stat-value">${rarityCount.rare}</span>
|
||||
<span class="stat-label">Rare</span>
|
||||
|
||||
@@ -4,7 +4,6 @@ export interface RseItem {
|
||||
id: number
|
||||
cp: number
|
||||
mode: number
|
||||
shiny: boolean
|
||||
unique: boolean
|
||||
}
|
||||
|
||||
@@ -15,10 +14,9 @@ export interface RseCollection {
|
||||
updatedAt: string
|
||||
}
|
||||
|
||||
// Get rarity class from shiny/unique flags
|
||||
// Get rarity class from unique flag
|
||||
function getRarityClass(item: RseItem): string {
|
||||
if (item.unique) return 'unique'
|
||||
if (item.shiny) return 'shiny'
|
||||
return ''
|
||||
}
|
||||
|
||||
@@ -71,18 +69,15 @@ export function renderRsePage(
|
||||
const totalChars = characters.length
|
||||
const totalItems = items.length
|
||||
const uniqueChars = characters.filter(c => c.unique).length
|
||||
const shinyChars = characters.filter(c => c.shiny).length
|
||||
|
||||
// Sort by unique > shiny > id
|
||||
// Sort by unique > id
|
||||
const sortedChars = [...characters].sort((a, b) => {
|
||||
if (a.unique !== b.unique) return a.unique ? -1 : 1
|
||||
if (a.shiny !== b.shiny) return a.shiny ? -1 : 1
|
||||
return a.id - b.id
|
||||
})
|
||||
|
||||
const sortedItems = [...items].sort((a, b) => {
|
||||
if (a.unique !== b.unique) return a.unique ? -1 : 1
|
||||
if (a.shiny !== b.shiny) return a.shiny ? -1 : 1
|
||||
return a.id - b.id
|
||||
})
|
||||
|
||||
@@ -105,10 +100,6 @@ export function renderRsePage(
|
||||
<span class="stat-value">${uniqueChars}</span>
|
||||
<span class="stat-label">Unique</span>
|
||||
</div>
|
||||
<div class="stat rare-shiny">
|
||||
<span class="stat-value">${shinyChars}</span>
|
||||
<span class="stat-label">Shiny</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
|
||||
Reference in New Issue
Block a user