const hero = document.querySelector(".hero");
const heroTopBarEl = document.querySelector(".hero__top-bar");
const headerImgEl = document.querySelector(".hero__img");
const todayEvent = getTodayEvent();
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent.blurb;
if (todayEvent.class) {
headerImgEl.classList.add(todayEvent.class);
}
}
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const year = date.getFullYear();
const weekOfMonth = Math.ceil(day / 7);
const leilukinsHubLaunchDate = new Date("2022-09-11").getFullYear();
const siteAnniversary = year - leilukinsHubLaunchDate;
if (month === 3 && day === 1)
return {
blurb: `Today is Zero Discrimination Day`,
class: "flag-progress-intersex",
};
else if (month === 3 && day === 8)
return {
blurb: `Today is International Women's Day}`,
class: "symbol-venus",
};
else if (month === 3 && day === 31)
return {
blurb: `Today is Trans Day of Visibility`,
class: "flag-trans",
};
else if (month === 4 && day === 6)
return {
blurb: `Today is International Asexuality Day`,
class: "flag-ace",
};
else if (month === 4 && day === 26)
return {
blurb: `Today is Lesbian Visibility Day`,
class: "flag-lesbian",
};
else if (month === 4 && weekOfMonth === 4)
return {
blurb: `This week is Lesbian Visibility Week`,
class: "flag-lesbian",
};
else if (month === 5 && day === 17)
return {
blurb: `Today is International Day Against Homophobia, Biphobia and Transphobia`,
class: "flag-progress",
};
else if (month === 5 && day === 19)
return {
blurb: `Today is Agender Pride Day`,
class: "flag-agender",
};
else if (month === 5 && day === 25)
return {
blurb: `Today is Pansexual and Panromantic Awareness and Visibility Day`,
class: "flag-pan",
};
else if (month === 6)
return {
blurb: `Happy Pride Month!`,
class: "flag-progress-intersex",
};
else if (month === 7 && day === 14)
return {
blurb: `Today is Non-Binary People's Day`,
class: "flag-non-binary",
};
else if (month === 7 && day === 28)
return {
blurb: `Today is Leilukin's Birthday`
};
else if (month === 7)
return{
blurb: `Happy Disability Pride Month!`,
class: "flag-disability"
}
else if (month === 8 && day === 25)
return {
blurb: `Today is Aromantic Spectrum Visibility Day`,
class: "flag-aro",
};
else if (month === 9 && day === 11)
return {
blurb: `Today is the ${siteAnniversary}-year anniversary of the launch of Leilukin's Hub`
};
else if (month === 9 && day === 23)
return {
blurb: `Today is Bi Visibility Day`,
class: "flag-bi",
};
else if (month === 10 && day === 8)
return {
blurb: `Today is International Lesbian Day`,
class: "flag-lesbian",
};
else if (month === 10 && day === 11)
return {
blurb: `Today is National Coming Out Day`,
class: "flag-rainbow",
};
else if (month === 10 && day === 17)
return {
blurb: `Today is the start of Genderfluid Visibility Week`,
class: "flag-genderfluid",
};
else if (month === 10 && day === 26)
return {
blurb: `Today is Intersex Awareness Day`,
class: "flag-intersex",
};
else if (month === 11 && day === 13)
return {
blurb: `Today is the start of Transgender Awareness Week`,
class: "flag-trans",
};
else
return null;
}