homepage/out/res/fastnav.js

26 lines
4.8 KiB
JavaScript

const map = {"projects.html":"<div class=\"card inner-card\"><div><b>📘 waffle</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/waffle>view >></a></div><p class=\"grayed-out\">Mysterious! This project has no description.</p></div><div class=\"card inner-card\"><div><b>📘 brainlet-react</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/brainlet-react>view >></a></div><p>a react frontend for waffle (brainlet)</p></div><div class=\"card inner-card\"><div><b>📘 raven</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/raven>view >></a></div><p>Simple experimental low-level UI library written in C++.</p></div><div class=\"card inner-card\"><div><b>📘 bridgecord</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/bridgecord>view >></a></div><p>bridge bot api for discord servers</p></div><div class=\"card inner-card\"><div><b>📘 rice</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/rice>view >></a></div><p>my personal forks of various software and my dotfiles</p></div><div class=\"card inner-card\"><div><b>📘 hippOS</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/hippOS>view >></a></div><p>simple osdev testing</p></div><div class=\"card inner-card\"><div><b>📘 homepage</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/homepage>view >></a></div><p class=\"grayed-out\">Mysterious! This project has no description.</p></div><div class=\"card inner-card\"><div><b>📘 brainlet</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/brainlet>view >></a></div><p>🎤🐢 An open source, self-hosted alternative to Discord</p></div><div class=\"card inner-card\"><div><b>📘 portal</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/portal>view >></a></div><p>waffletv's interface app</p></div><div class=\"card inner-card\"><div><b>📘 capybara</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/capybara>view >></a></div><p>simple and fast remote touchpad</p></div><div class=\"card inner-card\"><div><b>📘 rotcpu</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/rotcpu>view >></a></div><p class=\"grayed-out\">Mysterious! This project has no description.</p></div><div class=\"card inner-card\"><div><b>📘 quad-j</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/quad-j>view >></a></div><p>a simple upload server</p></div><div class=\"card inner-card\"><div><b>📘 blocklists</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/blocklists>view >></a></div><p>Some pi-hole blocklists</p></div><div class=\"card inner-card\"><div><b>📘 wormhole</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/wormhole>view >></a></div><p>A simple websocket abstraction.</p></div><div class=\"card inner-card\"><div><b>📘 mcli</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/mcli>view >></a></div><p>a command-line minecraft launcher written in rust</p></div><div class=\"card inner-card\"><div><b>📘 must</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/must>view >></a></div><p>Helper program for deploying protocol associations needed for running Roblox on Linux</p></div><div class=\"card inner-card\"><div><b>🍴 brainlet-client</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/brainlet-client>view >></a></div><p class=\"grayed-out\">Mysterious! This project has no description.</p></div><div class=\"card inner-card\"><div><b>📘 luapage</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/luapage>view >></a></div><p class=\"grayed-out\">Mysterious! This project has no description.</p></div><div class=\"card inner-card\"><div><b>📘 page-simplify</b><a class=\"button-default float-right\" href=https://git.hippoz.xyz/hippoz/page-simplify>view >></a></div><p>turn pages into pure html</p></div>","index.html":"<h2>hippoz's website</h2><p>i think</p>"};
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();