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
|
// These are the variables that control injection/cssinjector.js
|
||||||
// To add a new theme var, you must also add it to the injector
|
// To add a new theme var, you must also add it to the injector
|
||||||
theme: {
|
theme: {
|
||||||
|
|
||||||
|
// Theme variables specific to the webpage container
|
||||||
webpage: {
|
webpage: {
|
||||||
bg_color: "#242424",
|
bg_color: "#242424",
|
||||||
text_color: "#ffffff",
|
text_color: "#ffffff",
|
||||||
canvas_border: "rgb(63, 63, 63)"
|
canvas_border: "rgb(63, 63, 63)"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Theme variables specific to the game
|
||||||
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
|
* animations in _sass/ui/page_loader.scss
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let preloaderCount = 0;
|
let _preloaderCount = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A fullscreen loading animation utility
|
* A fullscreen loading animation utility
|
||||||
@ -31,13 +31,13 @@ class Preloader {
|
|||||||
constructor() {
|
constructor() {
|
||||||
|
|
||||||
// Add a preloader element to the page
|
// 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>`;
|
document.body.innerHTML += `<div id="preloader${_preloaderCount}" class="preloader hidden"><div class="spinner-border text-danger" role="status"></div></div>`;
|
||||||
preloaderCount += 1;
|
_preloaderCount += 1;
|
||||||
|
|
||||||
// Get the element context for controlling
|
// 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