You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
dde0436fd9
This commit fixes the syntax and indentation of the JavaScript code to meet the organization standard.
23 lines
503 B
JavaScript
23 lines
503 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
|
|
} |