diff --git a/out/res/fastnav.js b/out/res/fastnav.js deleted file mode 100644 index 3fdd4f1..0000000 --- a/out/res/fastnav.js +++ /dev/null @@ -1,26 +0,0 @@ -const map = {"projects.html":"
Mysterious! This project has no description.
a react frontend for waffle (brainlet)
Simple experimental low-level UI library written in C++.
bridge bot api for discord servers
my personal forks of various software and my dotfiles
simple osdev testing
Mysterious! This project has no description.
🎤🐢 An open source, self-hosted alternative to Discord
waffletv's interface app
simple and fast remote touchpad
Mysterious! This project has no description.
a simple upload server
Some pi-hole blocklists
A simple websocket abstraction.
a command-line minecraft launcher written in rust
Helper program for deploying protocol associations needed for running Roblox on Linux
Mysterious! This project has no description.
Mysterious! This project has no description.
turn pages into pure html
i think
"}; -const content = document.getElementById("content"); - -const load = (page) => content.innerHTML = map[page.substring(1, page.length) || "_notfound"]; -const navigate = (page) => { - history.pushState(null, "", page); - load(page); -}; - -const populate = () => { - const elements = document.querySelectorAll("[href]"); - elements.forEach(element => { - const existingLink = element.getAttribute("href"); - if (map[existingLink]) { - element.setAttribute("href", "#"); - element.onclick = () => navigate(existingLink); - } - }); -}; - -const main = () => { - populate(); - window.onpopstate = () => {load(location.pathname); console.log("a");}; -}; - -main(); diff --git a/src/assets/fastnav.js b/src/assets/fastnav.js deleted file mode 100644 index 97a5a08..0000000 --- a/src/assets/fastnav.js +++ /dev/null @@ -1,29 +0,0 @@ -const map = "{{NAV_DATA}}"; -const content = document.getElementById("content"); - -const load = (page) => { - content.innerHTML = map[page.substring(1, page.length) || "_notfound"]; - console.log("a"); -}; -const navigate = (page) => { - history.pushState(null, "", page); - load(page); -}; - -const populate = () => { - const elements = document.querySelectorAll("[href]"); - elements.forEach(element => { - const existingLink = element.getAttribute("href"); - if (map[existingLink]) { - element.setAttribute("href", ""); - element.onclick = () => navigate(existingLink); - } - }); -}; - -const main = () => { - populate(); - window.onpopstate = () => load(location.pathname); -}; - -main(); diff --git a/src/index.js b/src/index.js index 74d2ab3..b44725a 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,7 @@ const { html: beautifyHtml } = require('js-beautify'); const data = { outputDirectory: "./out", navigationLinks: [ - {link: "index.html", text: "home", name: "home"}, + {link: "index.html", text: "home", name: "index"}, {link: "projects.html", text: "projects", name: "projects"}, {link: "https://git.hippoz.xyz", text: "git", name: "__ext_git"}, ], @@ -45,14 +45,14 @@ const linkButton = ({ link, text, selected=false }) => ` `; const navigation = ({currentName}) => ` -