提交 b514891b 编写于 作者: X xjh22222228

fix: Auto match dark mode

上级 0a1e29cc
......@@ -148,6 +148,11 @@ const nav = {
desc: 'Web Pentesting Fuzz 字典',
url: 'https://github.com/TheKingOfDuck/fuzzDicts',
},
{
name: 'BurpSuitePro',
desc: '免费的BurpSuitePro版本',
url: 'https://github.com/TrojanAZhen/BurpSuitePro-2.1',
},
]
},
{
......
......@@ -238,6 +238,12 @@ export function imgErrorInRemove(e) {
}
export function isDark(): boolean {
const isDark = Boolean(Number(window.localStorage.getItem('IS_DARK')))
return isDark
const storageVal = window.localStorage.getItem('IS_DARK')
const darkMode = window?.matchMedia?.('(prefers-color-scheme: dark)')?.matches
if (!storageVal && darkMode) {
return darkMode
}
return Boolean(Number(storageVal))
}
......@@ -9,6 +9,7 @@
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册