Skip to content

Commit

Permalink
Merge pull request #297 from suhas-sensei/main
Browse files Browse the repository at this point in the history
display hero information properly #281
  • Loading branch information
Prajwal0225 authored Oct 30, 2023
2 parents 3dedd96 + 6be8fc9 commit 626d9ab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
21 changes: 14 additions & 7 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ document.addEventListener("DOMContentLoaded", () => {
dataInfo.textContent = "";

const data = [
{ text: "Aliases", value: response.name },
{ text: "Strength", value: response.powerstats.strength },
{ text: "Speed", value: response.powerstats.speed },
{ text: "Gender", value: response.appearance.gender },
{ text: "Place of Birth", value: response.biography["place-of-birth"] },
{ text: "Aliases : ", value: response.name },
{ text: "Strength : ", value: response.powerstats.strength },
{ text: "Speed : ", value: response.powerstats.speed },
{ text: "Gender : ", value: response.appearance.gender },
{ text: "Place of Birth : ", value: response.biography["place-of-birth"] },
{
text: "First Appearance",
text: "First Appearance : ",
value: response.biography["first-appearance"],
},
];
Expand All @@ -96,7 +96,14 @@ document.addEventListener("DOMContentLoaded", () => {
let p = document.createElement("p");

h2.textContent = value.text;
p.textContent = value.value || "-";
// p.textContent = value.text;
let resultSpan = document.createElement("span");
resultSpan.textContent = value.value || "-";
resultSpan.style.color = "white";
resultSpan.style.fontSize = "smaller";

h2.appendChild(resultSpan);


root.appendChild(h2);
root.appendChild(p);
Expand Down
10 changes: 7 additions & 3 deletions styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,18 @@ img {
}

h1,
h2,
/* h2, */
h3,
h4,
h5,
p {
h5{
text-align: center;
color: white;
}

h2, p{
text-align: justify;
}

a {
text-decoration: none;
}
Expand Down

0 comments on commit 626d9ab

Please sign in to comment.