-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
select: created a basic select page with temporary box art, direct to…
… the select page when press "track"
- Loading branch information
Showing
9 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
var pokedexes = [ | ||
{ | ||
label: "Generation 1", | ||
national: null, | ||
types: [ | ||
{label: "Pokemon Red/Blue/Yellow", store: "rby"}, | ||
] | ||
}, | ||
{ | ||
label: "Generation 2", | ||
national: null, | ||
types: [ | ||
{label: "Pokemon Gold/Silver/Crystal", store: "gsc"}, | ||
] | ||
}, | ||
{ | ||
label: "Generation 3", | ||
national: "gen3", | ||
types: [ | ||
{label: "Pokemon Ruby/Sapphire/Emerald", store: "rse"}, | ||
{label: "Pokemon FireRed/LeafGreen", store: "frlg"}, | ||
{label: "Pokemon Box: Ruby & Sapphire", store: "pbrs"}, | ||
] | ||
}, | ||
{ | ||
label: "Generation 4", | ||
national: "gen4", | ||
types: [ | ||
{label: "Pokemon Diamond/Pearl/Platinum", store: "dppt"}, | ||
{label: "Pokemon HeartGold/SoulSilver", store: "hgss"}, | ||
] | ||
}, | ||
{ | ||
label: "Generation 5", | ||
national: "gen5", | ||
types: [ | ||
{label: "Pokemon Black/White", store: "bw"}, | ||
{label: "Pokemon Black2/White2", store: "b2w2"}, | ||
] | ||
}, | ||
{ | ||
label: "Generation 6", | ||
national: "gen6", | ||
types: [ | ||
{label: "Pokemon X/Y", store: "xy"}, | ||
{label: "Pokemon Omega Ruby/Alpha Sapphire", store: "oras"}, | ||
] | ||
}, | ||
{ | ||
label: "Generation 7", | ||
national: null, | ||
types: [ | ||
{label: "Pokemon Sun/Moon", store: "sm"}, | ||
{label: "Pokemon Ultra Sun/Ultra Moon", store: "usum"}, | ||
{label: "Pokemon Bank", store: "pokebank"}, | ||
] | ||
}, | ||
] | ||
|
||
|
||
var readyPokedexes = [ // all of the pokedexes that are ready and should be shown to the user | ||
pokedexes[0], | ||
pokedexes[1], | ||
pokedexes[2], | ||
] | ||
|
||
const CreatePokedexElement = (data) => { | ||
var pokedex = document.createElement("div") | ||
var title = document.createElement("h2") | ||
title.innerText = data.label; | ||
title.style.margin = "1vw" | ||
|
||
var anchor = document.createElement("a") | ||
anchor.href = `../tracker/index.html?game=${data.store}` | ||
|
||
var image = document.createElement("img") | ||
image.src = `../assets/boxart/${data.store}.png` | ||
image.style.width = "10vw" | ||
|
||
anchor.append(image) | ||
|
||
pokedex.append(title) | ||
pokedex.append(anchor) | ||
|
||
return pokedex | ||
} | ||
|
||
const CreateGroupElement = (data) => { | ||
var group = document.createElement("div") | ||
|
||
var inside = document.createElement("div") | ||
inside.style.display = "flex" | ||
inside.style.margin = "auto" | ||
inside.classList = ["center"] | ||
|
||
var title = document.createElement("h1") | ||
title.innerText = data.label; | ||
|
||
group.append(title) | ||
group.append(inside); | ||
|
||
data.types.forEach((pokedex) => { | ||
inside.append(CreatePokedexElement(pokedex)); | ||
}) | ||
|
||
return group; | ||
} | ||
|
||
const workspace = document.getElementById("workspace") | ||
|
||
readyPokedexes.forEach((element) => { | ||
workspace.append(CreateGroupElement(element)) | ||
}) |