mirror of
https://github.com/khairul169/honey.git
synced 2025-04-28 23:09:32 +07:00
27 lines
698 B
JavaScript
27 lines
698 B
JavaScript
const CL = document.body.classList
|
|
|
|
export function onThemeChange(config) {
|
|
let isDark = config.get("dark_mode")
|
|
isDark ? CL.add("dark") : CL.remove("dark")
|
|
}
|
|
|
|
export function onNewTabChange(config) {
|
|
let openNewTab = config.get("open_new_tab")
|
|
let appList = document.querySelector("#app-list").children
|
|
|
|
for (let app of appList) {
|
|
if (openNewTab) app.setAttribute("target", "_blank")
|
|
else app.removeAttribute("target")
|
|
}
|
|
}
|
|
|
|
export function onBlurChange(config) {
|
|
let blur = config.get("blur")
|
|
blur ? CL.remove("noblur") : CL.add("noblur")
|
|
}
|
|
|
|
export function onAnimationChange(config) {
|
|
let animations = config.get("animations")
|
|
animations ? CL.remove("noanim") : CL.add("noanim")
|
|
}
|