更新软件默认使用的字体

This commit is contained in:
lyswhut
2024-11-26 18:03:52 +08:00
parent 7ebfd43f65
commit 4e1510c840
16 changed files with 140 additions and 23 deletions
+10
View File
@@ -8,6 +8,16 @@
<body id="body" style="background-color: transparent;">
<div id="root"></div>
<script>
const formatLang = (lang = 'en') => {
if (lang === 'zh-cn') return 'zh-Hans'
if (lang === 'zh-tw') return 'zh-Hant'
return lang.split('-')[0]
}
window.setLang = (lang = navigator.language.toLocaleLowerCase()) => {
document.documentElement.setAttribute('lang', formatLang(lang))
}
window.setLang()
document.documentElement.classList.add(/os=(\w+)/.exec(window.location.search)[1])
window.dom_style_theme = document.createElement('style')
window.dom_style_lyric = document.createElement('style')