From 134e1a98c4f20a89d6e3f37bb26882b734b3b736 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Sat, 27 Aug 2022 15:49:19 +0300 Subject: [PATCH] remove fastnav system --- out/res/fastnav.js | 26 -------------------------- src/assets/fastnav.js | 29 ----------------------------- src/index.js | 36 +++++++----------------------------- 3 files changed, 7 insertions(+), 84 deletions(-) delete mode 100644 out/res/fastnav.js delete mode 100644 src/assets/fastnav.js 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}) => ` -