commit aebc8a830b02647b2816be52b9066e289ae456e7 Author: Lasse Liebler Date: Fri Dec 12 02:05:10 2025 +0100 Initialized repo diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bd61c05 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets +!*.code-workspace + +# Built Visual Studio Code Extensions +*.vsix \ No newline at end of file diff --git a/assets/js/auto-style-switch.js b/assets/js/auto-style-switch.js new file mode 100644 index 0000000..b13101a --- /dev/null +++ b/assets/js/auto-style-switch.js @@ -0,0 +1,15 @@ +/** + * Detects system/browser color scheme and sets the "style_variant" cookie accordingly. + * Reloads the page if the variant changes. + */ + +(function () { + const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches; + const cookie = document.cookie.split('; ').find(r => r.startsWith('style_variant=')); + const current = cookie ? cookie.split('=')[1] : ''; + const desired = prefersDark ? '01-evening' : 'default'; // Customize variant names as needed + if (current !== desired) { + document.cookie = "style_variant=" + desired + "; path=/; max-age=31536000"; + location.reload(); + } +})(); \ No newline at end of file diff --git a/includes/Config.php b/includes/Config.php new file mode 100644 index 0000000..e895abd --- /dev/null +++ b/includes/Config.php @@ -0,0 +1,12 @@ +init(); \ No newline at end of file