sure why not

This commit is contained in:
MeowcaTheoRange 2023-12-29 01:18:20 -06:00
parent 68c8c274a3
commit b7a98508b2
3 changed files with 35 additions and 7 deletions

View file

@ -48,8 +48,10 @@
></small ></small
> >
</p> </p>
<button id="buttonflags" disabled>Cool Flags</button>
</section> </section>
<section id="status"></section>
<section id="about"></section>
<button id="buttonflags" disabled>Cool Flags</button>
<section id="fields"></section> <section id="fields"></section>
</main> </main>
<div id="WindowHolder"></div> <div id="WindowHolder"></div>

View file

@ -3,8 +3,13 @@ const time = document.getElementById("time");
const weekday = document.getElementById("weekday"); const weekday = document.getElementById("weekday");
const timezone = document.getElementById("timezone"); const timezone = document.getElementById("timezone");
const nofetchy = document.getElementById("no-fetchy"); const nofetchy = document.getElementById("no-fetchy");
const about = document.getElementById("about");
const statusus = document.getElementById("status");
const buttonflags = document.getElementById("buttonflags"); const buttonflags = document.getElementById("buttonflags");
const fields = document.getElementById("fields"); const fields = document.getElementById("fields");
const URL_REGEXP =
/(([a-z0-9.-]*)(((:\/\/)([a-z0-9.-]*))((\/)([\w;,\/?:@&=+$\-_.!~*'()#]*))?)|(((mailto|tel):)([\w;,\/?:@&=+$\-_.!~*'()#]*)))/g;
fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange") fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange")
.then((x) => x.json()) .then((x) => x.json())
.then((user) => { .then((user) => {
@ -13,9 +18,13 @@ fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange")
user.names[0].value user.names[0].value
}</b></a>, also better known online as <b>${ }</b></a>, also better known online as <b>${
user.name user.name
}</b>. <small>(${user.pronouns.filter((pronoun) => pronoun.status == "okay") }</b>. <small>(${user.pronouns
.filter((pronoun) => pronoun.status == "okay")
.map((pronoun) => pronoun.pronouns.split("/")[0]) .map((pronoun) => pronoun.pronouns.split("/")[0])
.join("/")})</small></p>`; .join("/")})</small></p>`;
about.innerHTML = `<h2>Bio</h2><p>MeowcaTheoRange<br />${user.bio
.replace(URL_REGEXP, (m) => `<a href="${m}" target="_blank">${m}</a>`)
.replaceAll("\n", "<br />")}</p>`;
const curTime = new Date(); const curTime = new Date();
timezone.innerHTML = `(UTC${user.utc_offset > 0 ? "+" : "-"}${Math.abs( timezone.innerHTML = `(UTC${user.utc_offset > 0 ? "+" : "-"}${Math.abs(
user.utc_offset / (60 * 60) user.utc_offset / (60 * 60)
@ -34,11 +43,14 @@ fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange")
}; };
buttonflags.disabled = false; buttonflags.disabled = false;
function updateTime() { function updateTime() {
curTime.setTime( curTime.setTime(Date.now());
Date.now() time.innerHTML = curTime.toLocaleTimeString("en-us", {
); timeZone: "America/Chicago",
time.innerHTML = curTime.toLocaleTimeString("en-us", { timeZone: "America/Chicago" }); });
weekday.innerHTML = curTime.toLocaleString("en-us", { weekday: "long", timeZone: "America/Chicago" }); weekday.innerHTML = curTime.toLocaleString("en-us", {
weekday: "long",
timeZone: "America/Chicago",
});
window.requestAnimationFrame(updateTime); window.requestAnimationFrame(updateTime);
} }
@ -56,3 +68,10 @@ fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange")
) )
.join(""); .join("");
}); });
fetch("https://local.abtmtr.link/api/v1/accounts/stat/statuses")
.then((x) => x.json())
.then((statuses) => {
console.log(statuses);
statusus.innerHTML = `<h2><a href="${statuses[0].url}" target="_blank">Current status</a></h2>${statuses[0].content}<p></p>`;
});

View file

@ -286,6 +286,13 @@ blockquote {
margin-block: 0.5em; margin-block: 0.5em;
} }
/* Pseudo normalize */
::selection {
color: var(--background-color);
background-color: var(--color);
}
/* Form normalize */ /* Form normalize */
html { html {