From cbb5b8d8ac32316e72a94428d057ab1ffc48afa1 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Mon, 29 Apr 2024 11:40:43 +0800 Subject: [PATCH] Refactor KotOR hero header events --- _site/feed.xml | 2 +- .../arren-kae-kreia-theory/index.html | 37 ++++++------------- .../faq-same-gender-romance-mods/index.html | 37 ++++++------------- .../handmaiden-sisters-mother/index.html | 37 ++++++------------- .../shrines/starwarskotor/articles/index.html | 37 ++++++------------- .../index.html | 37 ++++++------------- .../juhani-lesbian-evidence/index.html | 37 ++++++------------- .../articles/keep-juhani-a-lesbian/index.html | 37 ++++++------------- .../partyswap-management-takeover/index.html | 37 ++++++------------- .../index.html | 37 ++++++------------- _site/shrines/starwarskotor/guides/index.html | 37 ++++++------------- .../kotor-juhani-romance-guide/index.html | 37 ++++++------------- .../kotor-redeeming-bastila-guide/index.html | 37 ++++++------------- .../index.html | 37 ++++++------------- _site/shrines/starwarskotor/index.html | 37 ++++++------------- .../starwarskotor/resources/index.html | 37 ++++++------------- .../kotor-same-gender-romance-mods/index.html | 37 ++++++------------- .../index.html | 37 ++++++------------- .../tslrcm-m478ep-modules-music/index.html | 37 ++++++------------- .../starwarskotor/universes/index.html | 37 ++++++------------- src/_includes/starwarskotor/hero.njk | 37 ++++++------------- 21 files changed, 241 insertions(+), 501 deletions(-) diff --git a/_site/feed.xml b/_site/feed.xml index cef18f09..616d0548 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -4,7 +4,7 @@ Leilukin's personal website. - 2024-04-29T03:38:43Z + 2024-04-29T03:40:18Z https://leilukin.neocities.org Leilukin diff --git a/_site/shrines/starwarskotor/articles/arren-kae-kreia-theory/index.html b/_site/shrines/starwarskotor/articles/arren-kae-kreia-theory/index.html index 2187fc00..73f32ffa 100644 --- a/_site/shrines/starwarskotor/articles/arren-kae-kreia-theory/index.html +++ b/_site/shrines/starwarskotor/articles/arren-kae-kreia-theory/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/articles/faq-same-gender-romance-mods/index.html b/_site/shrines/starwarskotor/articles/faq-same-gender-romance-mods/index.html index 8096baab..4e484576 100644 --- a/_site/shrines/starwarskotor/articles/faq-same-gender-romance-mods/index.html +++ b/_site/shrines/starwarskotor/articles/faq-same-gender-romance-mods/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/articles/handmaiden-sisters-mother/index.html b/_site/shrines/starwarskotor/articles/handmaiden-sisters-mother/index.html index 82b7921e..5daa8d0e 100644 --- a/_site/shrines/starwarskotor/articles/handmaiden-sisters-mother/index.html +++ b/_site/shrines/starwarskotor/articles/handmaiden-sisters-mother/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/articles/index.html b/_site/shrines/starwarskotor/articles/index.html index 17f85cdb..7b514876 100644 --- a/_site/shrines/starwarskotor/articles/index.html +++ b/_site/shrines/starwarskotor/articles/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/articles/juhani-hostility-towards-canderous/index.html b/_site/shrines/starwarskotor/articles/juhani-hostility-towards-canderous/index.html index 20ea9fad..a8c8876e 100644 --- a/_site/shrines/starwarskotor/articles/juhani-hostility-towards-canderous/index.html +++ b/_site/shrines/starwarskotor/articles/juhani-hostility-towards-canderous/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/articles/juhani-lesbian-evidence/index.html b/_site/shrines/starwarskotor/articles/juhani-lesbian-evidence/index.html index 17ac5fe4..40806f96 100644 --- a/_site/shrines/starwarskotor/articles/juhani-lesbian-evidence/index.html +++ b/_site/shrines/starwarskotor/articles/juhani-lesbian-evidence/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/articles/keep-juhani-a-lesbian/index.html b/_site/shrines/starwarskotor/articles/keep-juhani-a-lesbian/index.html index 165f87ac..5af486e8 100644 --- a/_site/shrines/starwarskotor/articles/keep-juhani-a-lesbian/index.html +++ b/_site/shrines/starwarskotor/articles/keep-juhani-a-lesbian/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/articles/partyswap-management-takeover/index.html b/_site/shrines/starwarskotor/articles/partyswap-management-takeover/index.html index 868329b7..d6be3c72 100644 --- a/_site/shrines/starwarskotor/articles/partyswap-management-takeover/index.html +++ b/_site/shrines/starwarskotor/articles/partyswap-management-takeover/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/articles/tslrcm-first-kotor2-playthrough/index.html b/_site/shrines/starwarskotor/articles/tslrcm-first-kotor2-playthrough/index.html index c94c8807..2fe45720 100644 --- a/_site/shrines/starwarskotor/articles/tslrcm-first-kotor2-playthrough/index.html +++ b/_site/shrines/starwarskotor/articles/tslrcm-first-kotor2-playthrough/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/guides/index.html b/_site/shrines/starwarskotor/guides/index.html index 86a96483..c5044df4 100644 --- a/_site/shrines/starwarskotor/guides/index.html +++ b/_site/shrines/starwarskotor/guides/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/guides/kotor-juhani-romance-guide/index.html b/_site/shrines/starwarskotor/guides/kotor-juhani-romance-guide/index.html index 5397a8a2..9ad8579b 100644 --- a/_site/shrines/starwarskotor/guides/kotor-juhani-romance-guide/index.html +++ b/_site/shrines/starwarskotor/guides/kotor-juhani-romance-guide/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/guides/kotor-redeeming-bastila-guide/index.html b/_site/shrines/starwarskotor/guides/kotor-redeeming-bastila-guide/index.html index ebe7b92b..46610d49 100644 --- a/_site/shrines/starwarskotor/guides/kotor-redeeming-bastila-guide/index.html +++ b/_site/shrines/starwarskotor/guides/kotor-redeeming-bastila-guide/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/guides/kotor-sandral-matale-feud-guide/index.html b/_site/shrines/starwarskotor/guides/kotor-sandral-matale-feud-guide/index.html index 9330bbc3..765c6b6e 100644 --- a/_site/shrines/starwarskotor/guides/kotor-sandral-matale-feud-guide/index.html +++ b/_site/shrines/starwarskotor/guides/kotor-sandral-matale-feud-guide/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/index.html b/_site/shrines/starwarskotor/index.html index 4ab64752..3dc83286 100644 --- a/_site/shrines/starwarskotor/index.html +++ b/_site/shrines/starwarskotor/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/resources/index.html b/_site/shrines/starwarskotor/resources/index.html index 9e590579..95206108 100644 --- a/_site/shrines/starwarskotor/resources/index.html +++ b/_site/shrines/starwarskotor/resources/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/resources/kotor-same-gender-romance-mods/index.html b/_site/shrines/starwarskotor/resources/kotor-same-gender-romance-mods/index.html index 8ca9a4c7..e9950374 100644 --- a/_site/shrines/starwarskotor/resources/kotor-same-gender-romance-mods/index.html +++ b/_site/shrines/starwarskotor/resources/kotor-same-gender-romance-mods/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/resources/kotor2-female-exile-recruit-handmaiden-mods/index.html b/_site/shrines/starwarskotor/resources/kotor2-female-exile-recruit-handmaiden-mods/index.html index 974818d0..96b94231 100644 --- a/_site/shrines/starwarskotor/resources/kotor2-female-exile-recruit-handmaiden-mods/index.html +++ b/_site/shrines/starwarskotor/resources/kotor2-female-exile-recruit-handmaiden-mods/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/resources/tslrcm-m478ep-modules-music/index.html b/_site/shrines/starwarskotor/resources/tslrcm-m478ep-modules-music/index.html index 263b817a..0c6c21cc 100644 --- a/_site/shrines/starwarskotor/resources/tslrcm-m478ep-modules-music/index.html +++ b/_site/shrines/starwarskotor/resources/tslrcm-m478ep-modules-music/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/_site/shrines/starwarskotor/universes/index.html b/_site/shrines/starwarskotor/universes/index.html index cc5dfb42..258847dc 100644 --- a/_site/shrines/starwarskotor/universes/index.html +++ b/_site/shrines/starwarskotor/universes/index.html @@ -103,9 +103,9 @@ const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -113,35 +113,22 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } diff --git a/src/_includes/starwarskotor/hero.njk b/src/_includes/starwarskotor/hero.njk index a7c9e259..a3503c32 100644 --- a/src/_includes/starwarskotor/hero.njk +++ b/src/_includes/starwarskotor/hero.njk @@ -10,9 +10,9 @@ {% block eventScript %} const todayEvent = getTodayEvent(); - if (todayEvent != "No event") { + if (todayEvent) { heroTopBarEl.classList.remove('hidden'); - heroTopBarEl.innerHTML = getBlurbHtml(todayEvent); + heroTopBarEl.innerHTML = todayEvent; } function getTodayEvent() { @@ -20,34 +20,21 @@ const month = date.getMonth() + 1; const day = date.getDate(); - if (month == 7 && day == 15) - return "KotOR 1 Anniversary"; - else if (month == 12 && day == 6) - return "KotOR 2 Anniversary"; - else - return "No event"; - } - - function getBlurbHtml(day) { const currentYear = new Date().getFullYear(); const kotor1ReleaseDate = new Date("2003-07-15").getFullYear(); const kotor2ReleaseDate = new Date("2004-12-06").getFullYear(); const kotor1Anniversary = currentYear - kotor1ReleaseDate; const kotor2Anniversary = currentYear - kotor2ReleaseDate; - switch (day) { - case "KotOR 1 Anniversary": - return ` - Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic - `; - break; - case "KotOR 2 Anniversary": - return ` - Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords - `; - break; - default: - return ``; - } + if (month === 7 && day === 15) + return ` + Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic + `; + else if (month === 12 && day === 6) + return ` + Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords + `; + else + return null; } {% endblock %} \ No newline at end of file