Web/main/scripts/banner.js
Ell 6f5ec98dff
All checks were successful
Jenkins
Ellpeck/Web/pipeline/head This commit looks good
switch to a global charity for pride
2023-06-01 09:25:38 +02:00

18 lines
No EOL
996 B
JavaScript

let date = new Date();
if (date.getMonth() + 1 === 6) {
setBanner("pride", "It's Pride Month! Consider donating to charities like Outright International.", "https://outrightinternational.org/");
} else if (date.getMonth() + 1 === 2) {
setBanner("blm", "It's Black History Month! Consider donating to charities like Black Lives Matter.", "https://blacklivesmatter.com/");
} else if (date.getMonth() + 1 === 3) {
setBanner("women", "It's Women's History Month! Consider donating to charities like the Global Fund for Women.", "https://www.globalfundforwomen.org/");
} else if (date.getMonth() + 1 === 4 && date.getDate() <= 4) {
setBanner("autism", "It's Autism Awareness Week! Consider donating to charities like the ASAN.", "https://autisticadvocacy.org/");
}
function setBanner(name, desc, link) {
let banner = $("#banner");
banner.html(desc);
banner.prop("href", link);
banner.css("background-image", `url(/res/${name}.png)`);
banner.removeAttr("hidden");
}