var Browser = { toggle: (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") }, loadfront: async () => { let packages = await (await fetch("https://northstar.thunderstore.io/api/v1/package/")).json(); for (let i in packages) { let pkg = {...packages[i], ...packages[i].versions[0]}; new BrowserEl({ title: pkg.name, image: pkg.icon, author: pkg.owner, download: pkg.download_url, version: pkg.version_number, description: pkg.description }) } }, loading: () => { if (! browserEntries.querySelector(".loading")) { browserEntries.innerHTML = `