abtmtr-v4/views/branding/scripts/data_get_member.js

23 lines
788 B
JavaScript
Raw Normal View History

2023-11-26 07:37:29 +00:00
const characters = document.getElementById("characters");
2023-11-26 20:25:54 +00:00
const CURRENT_CHARACTER = "meowcatheorange/iszac";
2024-01-19 16:28:16 +00:00
fetch_ask(`https://beta.trollcall.xyz/api/troll/${CURRENT_CHARACTER}`)
2023-11-26 07:37:29 +00:00
.then((x) => x.json())
2023-11-26 20:25:54 +00:00
.then((char) => {
var name = char.name
.map((string) => {
string = string[0].toUpperCase() + string.slice(1);
return string;
})
.join(" ");
2023-11-26 07:37:29 +00:00
characters.querySelector(
".characterName"
2023-11-26 20:25:54 +00:00
).innerHTML = `<a href="https://beta.trollcall.xyz/troll/${CURRENT_CHARACTER}" target="_blank">${name}</a>`;
characters.querySelector(".characterImage").src = char.images[0];
characters.querySelector(".pronouns").innerHTML = char.pronouns
.map((pronoun) => pronoun[0])
2023-11-26 07:37:29 +00:00
.join("/");
characters.style.display = null;
});