Skip to content

Commit

Permalink
add chat color css generation
Browse files Browse the repository at this point in the history
  • Loading branch information
etinquis committed Aug 8, 2023
1 parent f9aaaa9 commit 68616d3
Show file tree
Hide file tree
Showing 5 changed files with 3,474 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .build/generate_chat_colors_css.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { mkdirSync, writeFileSync } from 'fs';
import fetch from 'node-fetch'

const main = async () => {
const chatColorResponse = await (await fetch("https://data.landsofhope.com/schemas/v1/chat/chat-color.json")).json();
const enumValues = chatColorResponse.enum;

let css = "";
for (var i = 0; i < enumValues.length; ++i) {
const color = enumValues[i];

css += `\r.chat-color-${color} { color: #${color}; } .bg-chat-color-${color} { background-color: #${color} }`;
}

mkdirSync('css/chat', { recursive: true });
writeFileSync('css/chat/chat-colors.css', css);
}

main();
Loading

0 comments on commit 68616d3

Please sign in to comment.