Initial Commit

This commit is contained in:
gabatxo1312
2026-01-23 13:56:30 +01:00
commit e8529bdbee
25 changed files with 13519 additions and 0 deletions
+12048
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -0,0 +1,3 @@
.mt-50px {
margin-top: 50px;
}
+7
View File
File diff suppressed because one or more lines are too long
+29
View File
@@ -0,0 +1,29 @@
// @description Get cookie by name
function getCookie(name) {
return document.cookie
.split("; ")
.find(row => row.startsWith(name + "="))
?.split("=")[1];
}
const DEFAULT_THEME = 'light'
window.addEventListener('load', (e) => {
let theme = getCookie('theme');
if (theme) {
// change theme
document.querySelector('html').setAttribute("data-bs-theme", theme);
// update value of input
document.querySelector("#changeTheme").value = theme
} else {
document.querySelector('html').setAttribute("data-bs-theme", DEFAULT_THEME);
}
});
document.querySelector("#changeTheme").addEventListener('change', (e) => {
// create cookie to save theme preferences
document.cookie = `theme=${e.target.value}; path=/; max-age=31536000`;
//change theme
document.querySelector('html').setAttribute("data-bs-theme", e.target.value);
});