2020-12-18 04:13:54 +00:00
|
|
|
// 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
|
2022-06-28 22:57:30 +00:00
|
|
|
var christmasBegin = new Date(today.getFullYear(), 11, 23);
|
2020-12-18 04:13:54 +00:00
|
|
|
var christmasEnd = new Date(today.getFullYear(), 12, 8);
|
2022-06-28 22:57:30 +00:00
|
|
|
var sf;
|
2020-12-18 04:13:54 +00:00
|
|
|
|
2022-07-26 14:48:33 +00:00
|
|
|
if (today >= christmasBegin && today <= christmasEnd) {
|
|
|
|
console.log("Christmas Activated.");
|
|
|
|
sf = new Snowflakes({ zIndex: -100 });
|
2020-12-18 04:13:54 +00:00
|
|
|
}
|
2020-12-22 02:18:01 +00:00
|
|
|
|
2022-07-26 14:48:33 +00:00
|
|
|
function stopEasterEggs() {
|
|
|
|
if (sf != null) {
|
|
|
|
sf.destroy();
|
|
|
|
}
|
2022-06-28 22:57:30 +00:00
|
|
|
}
|