FEAT: Added rest of unstyled HTML content. Temporarily removed animations.

This commit is contained in:
MajorDroolz
2022-12-22 16:51:59 -05:00
parent 4199536932
commit cf6a5ef910
3 changed files with 113 additions and 115 deletions

View File

@@ -1,5 +1,3 @@
let menuOpen = true;
function calcScroll() {
const scroll = window.scrollY;
const vh = window.innerHeight / 100;
@@ -12,28 +10,22 @@ function calcScroll() {
function openMenu() {
const menu = document.getElementById("menu-modal");
if (menu == null) return;
requestAnimationFrame(() => menuOpen = false);
menu.showModal();
}
function closeMenu() {
const menu = document.getElementById("menu-modal");
if (menu == null) return;
requestAnimationFrame(() => menuOpen = true);
menu.close();
}
function main() {
document.body.addEventListener('wheel', preventScroll, { passive: false });
document.body.addEventListener('touchmove', preventScroll, { passive: false });
window.addEventListener("scroll", () => requestAnimationFrame(calcScroll));
const menu = document.getElementById("menu-modal");
if (menu) {
menu.addEventListener("click", clickMenuModal);
menu.addEventListener("touchstart", clickMenuModal);
}
if (menu == null) return;
menu.addEventListener("click", clickMenuModal);
menu.addEventListener("touchstart", clickMenuModal);
}
function clickMenuModal(e) {
@@ -42,11 +34,4 @@ function clickMenuModal(e) {
closeMenu();
}
function preventScroll(e) {
if (menuOpen) return;
e.preventDefault();
e.stopPropagation();
return false;
}
window.onload = main;