This commit is contained in:
electrofelix
2022-11-02 13:44:26 +00:00
parent 42d31f1207
commit ab0a50e328
13 changed files with 202 additions and 32 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"files":{"js/site_constants-e1ac483f8cbbb2d44940348129b4f096317606c1e27aa57fe14734259e395fe6.js":{"logical_path":"js/site_constants.js","mtime":"2022-10-30T11:29:43+00:00","size":98,"digest":"e1ac483f8cbbb2d44940348129b4f096317606c1e27aa57fe14734259e395fe6","integrity":"sha256-4axIP4y7stRJQDSBKbTwljF2BsHieqV/4Uc0JZ45X+Y="}},"assets":{"js/site_constants.js":"js/site_constants-e1ac483f8cbbb2d44940348129b4f096317606c1e27aa57fe14734259e395fe6.js"}}
{"files":{"js/site_constants-e1ac483f8cbbb2d44940348129b4f096317606c1e27aa57fe14734259e395fe6.js":{"logical_path":"js/site_constants.js","mtime":"2022-11-02T13:43:27+00:00","size":98,"digest":"e1ac483f8cbbb2d44940348129b4f096317606c1e27aa57fe14734259e395fe6","integrity":"sha256-4axIP4y7stRJQDSBKbTwljF2BsHieqV/4Uc0JZ45X+Y="}},"assets":{"js/site_constants.js":"js/site_constants-e1ac483f8cbbb2d44940348129b4f096317606c1e27aa57fe14734259e395fe6.js"}}

63
assets/js/color_scheme.js Normal file
View File

@@ -0,0 +1,63 @@
function setTheme(theme) {
if (theme === "dark") {
jtd.setTheme('dark');
document.documentElement.setAttribute('data-theme', 'dark');
window.localStorage.setItem('theme', 'dark');
} else {
jtd.setTheme('light');
document.documentElement.setAttribute('data-theme', 'light');
window.localStorage.setItem('theme', 'light');
}
}
if (window.matchMedia) {
window.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', event => {
if (event.matches) {
setTheme('dark');
} else {
setTheme('light');
}
});
}
function getUserThemePreference() {
return localStorage.getItem('theme') || getComputedStyle(document.documentElement).getPropertyValue('content') || 'system';
}
function saveUserThemePreference(preference) {
localStorage.setItem('theme', preference);
}
function getAppliedMode(preference) {
if (preference === 'dark') {
return 'dark';
}
if (preference === 'light') {
return 'light';
}
// system
if (matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark';
}
return 'light';
}
const colorScheme = document.querySelector('meta[name="color-scheme"]');
function setAppliedMode(mode) {
setTheme(mode);
}
function modeSwitcher() {
let currentMode = document.documentElement.getAttribute('data-theme');
if (currentMode === "dark") {
setAppliedMode('light');
document.getElementById("theme-toggle").innerHTML = "Dark Mode";
} else {
setAppliedMode('dark');
document.getElementById("theme-toggle").innerHTML = "Light Mode";
}
}
let theme = getUserThemePreference();
setAppliedMode(getAppliedMode(theme));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="https://vagrant-libvirt.github.io/vagrant-libvirt/feed.xml" rel="self" type="application/atom+xml" /><link href="https://vagrant-libvirt.github.io/vagrant-libvirt/" rel="alternate" type="text/html" /><updated>2022-10-30T11:30:32+00:00</updated><id>https://vagrant-libvirt.github.io/vagrant-libvirt/feed.xml</id><title type="html">Vagrant Libvirt Documentation</title><subtitle>Create and manage Vagrant machines using Libvirt/QEMU</subtitle></feed>
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="https://vagrant-libvirt.github.io/vagrant-libvirt/feed.xml" rel="self" type="application/atom+xml" /><link href="https://vagrant-libvirt.github.io/vagrant-libvirt/" rel="alternate" type="text/html" /><updated>2022-11-02T13:44:19+00:00</updated><id>https://vagrant-libvirt.github.io/vagrant-libvirt/feed.xml</id><title type="html">Vagrant Libvirt Documentation</title><subtitle>Create and manage Vagrant machines using Libvirt/QEMU</subtitle></feed>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
packaging.html Normal file

File diff suppressed because one or more lines are too long

1
troubleshooting.html Normal file

File diff suppressed because one or more lines are too long