Refactor KotOR hero header events
This commit is contained in:
parent
db7dc4cd23
commit
cbb5b8d8ac
|
@ -4,7 +4,7 @@
|
||||||
<subtitle>Leilukin's personal website.</subtitle>
|
<subtitle>Leilukin's personal website.</subtitle>
|
||||||
<link href="https://leilukin.neocities.org/feed.xml" rel="self"/>
|
<link href="https://leilukin.neocities.org/feed.xml" rel="self"/>
|
||||||
<link href="https://leilukin.neocities.org"/>
|
<link href="https://leilukin.neocities.org"/>
|
||||||
<updated>2024-04-29T03:38:43Z</updated>
|
<updated>2024-04-29T03:40:18Z</updated>
|
||||||
<id>https://leilukin.neocities.org</id>
|
<id>https://leilukin.neocities.org</id>
|
||||||
<author>
|
<author>
|
||||||
<name>Leilukin</name>
|
<name>Leilukin</name>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -103,9 +103,9 @@
|
||||||
|
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -113,35 +113,22 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
{% block eventScript %}
|
{% block eventScript %}
|
||||||
const todayEvent = getTodayEvent();
|
const todayEvent = getTodayEvent();
|
||||||
|
|
||||||
if (todayEvent != "No event") {
|
if (todayEvent) {
|
||||||
heroTopBarEl.classList.remove('hidden');
|
heroTopBarEl.classList.remove('hidden');
|
||||||
heroTopBarEl.innerHTML = getBlurbHtml(todayEvent);
|
heroTopBarEl.innerHTML = todayEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTodayEvent() {
|
function getTodayEvent() {
|
||||||
|
@ -20,34 +20,21 @@
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
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 currentYear = new Date().getFullYear();
|
||||||
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
|
||||||
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
|
||||||
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
|
||||||
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
|
||||||
|
|
||||||
switch (day) {
|
if (month === 7 && day === 15)
|
||||||
case "KotOR 1 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else if (month === 12 && day === 6)
|
||||||
case "KotOR 2 Anniversary":
|
|
||||||
return `
|
return `
|
||||||
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
|
||||||
`;
|
`;
|
||||||
break;
|
else
|
||||||
default:
|
return null;
|
||||||
return ``;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue