nfp_sites/nfp_moe/app/common.js
Jonatan Nilsson c949cde0df
Some checks failed
/ deploy (push) Failing after 2m43s
nfp.moe: Replace footer with day/night asuna chibi
2024-12-14 07:06:11 +00:00

14 lines
497 B
JavaScript

const DarkModeStorageName = 'nfp_sites_darkmode'
module.exports.darkIsOn = localStorage.getItem(DarkModeStorageName)
module.exports.toggleDarkMode = function() {
module.exports.darkIsOn = !module.exports.darkIsOn
if (this.darkIsOn) {
localStorage.setItem(DarkModeStorageName, true)
} else {
localStorage.removeItem(DarkModeStorageName)
}
document.body.className = (module.exports.darkIsOn ? 'nightmode ' : 'daymode ')
+ (window.supportsavif ? 'avifsupport' : 'jpegonly')
}