From daf9784bf26ef3f6c1b7c677c3532dff9bfe8052 Mon Sep 17 00:00:00 2001
From: Kushagra Gour
Date: Tue, 20 Aug 2024 14:14:54 +0530
Subject: [PATCH] update js13kgame countdown
---
src/components/Footer.jsx | 10 +++++++---
src/components/Js13KModal.jsx | 5 +++--
src/style.css | 1 +
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx
index 3a8a633..87ea5c9 100644
--- a/src/components/Footer.jsx
+++ b/src/components/Footer.jsx
@@ -10,10 +10,14 @@ const JS13K = props => {
const [daysLeft, setDaysLeft] = useState(0);
useEffect(() => {
- const compoDate = new Date('August 13 2024 11:00 GMT');
+ const compoStartDate = new Date('August 13 2024 11:00 GMT');
+ const compoEndDate = new Date('September 13 2024 11:00 GMT');
const now = new Date();
- if (+compoDate > +now) {
- const _daysLeft = Math.floor((compoDate - now) / 1000 / 3600 / 24);
+ if (+compoStartDate > +now) {
+ const _daysLeft = Math.floor((compoStartDate - now) / 1000 / 3600 / 24);
+ setDaysLeft(_daysLeft);
+ } else if (+compoEndDate > +now) {
+ const _daysLeft = Math.floor((compoEndDate - now) / 1000 / 3600 / 24);
setDaysLeft(_daysLeft);
}
}, []);
diff --git a/src/components/Js13KModal.jsx b/src/components/Js13KModal.jsx
index 303a8d3..503b884 100644
--- a/src/components/Js13KModal.jsx
+++ b/src/components/Js13KModal.jsx
@@ -29,7 +29,7 @@ export function Js13KModal({ show, closeHandler }) {
HTML5 Game Developers. The fun part of the compo is
the file size limit set to 13 kilobytes. The
competition will start at 13:00 CEST, 13th August and
- will end at 13:00 CEST, 13th September 2018.
+ will end at 13:00 CEST, 13th September.
@@ -43,7 +43,8 @@ export function Js13KModal({ show, closeHandler }) {
rel="noopener"
>
Read more about this collaboration
- .
+
+ .
diff --git a/src/style.css b/src/style.css
index 0d9b4ee..290ef17 100644
--- a/src/style.css
+++ b/src/style.css
@@ -1867,6 +1867,7 @@ body:not(.is-app) .show-when-app {
.footer__js13k-days-left {
padding: 1px 9px;
+ font-size: 0.8em;
text-transform: uppercase;
background: #b12a34;
color: white;