0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-12-23 04:48:21 -05:00
websurfx/public/templates/header.html

30 lines
1.1 KiB
HTML
Raw Normal View History

2023-04-22 07:35:07 -04:00
<!DOCTYPE html>
<html lang="en">
<head>
<title>Websurfx</title>
2023-04-22 07:35:07 -04:00
<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" /> -->
2023-04-22 07:35:07 -04:00
</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>