Client/assets/js/easter-eggs.js
CakeLancelot 043bf219e7 Consistency pass and small tweaks
**Formatting going forward**
Variables: camelCase (capitalization of two letter abbreviations is OK, e.g. playerID)
Classes: PascalCase
CSS: kebab-case
Files: kebab-case

**Other miscellaneous changes**
* The WebPlayer crashing as well as failing to load the config file are now fatal  errors and will quit the app
* Moved some style attributes from index.html into openfusion.css
2023-09-03 05:12:30 -05:00

20 lines
573 B
JavaScript

// You're kind of ruining the surprise by reading this, but whatever
var today = new Date();
// Check Christmas season: Date constructor in Javascript uses an index
// so 11 is Dec. of this year, and 12 is Jan. of the next
var christmasBegin = new Date(today.getFullYear(), 11, 23);
var christmasEnd = new Date(today.getFullYear(), 12, 8);
var sf;
if (today >= christmasBegin && today <= christmasEnd) {
console.log("Christmas Activated.");
sf = new Snowflakes({ zIndex: -100 });
}
function stopEasterEggs() {
if (sf != null) {
sf.destroy();
}
}