From 416c3f6045eec172921f69348b22a52bd47e7977 Mon Sep 17 00:00:00 2001 From: "Glitch (hello-webpage)" Date: Sun, 6 Oct 2019 19:26:50 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=F0=9F=9B=8E=20Checkpoint=20./style?= =?UTF-8?q?.css:7435365/113=20./script.js:7435365/519=20./README.md:743536?= =?UTF-8?q?5/60?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++++ script.js | 19 +++++++++++++++---- style.css | 5 +---- 3 files changed, 21 insertions(+), 8 deletions(-) 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; }