hugo-theme-re-terminal/assets/js/banner.js

13 lines
312 B
JavaScript
Raw Permalink Normal View History

2024-07-30 11:37:30 +00:00
const banner = document.getElementById("banner");
const buttons = banner.getElementsByTagName("button");
if (buttons?.[0]) {
const listener = buttons[0].addEventListener("click", () => {
banner.remove();
});
if (!document.getElementById("banner")) {
removeEventListener("click", listener);
}
}