You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
23 lines
510 B
JavaScript
23 lines
510 B
JavaScript
import { setDark } from "./themes/dark.js"
|
|
import { setLight } from "./themes/light.js"
|
|
|
|
const button = document.getElementById('theme_switcher')
|
|
|
|
let sys_theme = localStorage.getItem('/system/theme')
|
|
if (!sys_theme) sys_theme = setData('dark')
|
|
|
|
if (sys_theme === 'light') {
|
|
button.setAttribute('checked', '')
|
|
setLight()
|
|
}
|
|
|
|
button.addEventListener('click', () => {
|
|
button.checked
|
|
? setLight()
|
|
: setDark()
|
|
})
|
|
|
|
function setData(mode) {
|
|
localStorage.setItem('/system/theme', mode)
|
|
return mode
|
|
} |