Skip to content

Commit

Permalink
Making website
Browse files Browse the repository at this point in the history
Signed-off-by: DefinetlyNotAI <[email protected]>
  • Loading branch information
DefinetlyNotAI committed Nov 29, 2024
1 parent 9912c1d commit 9eb785e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
10 changes: 10 additions & 0 deletions Website/js/favicon+urlpretty.js → Website/js/favicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ function updateFavicon() {
}
}

document.addEventListener('DOMContentLoaded', function () {
const currentUrl = window.location.href;
const urlPath = window.location.pathname;

if (currentUrl.includes('wesmun.com') && !urlPath.endsWith('.html')) {
window.location.href = currentUrl.replace('.html', '');
}
});


// Initial check
updateFavicon();

Expand Down
28 changes: 13 additions & 15 deletions Website/js/timer.index.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
const themeRevealDate = new Date("December 1, 2024 00:00:00").getTime();
const hackathonStartDate = new Date("December 13, 2024 00:00:00").getTime();
const hackathonEndDate = new Date("December 15, 2024 00:00:00").getTime();
const RegisterDate = new Date("December 1, 2024 00:00:00").getTime();
const StartDate = new Date("December 13, 2024 00:00:00").getTime();
const EndDate = new Date("December 15, 2024 00:00:00").getTime();

const countdownTimer = setInterval(() => {
const now = Date.now();
let message;
let extraMessage = "";

if (now < themeRevealDate) {
const timeLeft = themeRevealDate - now;
message = `Theme reveal in ${Math.floor(timeLeft / (1000 * 60 * 60 * 24))} days, ${Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))} hours, ${Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60))} minutes, and ${Math.floor((timeLeft % (1000 * 60)) / 1000)} seconds.`;
} else if (now < hackathonStartDate) {
const timeLeft = hackathonStartDate - now;
<!-- What are you lookin here for?? We aint leakin the theme lil bro -->
message = `The theme is NAHHH! Start Practicing 🤗!`;
extraMessage = `Competition in ${Math.floor(timeLeft / (1000 * 60 * 60 * 24))} days, ${Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))} hours, ${Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60))} minutes, and ${Math.floor((timeLeft % (1000 * 60)) / 1000)} seconds.<br><br>Very important, DO NOT finish the project! You won't be allowed to enter the competition if you do. You are allowed to finish the project up to 60% - This will be decided by the organisers.`;
} else if (now <= hackathonEndDate) {
message = "The Official Wesgreen Hackathon has begun!";
if (now < RegisterDate) {
const timeLeft = RegisterDate - now;
message = `WesMun Registration Start in ${Math.floor(timeLeft / (1000 * 60 * 60 * 24))} days, ${Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))} hours, ${Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60))} minutes, and ${Math.floor((timeLeft % (1000 * 60)) / 1000)} seconds.`;
} else if (now < StartDate) {
const timeLeft = StartDate - now;
message = `WesMun Start in ${Math.floor(timeLeft / (1000 * 60 * 60 * 24))} days, ${Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))} hours, ${Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60))} minutes, and ${Math.floor((timeLeft % (1000 * 60)) / 1000)} seconds.`;
} else if (now <= EndDate) {
message = "The Official WesMun has begun!";
} else {
message = "The Official Wesgreen Hackathon has ended.";
message = "The Official WesMun has ended.";
}

document.getElementById("countdown").innerHTML = message + (extraMessage ? `<br>${extraMessage}` : "");

if (now > hackathonEndDate) clearInterval(countdownTimer);
if (now > EndDate) clearInterval(countdownTimer);
}, 1000);
2 changes: 1 addition & 1 deletion committees.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- Site Metas -->
<link href="Website/images/wesmun.jpg" rel="shortcut icon" type="">
<link href="Website/css/favicon.css" rel="stylesheet" type="text/css"/>
<script src="Website/js/favicon+urlpretty.js"></script>
<script src="Website/js/favicon.js"></script>

<title>WesMun - Committees</title>

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link href="Website/images/wesmun.jpg" rel="shortcut icon" type="">
<link href="Website/css/favicon.css" rel="stylesheet" type="text/css"/>
<script src="Website/js/cookie.js"></script>
<script src="Website/js/favicon+urlpretty.js"></script>
<script src="Website/js/favicon.js"></script>

<title>WesMun Home Page</title>

Expand Down
2 changes: 1 addition & 1 deletion rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- Site Metas -->
<link href="Website/images/wesmun.jpg" rel="icon" type="image/png">
<link href="Website/css/favicon.css" rel="stylesheet" type="text/css"/>
<script src="Website/js/favicon+urlpretty.js"></script>
<script src="Website/js/favicon.js"></script>

<title>WesMun - Rules</title>

Expand Down
2 changes: 1 addition & 1 deletion team.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- Site Metas -->
<link href="Website/images/wesmun.jpg" rel="shortcut icon" type="">
<link href="Website/css/favicon.css" rel="stylesheet" type="text/css"/>
<script src="Website/js/favicon+urlpretty.js"></script>
<script src="Website/js/favicon.js"></script>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Meet the Team</title>
<link href="Website/css/volunteer.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion venue.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- Site Metas -->
<link href="Website/images/wesmun.jpg" rel="shortcut icon" type="">
<link href="Website/css/favicon.css" rel="stylesheet" type="text/css"/>
<script src="Website/js/favicon+urlpretty.js"></script>
<script src="Website/js/favicon.js"></script>
<meta content="width=device-width, initial-scale=1.0" name="viewport">


Expand Down

0 comments on commit 9eb785e

Please sign in to comment.