Site updated: 2024-06-05 00:10:01
This commit is contained in:
parent
f3f731e8c1
commit
d10b6ebf96
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
31
index.html
31
index.html
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -48,7 +48,7 @@
|
||||||
toc: true,
|
toc: true,
|
||||||
rightside: true,
|
rightside: true,
|
||||||
},
|
},
|
||||||
autoDarkmode: false
|
autoDarkmode: true
|
||||||
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
||||||
title: 'Blog终于弄好了',
|
title: 'Blog终于弄好了',
|
||||||
isPost: true,
|
isPost: true,
|
||||||
|
@ -134,9 +134,28 @@
|
||||||
}
|
}
|
||||||
const t = saveToLocal.get('theme')
|
const t = saveToLocal.get('theme')
|
||||||
|
|
||||||
if (t === 'dark') activateDarkMode()
|
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||||
else if (t === 'light') activateLightMode()
|
const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
|
||||||
|
const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
|
||||||
|
const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
|
||||||
|
|
||||||
|
if (t === undefined) {
|
||||||
|
if (isLightMode) activateLightMode()
|
||||||
|
else if (isDarkMode) activateDarkMode()
|
||||||
|
else if (isNotSpecified || hasNoSupport) {
|
||||||
|
const now = new Date()
|
||||||
|
const hour = now.getHours()
|
||||||
|
const isNight = hour <= 6 || hour >= 18
|
||||||
|
isNight ? activateDarkMode() : activateLightMode()
|
||||||
|
}
|
||||||
|
window.matchMedia('(prefers-color-scheme: dark)').addListener(e => {
|
||||||
|
if (saveToLocal.get('theme') === undefined) {
|
||||||
|
e.matches ? activateDarkMode() : activateLightMode()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (t === 'light') activateLightMode()
|
||||||
|
else activateDarkMode()
|
||||||
|
|
||||||
const detectApple = () => {
|
const detectApple = () => {
|
||||||
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||||
document.documentElement.classList.add('apple')
|
document.documentElement.classList.add('apple')
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
toc: true,
|
toc: true,
|
||||||
rightside: true,
|
rightside: true,
|
||||||
},
|
},
|
||||||
autoDarkmode: false
|
autoDarkmode: true
|
||||||
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
||||||
title: '让Geyser用上外置登录(使用Authlib-Injector)',
|
title: '让Geyser用上外置登录(使用Authlib-Injector)',
|
||||||
isPost: true,
|
isPost: true,
|
||||||
|
@ -134,9 +134,28 @@
|
||||||
}
|
}
|
||||||
const t = saveToLocal.get('theme')
|
const t = saveToLocal.get('theme')
|
||||||
|
|
||||||
if (t === 'dark') activateDarkMode()
|
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||||
else if (t === 'light') activateLightMode()
|
const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
|
||||||
|
const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
|
||||||
|
const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
|
||||||
|
|
||||||
|
if (t === undefined) {
|
||||||
|
if (isLightMode) activateLightMode()
|
||||||
|
else if (isDarkMode) activateDarkMode()
|
||||||
|
else if (isNotSpecified || hasNoSupport) {
|
||||||
|
const now = new Date()
|
||||||
|
const hour = now.getHours()
|
||||||
|
const isNight = hour <= 6 || hour >= 18
|
||||||
|
isNight ? activateDarkMode() : activateLightMode()
|
||||||
|
}
|
||||||
|
window.matchMedia('(prefers-color-scheme: dark)').addListener(e => {
|
||||||
|
if (saveToLocal.get('theme') === undefined) {
|
||||||
|
e.matches ? activateDarkMode() : activateLightMode()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (t === 'light') activateLightMode()
|
||||||
|
else activateDarkMode()
|
||||||
|
|
||||||
const detectApple = () => {
|
const detectApple = () => {
|
||||||
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||||
document.documentElement.classList.add('apple')
|
document.documentElement.classList.add('apple')
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
toc: true,
|
toc: true,
|
||||||
rightside: true,
|
rightside: true,
|
||||||
},
|
},
|
||||||
autoDarkmode: false
|
autoDarkmode: true
|
||||||
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
||||||
title: '御三家启动器外置使用教程(PCL2、HMCL、BakaXL)',
|
title: '御三家启动器外置使用教程(PCL2、HMCL、BakaXL)',
|
||||||
isPost: true,
|
isPost: true,
|
||||||
|
@ -134,9 +134,28 @@
|
||||||
}
|
}
|
||||||
const t = saveToLocal.get('theme')
|
const t = saveToLocal.get('theme')
|
||||||
|
|
||||||
if (t === 'dark') activateDarkMode()
|
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||||
else if (t === 'light') activateLightMode()
|
const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
|
||||||
|
const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
|
||||||
|
const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
|
||||||
|
|
||||||
|
if (t === undefined) {
|
||||||
|
if (isLightMode) activateLightMode()
|
||||||
|
else if (isDarkMode) activateDarkMode()
|
||||||
|
else if (isNotSpecified || hasNoSupport) {
|
||||||
|
const now = new Date()
|
||||||
|
const hour = now.getHours()
|
||||||
|
const isNight = hour <= 6 || hour >= 18
|
||||||
|
isNight ? activateDarkMode() : activateLightMode()
|
||||||
|
}
|
||||||
|
window.matchMedia('(prefers-color-scheme: dark)').addListener(e => {
|
||||||
|
if (saveToLocal.get('theme') === undefined) {
|
||||||
|
e.matches ? activateDarkMode() : activateLightMode()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (t === 'light') activateLightMode()
|
||||||
|
else activateDarkMode()
|
||||||
|
|
||||||
const detectApple = () => {
|
const detectApple = () => {
|
||||||
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||||
document.documentElement.classList.add('apple')
|
document.documentElement.classList.add('apple')
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user