dark
This commit is contained in:
parent
eec7f6adc0
commit
7decae3625
3 changed files with 14 additions and 3 deletions
7
test.js
7
test.js
|
@ -6,16 +6,13 @@ function check(tab) {
|
|||
document.getElementById(path).checked = true
|
||||
}
|
||||
}
|
||||
|
||||
function push(tab) {
|
||||
window.history.pushState(null, null, `?tab=${tab}`)
|
||||
}
|
||||
|
||||
function update(id) {
|
||||
const tab = id.split('/').slice(1).join('/')
|
||||
push(tab)
|
||||
}
|
||||
|
||||
function main() {
|
||||
let tab = (new URL(document.location)).searchParams.get('tab')
|
||||
if (tab) {
|
||||
|
@ -26,3 +23,7 @@ function main() {
|
|||
push(tab)
|
||||
}
|
||||
}
|
||||
|
||||
function swap() {
|
||||
document.body.classList.toggle('dark')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue