Add or remove hidden class from top bar

This commit is contained in:
Helen Chong 2024-04-18 16:12:09 +08:00
parent 151fdbd6d5
commit c57ec210d9
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<header class="hero"> <header class="hero">
<div class="hero__top-bar"></div> <div class="hero__top-bar hidden"></div>
<div class="hero__img"> <div class="hero__img">
<img src="/assets/leilukin/Leilukins-Hub-website-banner.png" alt="Banner of Leilukin's Hub"> <img src="/assets/leilukin/Leilukins-Hub-website-banner.png" alt="Banner of Leilukin's Hub">
</div> </div>
@ -40,14 +40,14 @@
const headerImgEl = document.querySelector(".hero__img"); const headerImgEl = document.querySelector(".hero__img");
if (todayEvent != "No event") { if (todayEvent != "No event") {
headerTopBarEl.classList.remove('hidden');
if (todayEvent == "Leilukin's Birthday" || todayEvent == "Leilukin's Hub Anniversary") { if (todayEvent == "Leilukin's Birthday" || todayEvent == "Leilukin's Hub Anniversary") {
headerTopBarEl.innerHTML = getBlurbHtml(todayEvent); headerTopBarEl.innerHTML = getBlurbHtml(todayEvent);
} else { } else {
headerImgEl.classList.add(getBanner(todayEvent)); headerImgEl.classList.add(getBanner(todayEvent));
headerTopBarEl.innerHTML = getBlurbHtml(todayEvent); headerTopBarEl.innerHTML = getBlurbHtml(todayEvent);
} }
} else {
headerTopBarEl.style.display = 'none';
} }
function getTodayEvent() { function getTodayEvent() {