No more inline styles and scripts

This commit is contained in:
2022-12-13 01:02:09 +01:00
parent 659bcb8f51
commit 52e588e0cc
4 changed files with 84 additions and 87 deletions

View File

@@ -2,6 +2,7 @@
<html>
<head>
<link rel="stylesheet" href="https://siphalor.de/assets/css/style.css">
<link rel="stylesheet" href="/Nginx-Fancyindex-Theme/index.css">
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -19,39 +20,8 @@
<link rel="icon" type="image/png" sizes="32x32" href="https://siphalor.de/assets/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="https://siphalor.de/assets/favicons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://siphalor.de/assets/favicons/favicon-16x16.png">
<style>
h1 {
text-align: center
}
summary {
text-align: center;
}
#search-container hr {
margin-top: 10px;
margin-bottom: 20px;
}
</style>
</head>
<body data-theme="dark">
<script>
const body = document.body;
const data = body.getAttribute("data-theme");
const initTheme = (state) => {
if (state === "dark") {
body.setAttribute("data-theme", "dark");
} else if (state === "light") {
body.removeAttribute("data-theme");
} else {
localStorage.setItem("theme", data);
}
};
initTheme(localStorage.getItem("theme"));
setTimeout(() => body.classList.remove("notransition"), 75);
</script>
<div class="navbar" role="navigation">
<nav class="menu">
<input type="checkbox" id="menu-trigger" class="menu-trigger" />