more documentation
This commit is contained in:
parent
805360565b
commit
d4dbed85e9
@ -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: {
|
||||
|
||||
}
|
||||
|
18
docs/assets/js/injection/cssinjector.js
Normal file
18
docs/assets/js/injection/cssinjector.js
Normal 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);
|
@ -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}`);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user