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:
parent
f23779b664
commit
190e2140b1
1 changed files with 9 additions and 2 deletions
|
|
@ -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 =====
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue