💫🛎 Checkpoint
./style.css:7435365/113 ./script.js:7435365/519 ./README.md:7435365/60
This commit is contained in:
parent
e78507a7cc
commit
416c3f6045
@ -1,3 +1,8 @@
|
||||
Is It Jason's Birthday?
|
||||
=======================
|
||||
|
||||
|
||||
|
||||
Welcome to Glitch
|
||||
=================
|
||||
|
||||
|
19
script.js
19
script.js
@ -2,11 +2,11 @@ var birthday = {
|
||||
now: null,
|
||||
day: 25,
|
||||
month: 6, // June
|
||||
match: false,
|
||||
faking: false,
|
||||
check: function() {
|
||||
if (this.faking) return;
|
||||
this.now = new Date();
|
||||
if (this.now.getDate() == this.day && this.now.getMonth() + 1 == this.month)
|
||||
this.activate();
|
||||
if (this.now.getDate() == this.day && this.now.getMonth() + 1 == this.month) this.activate();
|
||||
else this.deactivate();
|
||||
},
|
||||
activate: function() {
|
||||
@ -21,6 +21,14 @@ var birthday = {
|
||||
elementClass.add(document.getElementById("isit"), "nope");
|
||||
|
||||
confetti.clear();
|
||||
},
|
||||
fakeit: function() {
|
||||
this.faking = true;
|
||||
this.activate();
|
||||
setTimeout(function() {
|
||||
birthday.faking = false;
|
||||
birthday.deactivate();
|
||||
}, 5000)
|
||||
}
|
||||
};
|
||||
|
||||
@ -73,7 +81,10 @@ var elementClass = {
|
||||
window.onload = function() {
|
||||
birthday.check();
|
||||
|
||||
document.getElementById('pilink')
|
||||
document.getElementById('pilink').addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
birthday.fakeit();
|
||||
}, false)
|
||||
};
|
||||
|
||||
window.addEventListener(
|
||||
|
Loading…
Reference in New Issue
Block a user