mirror of
https://github.com/TheGreyDiamond/elevatormapRewritten.git
synced 2025-07-19 19:13:49 +02:00
Inital commit
This commit is contained in:
24
static/js/site.js
Normal file
24
static/js/site.js
Normal file
@ -0,0 +1,24 @@
|
||||
function toggleTheme() {
|
||||
|
||||
var prettifyDark = document.getElementById('prettify-dark')
|
||||
var sheets = document.styleSheets
|
||||
|
||||
// temporariily set transition class on html element
|
||||
//document.documentElement.classList.add('transition-theme')
|
||||
|
||||
// change data-theme
|
||||
//if (target.classList.contains('darkTheme')) {
|
||||
document.documentElement.setAttribute("data-theme", "dark")
|
||||
//prettifyDark.removeAttribute('disabled')
|
||||
//prettifyDark.disabled = false
|
||||
/*} else {
|
||||
document.documentElement.removeAttribute("data-theme", "dark")
|
||||
prettifyDark.disabled = true
|
||||
}*/
|
||||
|
||||
// remove transition class
|
||||
window.setTimeout(function() {
|
||||
document.documentElement.classList.remove('transition-theme')
|
||||
}, 1000)
|
||||
|
||||
}
|
Reference in New Issue
Block a user