Add more documentation to the preloader

This commit is contained in:
Evan Pratten 2020-04-17 17:06:43 -04:00
parent a55e96a819
commit 805360565b
No known key found for this signature in database
GPG Key ID: 93AC7B3D071356D3
2 changed files with 37 additions and 0 deletions

View File

@ -1,5 +1,19 @@
var constants = {
testOrganizer: {
EXAMPLE_DELETE_ME_LATER : 1277336
},
ui: {
// These are the variables that control injection/cssinjector.js
// To add a new theme var, you must also add it to the injector
theme: {
webpage: {
bg_color: "#242424",
text_color: "#ffffff",
canvas_border: "rgb(63, 63, 63)"
},
game: {
}
}
}
};

View File

@ -1,3 +1,26 @@
/**
* This file contains the code that powers the full-screen loading animation.
* Multiple animations can be created in the same webpage, and toggled individually.
*
* --- Usage ---
* let myPreloader = new Preloader();
*
* // Show the loader
* myPreloader.show(true);
*
* // load some stuff
* // ...
*
* // Fade out the animation
* myPreloader.hide(false);
*
* --- How it works ---
* On creation, the Preloader injects some HTML into the webpage with a unique ID
* for the instance. Hiding and showing works by modifying the active classes for
* the loader. The "appear" and "disappear" classes will render their respective
* animations in _sass/ui/page_loader.scss
*/
let preloaderCount = 0;
/**