forked from Mirrors/OpenAsar
[ThemeSync] Initial Add
parent
6220210ef5
commit
c912709688
@ -0,0 +1,14 @@
|
||||
const update = async () => {
|
||||
const getVar = (name, el = document.body) => el && (getComputedStyle(el).getPropertyValue(name) || getVar(name, el.parentElement)).trim();
|
||||
const vars = [ '--background-primary', '--background-secondary', '--brand-experiment', '--header-primary', '--text-muted' ];
|
||||
|
||||
let cached = await DiscordNative.userDataCache.getCached() || {};
|
||||
|
||||
const value = `.theme-dark {${vars.reduce((acc, x) => acc += `${x}: ${getVar(x)}; `, '')}}`;
|
||||
|
||||
cached['openasarSplashCSS'] = value;
|
||||
|
||||
DiscordNative.userDataCache.cacheUserData(JSON.stringify(cached));
|
||||
};
|
||||
|
||||
setInterval(update, 5000);
|
Loading…
Reference in new issue