diff --git a/README.md b/README.md index 96036fb..557c738 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +Is It Jason's Birthday? +======================= + + + Welcome to Glitch ================= diff --git a/script.js b/script.js index d879fa2..ff335d3 100644 --- a/script.js +++ b/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( diff --git a/style.css b/style.css index 13edb62..e4fd495 100644 --- a/style.css +++ b/style.css @@ -37,14 +37,11 @@ body { right: 1vw; font-family: 'Times New Roman', serif; font-size: 1.2vw; -} - -#pilink a { text-decoration: none; color: #6e7f80; } -#pilink a:hover { +#pilink:hover { color: #FF0000; }