diff --git a/views/index.html b/views/index.html index 0ebfab7..2a33195 100755 --- a/views/index.html +++ b/views/index.html @@ -57,12 +57,7 @@ >

- +
diff --git a/views/scripts/data_get_whoami.js b/views/scripts/data_get_whoami.js index 040541c..d62cdcc 100644 --- a/views/scripts/data_get_whoami.js +++ b/views/scripts/data_get_whoami.js @@ -3,6 +3,7 @@ const time = document.getElementById("time"); const weekday = document.getElementById("weekday"); const timezone = document.getElementById("timezone"); const nofetchy = document.getElementById("no-fetchy"); +const buttonflags = document.getElementById("buttonflags"); const fields = document.getElementById("fields"); fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange") .then((x) => x.json()) @@ -19,6 +20,19 @@ fetch("https://pronouns.cc/api/v1/users/MeowcaTheoRange") timezone.innerHTML = `(UTC${user.utc_offset > 0 ? "+" : "-"}${Math.abs( user.utc_offset / (60 * 60) )})`; + buttonflags.onclick = () => { + user.flags.forEach((flag) => { + const props = flag.description.split(";"); + initDocument( + props[0].split(","), + props[1], + props[2], + props[3], + flag.name + ); + }); + }; + buttonflags.disabled = false; function updateTime() { curTime.setTime( Date.now() - diff --git a/views/styles/normal.css b/views/styles/normal.css index 91de7cc..230eac9 100755 --- a/views/styles/normal.css +++ b/views/styles/normal.css @@ -228,6 +228,12 @@ input[type="submit"]:active, input[type="reset"]:active { opacity: 0.5; } +button:disabled, +input[type="button"]:disabled, +input[type="submit"]:disabled, +input[type="reset"]:disabled { + opacity: 0.5; +} /* -- Checkbox styling */