Skip to content

Commit

Permalink
created infographic
Browse files Browse the repository at this point in the history
  • Loading branch information
yashrajbharti committed Jan 1, 2024
1 parent 991c1ab commit c20af73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/arlo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Arlo
:lapras: - :lucario: :conkeldurr: :machamp:
:cradily: - :mamoswine: :lucario: :metagross:

:scizor: - :hooh: :blaziken: :reshiram:
:scizor: - :ho-oh: :blaziken: :reshiram:
:snorlax: - :lucario: :conkeldurr: :machamp:
:gardevoir: - :metagross: :dialga: :roserade:
9 changes: 8 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ getRocketLeaderData("arlo");
const buildSlots = (data) => {
let slots = [];
const refinedData = data.split(/[\n\r\ ]/g);
const images = document.querySelectorAll(
`.${refinedData[0].toLowerCase()} img`
);
for (const datum of refinedData.slice(1)) {
if (datum === "" || datum === "-") continue;
slots.push(datum.replace(/[:]/g, "").replace("shiny", ""));
}
console.log(slots);
slots.map((slot, index) => {
images[
index
].src = `https://img.pokemondb.net/sprites/home/normal/${slot}.png`;
});
};

0 comments on commit c20af73

Please sign in to comment.