2021-05-14 16:01:52 +00:00
const fs = require ( "fs" ) ;
2021-05-14 19:47:01 +00:00
const armcord = require ( "./armcord.js" ) ;
2021-05-14 20:54:40 +00:00
const themeFolder = _ _dirname + "/themes/" ;
2021-05-14 19:47:01 +00:00
window . addEventListener ( "DOMContentLoaded" , ( ) => {
fs . readdirSync ( themeFolder ) . forEach ( ( file ) => {
console . log ( file ) ;
try {
2021-05-14 20:54:40 +00:00
const manifest = fs . readFileSync ( ` ${ _ _dirname } /themes/ ${ file } /manifest.json ` , "utf8" ) ;
var themeFile = JSON . parse ( manifest ) ;
console . log ( themeFile . theme ) ;
console . log ( themeFile )
const theme = fs . readFileSync ( ` ${ _ _dirname } /themes/ ${ file } / ${ themeFile . theme } ` , "utf8" ) ;
2021-05-15 14:20:57 +00:00
if ( themeFile . theme . endsWith ( ".scss" ) ) {
console . log (
` %cCouldn't load ${ themeFile . name } made by ${ themeFile . author } . ArmCord doesn't suppot scss files if you want to have this theme ported feel free to reach out https://discord.gg/F25bc4RYDt ` ,
"color:red; font-weight: bold; font-size: 50px;color: red;"
) ;
}
2021-05-15 10:35:22 +00:00
armcord . addStyle ( theme ) ;
console . log ( ` %cLoaded ${ themeFile . name } made by ${ themeFile . author } ` , "color:red" ) ;
2021-05-14 19:47:01 +00:00
} catch ( err ) {
console . error ( err ) ;
}
} ) ;
2021-05-14 16:01:52 +00:00
} ) ;