use aws cdn for picker images
This commit is contained in:
parent
505f209fae
commit
77949edd9d
3 changed files with 5 additions and 3 deletions
|
|
@ -73,5 +73,5 @@ export function getOppositeElement(element?: number): number | undefined {
|
||||||
export function getElementImage(element?: number): string {
|
export function getElementImage(element?: number): string {
|
||||||
if (element === undefined || element === null) return ''
|
if (element === undefined || element === null) return ''
|
||||||
const label = ELEMENT_LABELS[element]?.toLowerCase() ?? 'null'
|
const label = ELEMENT_LABELS[element]?.toLowerCase() ?? 'null'
|
||||||
return `/images/elements/${label}.png`
|
return `${getBasePath()}/elements/${label}.png`
|
||||||
}
|
}
|
||||||
|
|
@ -36,5 +36,5 @@ export function getProficiencyOptions() {
|
||||||
export function getProficiencyImage(proficiency: number): string {
|
export function getProficiencyImage(proficiency: number): string {
|
||||||
const label = PROFICIENCY_LABELS[proficiency]
|
const label = PROFICIENCY_LABELS[proficiency]
|
||||||
if (!label || label === 'None') return ''
|
if (!label || label === 'None') return ''
|
||||||
return `/images/proficiencies/${label.toLowerCase()}.png`
|
return `${getBasePath()}/proficiencies/${label.toLowerCase()}.png`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { getBasePath } from '$lib/utils/images'
|
||||||
|
|
||||||
export const RARITY_LABELS: Record<number, string> = {
|
export const RARITY_LABELS: Record<number, string> = {
|
||||||
1: 'R',
|
1: 'R',
|
||||||
2: 'SR',
|
2: 'SR',
|
||||||
|
|
@ -39,5 +41,5 @@ export function getRarityClass(rarity: number): string {
|
||||||
export function getRarityImage(rarity: number): string {
|
export function getRarityImage(rarity: number): string {
|
||||||
const label = RARITY_LABELS[rarity]
|
const label = RARITY_LABELS[rarity]
|
||||||
if (!label) return ''
|
if (!label) return ''
|
||||||
return `/images/rarity/${label.toLowerCase()}.png`
|
return `${getBasePath()}/rarity/${label.toLowerCase()}.png`
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue