35 lines
1.0 KiB
Plaintext
35 lines
1.0 KiB
Plaintext
{% extends "global/hero.njk" %}
|
|
|
|
{% block heroImg %}
|
|
<picture>
|
|
<source srcset="/assets/shrines/pokemonoras/images/pokemonoras-header-320.avif" media="(orientation: landscape)" />
|
|
<img src="/assets/shrines/pokemonoras/images/pokemonoras-header-640.avif" alt="Banner of Pokémon Omega Ruby and Alpha Sapphire Shrine" />
|
|
</picture>
|
|
{% endblock %}
|
|
|
|
{% block eventScript %}
|
|
const todayEvent = getTodayEvent();
|
|
|
|
if (todayEvent) {
|
|
heroTopBarEl.classList.remove('hidden');
|
|
heroTopBarEl.innerHTML = todayEvent;
|
|
}
|
|
|
|
function getTodayEvent() {
|
|
const date = new Date();
|
|
const month = date.getMonth() + 1;
|
|
const day = date.getDate();
|
|
const year = date.getFullYear();
|
|
|
|
const orasReleaseDate = new Date("2014-11-21").getFullYear();
|
|
const orasAnniversary = year - orasReleaseDate;
|
|
|
|
if (month === 11 && day === 21)
|
|
return `
|
|
Today is the ${orasAnniversary}-year anniversary of the release of <cite>Pokémon Omega Ruby"</cite> and <cite>Alpha Sapphire</cite>!
|
|
`;
|
|
else
|
|
return null;
|
|
}
|
|
{% endblock %}
|