From 805360565b0445057b1b8c3eb4666c62d5afe99c Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Fri, 17 Apr 2020 17:06:43 -0400 Subject: [PATCH] Add more documentation to the preloader --- docs/assets/js/constants.js | 14 ++++++++++++++ docs/assets/js/preloader/preloader.js | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/docs/assets/js/constants.js b/docs/assets/js/constants.js index 5ed3701..a885b7e 100644 --- a/docs/assets/js/constants.js +++ b/docs/assets/js/constants.js @@ -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: { + + } + } } }; \ No newline at end of file diff --git a/docs/assets/js/preloader/preloader.js b/docs/assets/js/preloader/preloader.js index c1c9557..111b219 100644 --- a/docs/assets/js/preloader/preloader.js +++ b/docs/assets/js/preloader/preloader.js @@ -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; /**