You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.0 KiB

import '@assets/scss/main.scss';
4 years ago
// noinspection ES6UnusedImports
import {Dropdown} from 'bootstrap';
// Ensure locales are made for all languages
// noinspection JSUnusedLocalSymbols
const helloWorld = gettext('Hello World');
4 years ago
window.addEventListener('DOMContentLoaded', () => {
const scrollMotdBreak = 64;
const motdElement = document.getElementById('al-motd');
if (motdElement) {
const navBarElement = document.getElementById('al-primary-navbar');
const maybeHideMotd = () => {
if (window.scrollY > scrollMotdBreak && motdElement.style.display !== 'none') {
motdElement.style.display = 'none';
navBarElement.classList.remove('with-motd');
} else if (window.scrollY <= scrollMotdBreak && motdElement.style.display !== 'block') {
motdElement.style.display = 'block';
navBarElement.classList.add('with-motd');
}
};
document.addEventListener('scroll', maybeHideMotd);
maybeHideMotd()
}
});