Add fallback avatar and guild icons #41

Merged
twig merged 18 commits from fallback-server-icons into main 2025-07-16 02:51:53 +00:00
6 changed files with 7 additions and 6 deletions
Showing only changes of commit 63dbfa2a0d - Show all commits

View file

@ -23,5 +23,5 @@
--standard-radius: .5em;
--button-radius: .6em;
--pfp-radius: 100%;
--preferred-font: "Arial";
--preferred-font: Arial;
}

View file

@ -23,5 +23,5 @@
--standard-radius: .5em;
--button-radius: .6em;
--pfp-radius: 100%;
--preferred-font: "Arial";
--preferred-font: Arial;
}

View file

@ -24,7 +24,7 @@
--standard-radius: .5em;
--button-radius: .6em;
--pfp-radius: 100%;
--preferred-font: "Arial";
--preferred-font: Arial;
--optional-body-background: ; /* background element for the body */
--optional-chat-background: ; /* background element for the chat box */

View file

@ -23,5 +23,5 @@
--standard-radius: .5em;
--button-radius: .6em;
--pfp-radius: 100%;
--preferred-font: "Arial";
--preferred-font: Arial;
}

View file

@ -23,7 +23,7 @@
--standard-radius: .5em;
--button-radius: .6em;
--pfp-radius: 100%;
--preferred-font: "Arial";
--preferred-font: Arial;
/* --optional-body-background: background */
--optional-body-background: linear-gradient(45deg, #ed222480, #ed222480, #ed222480, #ed222480, #ed222480, #ed222480, #f35b2280, #f9962180, #f5c11e80, #f1eb1b80, #f1eb1b80, #f1eb1b80, #63c72080, #0c9b4980, #21878d80, #3954a580, #61379b80, #93288e80);

View file

@ -27,7 +27,8 @@ export default (name: string, seed: string): string => {
ctx.fillStyle = 'white'
ctx.textAlign = 'center'
ctx.textBaseline = 'middle'
const preferredFont = document.documentElement.style.getPropertyValue("--preferred-font")
const root = document.documentElement;
const preferredFont = getComputedStyle(root).getPropertyValue("--preferred-font");
ctx.font = `bold 96px ${preferredFont}, Arial, Helvetica, sans-serif`
// 136 isn't actually centered, but it *looks* centered
ctx.fillText(previewName, 128, 136)