more documentation

This commit is contained in:
Evan Pratten 2020-04-17 17:17:39 -04:00
parent 805360565b
commit d4dbed85e9
No known key found for this signature in database
GPG Key ID: 93AC7B3D071356D3
3 changed files with 27 additions and 5 deletions

View File

@ -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: {
}

View File

@ -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);

View File

@ -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 += `<div id="preloader${preloaderCount}" class="preloader hidden"><div class="spinner-border text-danger" role="status"></div></div>`;
preloaderCount += 1;
document.body.innerHTML += `<div id="preloader${_preloaderCount}" class="preloader hidden"><div class="spinner-border text-danger" role="status"></div></div>`;
_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}`);
}