安全链接页面跟随主题显示暗黑或高亮模式

This commit is contained in:
mjsoftware 2025-03-14 13:28:51 +08:00
parent f4d4e69fdc
commit 691b702040
3 changed files with 34 additions and 16 deletions

View File

@ -1462,10 +1462,12 @@ spec:
validation: required validation: required
placeholder: '请输入使用“安全链接页面模版”创建的页面访问路径' placeholder: '请输入使用“安全链接页面模版”创建的页面访问路径'
help: '输入使用”安全链接页面模版“创建的页面访问路径,不能省略’/‘。' help: '输入使用”安全链接页面模版“创建的页面访问路径,不能省略’/‘。'
- $formkit: text - $formkit: code
name: security_link_tip_desc name: security_link_tip_desc
if: $get(enable_security_link).value if: $get(enable_security_link).value
label: 安全链接页面-提示区域文本描述 label: 安全链接页面-提示区域文本描述
language: html
height: 45px
placeholder: '请输入安全链接页面提示区域的文本描述' placeholder: '请输入安全链接页面提示区域的文本描述'
help: '输入安全链接页面提示区域的文本描述,留空使用默认文本描述。' help: '输入安全链接页面提示区域的文本描述,留空使用默认文本描述。'
- $formkit: number - $formkit: number
@ -1483,9 +1485,9 @@ spec:
label: 安全链接页面-跳转提示区域文本描述 label: 安全链接页面-跳转提示区域文本描述
language: html language: html
height: 45px height: 45px
value: '您即将离开<span>{title}</span>,去往:<span>{url}</span>' value: '您即将离开{title},去往:{url}'
placeholder: '请输入安全链接页面跳转提示区域的文本描述' placeholder: '请输入安全链接页面跳转提示区域的文本描述'
help: '"“ {title} ”表示站点主标题,“ {url} ”表示跳转URL区分大小写。默认值“您即将离开<span>{title}</span>,去往:<span>{url}</span>”' help: '"“ {title} ”表示站点主标题,“ {url} ”表示跳转URL区分大小写。默认值“您即将离开{title},去往:{url}”'
- group: pwa - group: pwa
label: 'PWA配置' label: 'PWA配置'
formSchema: formSchema:

View File

@ -28,18 +28,15 @@
background-position: center; background-position: center;
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
background-image: url([[${#strings.defaultString(theme.config.security_link_config.security_link_site_img_background, '')}]]);
} }
html.light body { html.light body {
background-color: #f6d365; background-image: linear-gradient(135deg, #ffffff 0%, #ebebeb 100%), url([[${#strings.defaultString(theme.config.security_link_config.security_link_site_img_background, '')}]]);
background-image: linear-gradient(135deg, #f6d365 0%, #fda085 100%), url([[${#strings.defaultString(theme.config.security_link_config.security_link_site_img_background, '')}]]);
background-blend-mode: overlay; background-blend-mode: overlay;
} }
html.dark body { html.dark body {
background-color: #434343; background-image: linear-gradient(135deg, #364f6b 0%, #222831 100%), url([[${#strings.defaultString(theme.config.security_link_config.security_link_site_img_background, '')}]]);
background-image: linear-gradient(135deg, #434343 0%, #000000 100%), url([[${#strings.defaultString(theme.config.security_link_config.security_link_site_img_background, '')}]]);
background-blend-mode: overlay; background-blend-mode: overlay;
} }
@ -58,10 +55,6 @@
-webkit-backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
} }
html.dark body {
background: linear-gradient(135deg, #434343 0%, #000000 100%);
}
html.dark .loading { html.dark .loading {
background: rgba(57, 62, 70, 0.6); background: rgba(57, 62, 70, 0.6);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
@ -130,7 +123,7 @@
/* 暗黑主题 */ /* 暗黑主题 */
html.dark body { html.dark body {
background: linear-gradient(135deg, #364f6b, #222831); /*background: linear-gradient(135deg, #364f6b, #222831);*/
} }
html.dark .loading { html.dark .loading {
@ -157,6 +150,13 @@
background-color: #444; background-color: #444;
} }
@media (max-width: 768px) {
.loading {
width: 75% !important;
max-width: 400px !important;
}
}
.loading { .loading {
text-align: center; text-align: center;
padding: 35px; padding: 35px;
@ -262,6 +262,8 @@
.content-title { .content-title {
margin-bottom: 20px; margin-bottom: 20px;
font-size: 20px;
font-weight: bold;
} }
.content-title img { .content-title img {
@ -350,8 +352,7 @@
th:text="${t1}"></span> th:text="${t1}"></span>
</div> </div>
<div class="others"> <div class="others">
<div class="others-tip"> <div class="others-tip" th:utext="${#strings.defaultString(theme.config.security_link_config.security_link_tip_desc, '请注意您的账号和财产安全!')}">
<span>[[${#strings.isEmpty(theme.config.security_link_config.security_link_tip_desc) ? '请注意您的账号和财产安全!': theme.config.security_link_config.security_link_tip_desc}]]</span>
</div> </div>
<div class="others-topic" th:with="oDesc = ${theme.config.security_link_config.security_link_jump_desc}, <div class="others-topic" th:with="oDesc = ${theme.config.security_link_config.security_link_jump_desc},
o1 = ${#strings.replace(oDesc, '{title}', site.title)}, o1 = ${#strings.replace(oDesc, '{title}', site.title)},
@ -386,6 +387,21 @@
document.querySelector('.progress-bar').style.display = 'none'; document.querySelector('.progress-bar').style.display = 'none';
document.querySelector('.countdown-text').style.display = 'none'; document.querySelector('.countdown-text').style.display = 'none';
} }
/** 配置主题模式 */
let default_theme = '[[${theme.config.basic_style.default_theme}]]';
const hasNightInLocal = () => localStorage.getItem('night') !== null;
const getNightInConfig = () => {
if (default_theme === 'night') {
return true;
}
if (default_theme === 'system') {
return matchMedia('(prefers-color-scheme: dark)').matches;
}
return false;
}
let isNight = hasNightInLocal() ? localStorage.getItem('night') : getNightInConfig();
document.documentElement.classList.add(isNight.toString() === 'true' ? 'dark' : 'light');
} }
</script> </script>
</body> </body>

View File

@ -30,7 +30,7 @@ spec:
settingName: theme-dream2-plus-setting settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap configMapName: theme-dream2-plus-configMap
# 版本号 # 版本号
version: 1.4.2.beta3 version: 1.4.2.beta4
# 最低支持的 Halo 版本 # 最低支持的 Halo 版本
require: ">=2.20.0" require: ">=2.20.0"
# 许可 # 许可