diff --git a/docs/assets/js/constants.js b/docs/assets/js/constants.js index a885b7e..a16c253 100644 --- a/docs/assets/js/constants.js +++ b/docs/assets/js/constants.js @@ -6,11 +6,15 @@ var constants = { // These are the variables that control injection/cssinjector.js // To add a new theme var, you must also add it to the injector theme: { + + // Theme variables specific to the webpage container webpage: { bg_color: "#242424", text_color: "#ffffff", canvas_border: "rgb(63, 63, 63)" }, + + // Theme variables specific to the game game: { } diff --git a/docs/assets/js/injection/cssinjector.js b/docs/assets/js/injection/cssinjector.js new file mode 100644 index 0000000..5483fa9 --- /dev/null +++ b/docs/assets/js/injection/cssinjector.js @@ -0,0 +1,18 @@ + + +/** + * Inject all KVPs from a dictionary into the document + * as CSS variables with a defined prefix + * + * @param {string} prefix + * @param {*} source_dict + */ +function injectMultiCSS(prefix, source_dict) { + +} + +/* Mappings from constants file to CSS */ +// If you are adding theme variables to constants.js, +// make sure to also define them here +injectMultiCSS("theme-webpage", constants.ui.theme.webpage); +injectMultiCSS("theme-game", constants.ui.theme.game); \ No newline at end of file diff --git a/docs/assets/js/preloader/preloader.js b/docs/assets/js/preloader/preloader.js index 111b219..b48ce4a 100644 --- a/docs/assets/js/preloader/preloader.js +++ b/docs/assets/js/preloader/preloader.js @@ -21,7 +21,7 @@ * animations in _sass/ui/page_loader.scss */ -let preloaderCount = 0; +let _preloaderCount = 0; /** * A fullscreen loading animation utility @@ -31,13 +31,13 @@ class Preloader { constructor() { // Add a preloader element to the page - document.body.innerHTML += `
`; - preloaderCount += 1; + document.body.innerHTML += ` `; + _preloaderCount += 1; // Get the element context for controlling - this.element = document.getElementById(`preloader${preloaderCount - 1}`); + this.element = document.getElementById(`preloader${_preloaderCount - 1}`); - console.log(`[Preloader] Created preloader ${preloaderCount - 1}`); + console.log(`[Preloader] Created preloader ${_preloaderCount - 1}`); }