A Deno-powered backend service for Plants vs. Zombies: MODDED. [Read-only GitHub mirror] docs.pvzm.net
express typescript expressjs plant deno jspvz pvzm game online backend plants-vs-zombies zombie javascript plants modded vs plantsvszombies openapi pvz noads
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

shut up linter and fix regex fail

Clay c0d360b3 fe3ec505

+14 -10
+3
modules/server/routes/levels.ts
··· 26 26 // create a new level 27 27 app.post("/api/levels", async (req: any, res: any) => { 28 28 try { 29 + // deno-lint-ignore prefer-const 29 30 let author: string; 30 31 let _is_water: boolean; 32 + // deno-lint-ignore prefer-const 31 33 let turnstileResponse: string; 34 + // deno-lint-ignore prefer-const 32 35 let levelBinary: Uint8Array; 33 36 const contentType = req.headers["content-type"] || ""; 34 37
+11 -10
public/js/pico.modal.js
··· 3 3 * 4 4 * Pico.css - https://picocss.com 5 5 * Copyright 2019-2024 - Licensed under MIT 6 - */ $1; //$2\l$3onfig 6 + */ 7 + // deno-lint-ignore-file 8 + 7 9 const isOpenClass = "modal-is-open"; 8 10 const openingClass = "modal-is-opening"; 9 11 const closingClass = "modal-is-closing"; 10 12 const scrollbarWidthCssVar = "--pico-scrollbar-width"; 11 13 const animationDuration = 400; // ms 12 14 let visibleModal = null; 13 - $1; //$2\l$3oggle modal 14 - const toggleModal = (event) => { 15 + // toggle modal 16 + const _toggleModal = (event) => { 15 17 event.preventDefault(); 16 18 const modal = document.getElementById(event.currentTarget.dataset.target); 17 19 if (!modal) return; 18 20 // oxlint-disable-next-line no-unused-expressions 19 21 modal && (modal.open ? closeModal(modal) : openModal(modal)); 20 22 }; 21 - $1; //$2\l$3pen modal 23 + // open modal 22 24 const openModal = (modal) => { 23 25 const { documentElement: html } = document; 24 26 const scrollbarWidth = getScrollbarWidth(); ··· 32 34 }, animationDuration); 33 35 modal.showModal(); 34 36 }; 35 - $1; //$2\l$3lose modal 37 + // close modal 36 38 const closeModal = (modal) => { 37 39 visibleModal = null; 38 40 const { documentElement: html } = document; ··· 43 45 modal.close(); 44 46 }, animationDuration); 45 47 }; 46 - $1; //$2\l$3lose with a click outside 48 + // close with a click outside 47 49 document.addEventListener("click", (event) => { 48 50 if (visibleModal === null) return; 49 51 const modalContent = visibleModal.querySelector("article"); ··· 51 53 // oxlint-disable-next-line no-unused-expressions 52 54 !isClickInside && closeModal(visibleModal); 53 55 }); 54 - $1; //$2\l$3lose with Esc key 56 + // close with Esc key 55 57 document.addEventListener("keydown", (event) => { 56 58 if (event.key === "Escape" && visibleModal) { 57 59 closeModal(visibleModal); 58 60 } 59 61 }); 60 - $1; //$2\l$3et scrollbar width 62 + // get scrollbar width 61 63 const getScrollbarWidth = () => { 62 64 const scrollbarWidth = globalThis.innerWidth - document.documentElement.clientWidth; 63 65 return scrollbarWidth; 64 66 }; 65 - $1; //$2\l$3s scrollbar visible 66 - // oxlint-disable-next-line no-unused-vars 67 + // is scrollbar visible 67 68 const isScrollbarVisible = () => { 68 69 return document.body.scrollHeight > screen.height; 69 70 };