0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-22 05:58:21 -05:00
websurfx/public/templates/header.html
2023-06-03 12:56:42 +05:30

30 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>Websurfx</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- <link href="static/colorschemes/{{colorscheme}}.css" rel="stylesheet" type="text/css" /> -->
<!-- <link href="static/themes/{{theme}}.css" rel="stylesheet" type="text/css" /> -->
</head>
<body>
<header>{{>navbar}}</header>
<script>
const cookies = document.cookie.split(';').map(item => item.split('=')).
reduce((acc, [k, v]) => (acc[k.trim().replace('"', '')] = v) && acc, {});
// Load colorscheme and theme from cookie
function addCss(fileName) {
var head = document.head;
var link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = fileName;
head.appendChild(link);
}
addCss('static/themes/'+ (cookies["theme"] || {{theme}}) + '.css');
addCss('static/colorschemes/'+ (cookies["color-sch"] || {{colorscheme}}) + '.css');
</script>