diff options
Diffstat (limited to 'src/app/browser.js')
-rw-r--r-- | src/app/browser.js | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/app/browser.js b/src/app/browser.js index 1fe6930..ae3e453 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -1,11 +1,28 @@ -function Browser() { +function Browser(state) { + if (state) { + overlay.classList.add("shown") + browser.classList.add("shown") + return + } else if (! state) { + if (state != undefined) { + overlay.classList.remove("shown") + browser.classList.remove("shown") + return + } + } + + overlay.classList.toggle("shown") browser.classList.toggle("shown") };Browser() +document.body.addEventListener("keyup", (e) => { + if (e.key == "Escape") {Browser(false)} +}) + function BrowserEl(properties) { properties = { title: "No name", - image: "", + image: "icons/no-image.png", author: "Unnamed Pilot", description: "No description", ...properties |