2024-04-18 16:57:09 +08:00
|
|
|
|
{% extends "global/hero.njk" %}
|
|
|
|
|
|
|
|
|
|
{% block heroImg %}
|
2024-04-20 12:18:54 +08:00
|
|
|
|
<picture>
|
2024-04-22 07:15:48 +08:00
|
|
|
|
<source srcset="/assets/shrines/asummersend/images/asummersend-header-320.png" media="(orientation: landscape)" />
|
|
|
|
|
<img src="/assets/shrines/asummersend/images/asummersend-header.png" alt="Banner of A Summer's End — Hong Kong 1986 Shrine" />
|
2024-04-20 12:18:54 +08:00
|
|
|
|
</picture>
|
2024-04-18 16:57:09 +08:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block eventScript %}
|
2024-04-29 11:16:44 +08:00
|
|
|
|
const todayEvent = getTodayEvent();
|
|
|
|
|
|
2024-04-29 11:39:05 +08:00
|
|
|
|
if (todayEvent) {
|
2024-04-18 16:57:09 +08:00
|
|
|
|
heroTopBarEl.classList.remove('hidden');
|
2024-04-29 11:39:05 +08:00
|
|
|
|
heroTopBarEl.innerHTML = todayEvent;
|
2024-04-18 16:57:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTodayEvent() {
|
|
|
|
|
const date = new Date();
|
|
|
|
|
const month = date.getMonth() + 1;
|
|
|
|
|
const day = date.getDate();
|
|
|
|
|
|
2024-04-29 11:39:05 +08:00
|
|
|
|
const releaseDate = new Date("2020-04-23").getFullYear();
|
|
|
|
|
const currentYear = new Date().getFullYear();
|
|
|
|
|
const anniversary = currentYear - releaseDate;
|
|
|
|
|
|
2024-04-18 16:57:09 +08:00
|
|
|
|
if (month == 2 && day == 16)
|
2024-04-29 11:39:05 +08:00
|
|
|
|
return `
|
|
|
|
|
Today is Michelle Cheung's birthday. Happy Birthday Michelle!
|
|
|
|
|
`;
|
2024-04-18 16:57:09 +08:00
|
|
|
|
else if (month == 4 && day == 23)
|
2024-04-29 11:39:05 +08:00
|
|
|
|
return `
|
|
|
|
|
Today is the ${anniversary}-year anniversary of the release of <cite>A Summer’s End — Hong Kong 1986</cite>!
|
|
|
|
|
`;
|
2024-04-18 16:57:09 +08:00
|
|
|
|
else if (month == 8 && day == 9)
|
2024-04-29 11:39:05 +08:00
|
|
|
|
return `
|
|
|
|
|
Today is Cecelia Cortes' birthday. Happy Birthday Cecelia!
|
|
|
|
|
`;
|
2024-04-18 16:57:09 +08:00
|
|
|
|
else if (month == 12 && day == 28)
|
2024-04-29 11:39:05 +08:00
|
|
|
|
return `
|
|
|
|
|
Today is Sam Wong's birthday. Happy Birthday Sam!
|
|
|
|
|
`;
|
2024-04-18 16:57:09 +08:00
|
|
|
|
else
|
2024-04-29 11:39:05 +08:00
|
|
|
|
return null;
|
2024-04-18 16:57:09 +08:00
|
|
|
|
}
|
|
|
|
|
{% endblock %}
|