improve initial load colour

This commit is contained in:
zombieFox 2021-08-14 19:56:57 +01:00
parent 1d48ba4a04
commit 978ae75ed4
3 changed files with 11 additions and 7 deletions

View File

@ -2,13 +2,19 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>New Tab</title> <title>New Tab</title>
<link rel="icon" type="image/svg+xml" href="icon/favicon.svg"/>
<style media="screen" type="text/css">@media (prefers-color-scheme: dark) {html,body {background-color: rgb(0, 0, 0);}}@media (prefers-color-scheme: light) {html,body {background-color: rgb(255, 255, 255);}}</style> <link rel="icon" type="image/svg+xml" href="icon/favicon.svg" />
<style media="screen" type="text/css">html,body {background-color: rgb(0, 0, 0);}@media (prefers-color-scheme: dark) {html,body {background-color: rgb(0, 0, 0);}}@media (prefers-color-scheme: light) {html,body {background-color: rgb(255, 255, 255);}}</style>
<script src="initialBackground.js" async></script> <script src="initialBackground.js" async></script>
</head> </head>
<body></body> <body></body>

View File

@ -25,5 +25,3 @@ component.keyboard.init();
component.menu.init(); component.menu.init();
// component.menu.open(); // component.menu.open();
// document.addEventListener('focusin', () => { console.log('focused: ', document.activeElement); });

View File

@ -1,9 +1,9 @@
// inital check for systems which do not have light or dark mode // inital check for systems which do not have light or dark mode
if (localStorage.getItem('hexagonTabStyle')) { if (localStorage.getItem('nightTabStyle')) {
var style = document.createElement('style'); const style = document.createElement('style');
style.type = 'text/css'; style.type = 'text/css';
style.media = 'screen'; style.media = 'screen';
switch (localStorage.getItem('hexagonTabStyle')) { switch (localStorage.getItem('nightTabStyle')) {
case 'light': case 'light':
style.innerHTML = 'html, body {background-color: rgb(255, 255, 255);}'; style.innerHTML = 'html, body {background-color: rgb(255, 255, 255);}';
break; break;