mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 02:53:45 +00:00
feat(#22): Add shiny toggle
This commit is contained in:
@@ -20,14 +20,24 @@
|
|||||||
onDestroy(unsubscribe);
|
onDestroy(unsubscribe);
|
||||||
|
|
||||||
let showForms = true;
|
let showForms = true;
|
||||||
|
let showShiny = false;
|
||||||
let currentPlacement = 'boxPlacementForms';
|
let currentPlacement = 'boxPlacementForms';
|
||||||
let boxNumbers = [];
|
let boxNumbers = Array<any>;
|
||||||
|
|
||||||
async function toggleForms() {
|
async function toggleForms() {
|
||||||
showForms = !showForms;
|
showForms = !showForms;
|
||||||
await getData();
|
await getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function toggleShiny() {
|
||||||
|
showShiny = !showShiny;
|
||||||
|
if (showShiny) {
|
||||||
|
showForms = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
await getData();
|
||||||
|
}
|
||||||
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
combinedData = null;
|
combinedData = null;
|
||||||
|
|
||||||
@@ -66,6 +76,10 @@
|
|||||||
{showForms ? 'Hide Forms' : 'Show Forms'}
|
{showForms ? 'Hide Forms' : 'Show Forms'}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button class="btn" on:click={toggleShiny}>
|
||||||
|
{showShiny ? 'Hide Shiny' : 'Show Shiny'}
|
||||||
|
</button>
|
||||||
|
|
||||||
<div class="flex flex-wrap -mx-2">
|
<div class="flex flex-wrap -mx-2">
|
||||||
{#each boxNumbers as boxNumber}
|
{#each boxNumbers as boxNumber}
|
||||||
<div class="mb-8 md:w-1/2 px-2">
|
<div class="mb-8 md:w-1/2 px-2">
|
||||||
@@ -82,6 +96,7 @@
|
|||||||
pokemonName={pokedexEntry.pokemon}
|
pokemonName={pokedexEntry.pokemon}
|
||||||
pokedexNumber={pokedexEntry.pokedexNumber}
|
pokedexNumber={pokedexEntry.pokedexNumber}
|
||||||
form={pokedexEntry.form}
|
form={pokedexEntry.form}
|
||||||
|
shiny={showShiny}
|
||||||
/>
|
/>
|
||||||
<!-- {pokedexEntry.form ? `(${pokedexEntry.form})` : ''} -->
|
<!-- {pokedexEntry.form ? `(${pokedexEntry.form})` : ''} -->
|
||||||
<!-- <div class="font-bold">
|
<!-- <div class="font-bold">
|
||||||
|
|||||||
Reference in New Issue
Block a user