added a few loading utilities
This commit is contained in:
@ -9,21 +9,16 @@ import { mode } from "../tickle/mode.mjs";
|
||||
import { bootstrapRouter } from "../tickle/bootstrapRouter.mjs";
|
||||
|
||||
export const bootstrap = async () => {
|
||||
const [Menu, Body, Source, Burger] = [
|
||||
"nav",
|
||||
const [Body, Source] = [
|
||||
"main",
|
||||
"#Source",
|
||||
".burger",
|
||||
].map(getElementByCSSSelector);
|
||||
|
||||
Burger.addEventListener("click", mode.menuOpen.toggle);
|
||||
|
||||
mode.loading.on();
|
||||
const lines = await fetchText("files.txt");
|
||||
const links = parseFileList(lines);
|
||||
const firstHref = links[0].href;
|
||||
sortFileListLines(links);
|
||||
Menu.appendChild(createMenuEntriesFromFileList(links));
|
||||
Body.appendChild(createMenuEntriesFromFileList(links));
|
||||
|
||||
bootstrapRouter(firstHref, (content, raw) => {
|
||||
Body.innerHTML = "";
|
||||
|
Reference in New Issue
Block a user