2023-07-17 14:37:39 +00:00
|
|
|
#include utils.js
|
|
|
|
|
2022-09-13 13:14:49 +00:00
|
|
|
Misuzu.Events.Christmas2019 = function() {
|
|
|
|
this.propName = propName = 'msz-christmas-' + (new Date).getFullYear().toString();
|
|
|
|
};
|
|
|
|
Misuzu.Events.Christmas2019.prototype.changeColour = function() {
|
|
|
|
var count = parseInt(localStorage.getItem(this.propName));
|
|
|
|
document.body.style.setProperty('--header-accent-colour', (count++ % 2) ? 'green' : 'red');
|
|
|
|
localStorage.setItem(this.propName, count.toString());
|
|
|
|
};
|
|
|
|
Misuzu.Events.Christmas2019.prototype.isActive = function() {
|
|
|
|
var d = new Date;
|
|
|
|
return d.getMonth() === 11 && d.getDate() > 5 && d.getDate() < 27;
|
|
|
|
};
|
|
|
|
Misuzu.Events.Christmas2019.prototype.dispatch = function() {
|
2023-01-02 20:07:55 +00:00
|
|
|
var headerBg = $q('.header__background'),
|
|
|
|
menuBgs = $qa('.header__desktop__submenu__background');
|
2022-09-13 13:14:49 +00:00
|
|
|
|
|
|
|
if(!localStorage.getItem(this.propName))
|
|
|
|
localStorage.setItem(this.propName, '0');
|
|
|
|
|
|
|
|
if(headerBg)
|
|
|
|
headerBg.style.transition = 'background-color .4s';
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
if(headerBg)
|
|
|
|
headerBg.style.transition = 'background-color 1s';
|
|
|
|
|
|
|
|
for(var i = 0; i < menuBgs.length; i++)
|
|
|
|
menuBgs[i].style.transition = 'background-color 1s';
|
|
|
|
}, 1000);
|
|
|
|
|
|
|
|
this.changeColour();
|
|
|
|
setInterval(this.changeColour, 10000);
|
|
|
|
};
|