avances en plantillas
This commit is contained in:
parent
0f84beacf1
commit
da0530d79b
2062 changed files with 598814 additions and 22 deletions
32
storage/public/dist/js/tabler-theme.js
vendored
Normal file
32
storage/public/dist/js/tabler-theme.js
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
(function(factory) {
|
||||
typeof define === "function" && define.amd ? define(factory) : factory();
|
||||
})((function() {
|
||||
"use strict";
|
||||
const themeConfig = {
|
||||
"theme": "light",
|
||||
"theme-base": "gray",
|
||||
"theme-font": "sans-serif",
|
||||
"theme-primary": "blue",
|
||||
"theme-radius": "1"
|
||||
};
|
||||
const params = new Proxy(new URLSearchParams(window.location.search), {
|
||||
get: (searchParams, prop) => searchParams.get(prop)
|
||||
});
|
||||
for (const key in themeConfig) {
|
||||
const param = params[key];
|
||||
let selectedValue;
|
||||
if (!!param) {
|
||||
localStorage.setItem("tabler-" + key, param);
|
||||
selectedValue = param;
|
||||
} else {
|
||||
const storedTheme = localStorage.getItem("tabler-" + key);
|
||||
selectedValue = storedTheme ? storedTheme : themeConfig[key];
|
||||
}
|
||||
if (selectedValue !== themeConfig[key]) {
|
||||
document.documentElement.setAttribute("data-bs-" + key, selectedValue);
|
||||
} else {
|
||||
document.documentElement.removeAttribute("data-bs-" + key);
|
||||
}
|
||||
}
|
||||
}));
|
||||
//# sourceMappingURL=tabler-theme.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue