artifact images: add square/wide variants

use artifact-square for thumbnails, artifact-wide for grid display.
defaults to square for backwards compat.
This commit is contained in:
Justin Edmund 2025-12-03 17:44:01 -08:00
parent f23779b664
commit 190e2140b1

View file

@ -366,12 +366,19 @@ export function getElementIcon(element: number): string {
// ===== Artifact Images ===== // ===== Artifact Images =====
export type ArtifactImageVariant = 'square' | 'wide'
/** /**
* Get artifact image URL * Get artifact image URL
* @param variant - 'square' for thumbnails/icons, 'wide' for grid-sized display
*/ */
export function getArtifactImage(granblueId: string | number | null | undefined): string { export function getArtifactImage(
granblueId: string | number | null | undefined,
variant: ArtifactImageVariant = 'square'
): string {
if (!granblueId) return '/images/placeholders/placeholder-weapon-grid.png' if (!granblueId) return '/images/placeholders/placeholder-weapon-grid.png'
return `${getBasePath()}/artifacts/${granblueId}.png` const directory = `artifact-${variant}`
return `${getBasePath()}/${directory}/${granblueId}.jpg`
} }
// ===== Other Game Images ===== // ===== Other Game Images =====