mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 19:13:43 +00:00
build(#46): Use .env var for image base path
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import pokeApiPokemon from '$lib/helpers/pokeapi-pokemon.json';
|
import pokeApiPokemon from '$lib/helpers/pokeapi-pokemon.json';
|
||||||
|
import { PUBLIC_USE_LOCAL_POKEMON_SPRITE_FOLDER } from '$env/static/public';
|
||||||
|
|
||||||
export let pokemonName: string;
|
export let pokemonName: string;
|
||||||
export let pokedexNumber: string | number;
|
export let pokedexNumber: string | number;
|
||||||
@@ -12,8 +13,9 @@
|
|||||||
|
|
||||||
function setImagePath() {
|
function setImagePath() {
|
||||||
let rootFolder =
|
let rootFolder =
|
||||||
'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/home';
|
PUBLIC_USE_LOCAL_POKEMON_SPRITE_FOLDER === 'true'
|
||||||
// let rootFolder = 'sprites/home';
|
? '/sprites/home'
|
||||||
|
: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/home';
|
||||||
|
|
||||||
if (form === 'Female') {
|
if (form === 'Female') {
|
||||||
rootFolder += '/female';
|
rootFolder += '/female';
|
||||||
@@ -57,9 +59,9 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strippedPokedexNumber == '869') {
|
// if (strippedPokedexNumber == '869') {
|
||||||
console.log(sanitisedPokemonName, sanitisedForm);
|
// console.log(sanitisedPokemonName, sanitisedForm);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// If the form is contained in the identifier, use that
|
// If the form is contained in the identifier, use that
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in New Issue
Block a user