Skip to content

Commit

Permalink
code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yashrajbharti committed Dec 30, 2023
1 parent 725258e commit 77819fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ const buildData = (data) => {
// CHARACTER
console.log(datum.character.name);
let type = datum.character.name.split("_")[1].toLowerCase();

let grunt =
datum.character.name.split("_")[3]?.toLowerCase() ??
datum.character.name.split("_")[2]?.toLowerCase();

typeIcon[i].src = `./icons/${type}.svg`;
typeIcon[i].classList.add(type);
if (type === "grunt") {
typeIcon[i].src = `./icons/ace.png`;
typeIcon[i].classList.add("ace");
}

grunts[i].src = `./icons/grunts/${grunt}.png`;
grunts[i].classList.add(grunt);
Expand Down
6 changes: 6 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
box-shadow: 0 0 20px #92BC2C;
}

.ace {
background: #000;
box-shadow: 0 0 20px #000;
}


.dark {
background: #595761;
box-shadow: 0 0 20px #595761;
Expand Down

0 comments on commit 77819fa

Please sign in to comment.