mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 18:59:40 +08:00
优化:
建站时间改为时间组件,支持选择到分钟; 灰色模式支持自定义时间段显示,使用时间组件选择开始和结束时间。
This commit is contained in:
parent
69e51e8959
commit
86039958e4
@ -46,11 +46,10 @@ spec:
|
|||||||
name: record_number_ps
|
name: record_number_ps
|
||||||
label: 公安部备案
|
label: 公安部备案
|
||||||
placeholder: 'X公网安备 XXXXXXXXXXXXXX号'
|
placeholder: 'X公网安备 XXXXXXXXXXXXXX号'
|
||||||
- $formkit: text
|
- $formkit: datetime-local
|
||||||
name: website_time
|
name: website_time
|
||||||
label: 建站时间
|
label: 建站时间
|
||||||
placeholder: 'YYYY/MM/dd HH:mm:ss'
|
help: '请选择建站时间,未选择时不显示。'
|
||||||
help: '按YYYY/MM/dd HH:mm:ss格式输入时间进行倒计时,非时间格式则直接显示文本。'
|
|
||||||
- $formkit: attachment
|
- $formkit: attachment
|
||||||
name: cloud_by_logo
|
name: cloud_by_logo
|
||||||
label: '云服务提供商 Logo'
|
label: '云服务提供商 Logo'
|
||||||
@ -1236,16 +1235,39 @@ spec:
|
|||||||
label: 黑暗模式
|
label: 黑暗模式
|
||||||
- value: all
|
- value: all
|
||||||
label: 全模式
|
label: 全模式
|
||||||
- $formkit: radio
|
- $formkit: group
|
||||||
name: enable_gray_mode
|
name: gray_mode_group
|
||||||
label: 灰色模式
|
label: 灰色模式
|
||||||
value: false
|
|
||||||
help: '向英雄致敬,愿精神长存!'
|
help: '向英雄致敬,愿精神长存!'
|
||||||
options:
|
value:
|
||||||
- value: true
|
enable_gray_mode: false
|
||||||
label: 开启
|
gray_mode_start_time:
|
||||||
- value: false
|
gray_mode_end_time:
|
||||||
label: 关闭
|
children:
|
||||||
|
- $formkit: radio
|
||||||
|
name: enable_gray_mode
|
||||||
|
id: enable_gray_mode
|
||||||
|
label: 开启灰色模式
|
||||||
|
options:
|
||||||
|
- value: true
|
||||||
|
label: 开启
|
||||||
|
- value: custom
|
||||||
|
label: 自定义
|
||||||
|
- value: false
|
||||||
|
label: 关闭
|
||||||
|
- $formkit: datetime-local
|
||||||
|
name: gray_mode_start_time
|
||||||
|
id: gray_mode_start_time
|
||||||
|
if: $get(enable_gray_mode).value === 'custom'
|
||||||
|
validation: required
|
||||||
|
help: 请选择开始时间,包含开始时间。
|
||||||
|
label: 灰色模式 - 开始时间
|
||||||
|
- $formkit: datetime-local
|
||||||
|
name: gray_mode_end_time
|
||||||
|
if: $get(enable_gray_mode).value === 'custom'
|
||||||
|
validation: required
|
||||||
|
help: 请选择结束时间,结束时间须大于开始时间,不包含结束时间。
|
||||||
|
label: 灰色模式 - 结束时间
|
||||||
- $formkit: radio
|
- $formkit: radio
|
||||||
name: enable_busuanzi
|
name: enable_busuanzi
|
||||||
label: 开启 busuanzi 访客统计
|
label: 开启 busuanzi 访客统计
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gray-mode {
|
||||||
|
filter: grayscale(1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
body > .footer, body > .navbar, body > .section {
|
body > .footer, body > .navbar, body > .section {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 0.3s ease-out, transform 0.3s ease-out;
|
transition: opacity 0.3s ease-out, transform 0.3s ease-out;
|
||||||
|
@ -385,8 +385,11 @@ const commonContext = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const websiteDate = document.getElementById('websiteDate')
|
const websiteDate = document.getElementById('websiteDate')
|
||||||
if (!/^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$/.test(DreamConfig.website_time)) {
|
// if (!/^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$/.test(DreamConfig.website_time)) {
|
||||||
websiteDate.innerText = DreamConfig.website_time
|
// websiteDate.innerText = DreamConfig.website_time
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
if (DreamConfig.website_time === '') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
@ -519,6 +522,19 @@ const commonContext = {
|
|||||||
})
|
})
|
||||||
$('.aside-timelife').html(htmlStr)
|
$('.aside-timelife').html(htmlStr)
|
||||||
},
|
},
|
||||||
|
/* 灰色模式 */
|
||||||
|
initGrayMode() {
|
||||||
|
if(DreamConfig.gray_mode === true) {
|
||||||
|
$('html').addClass('gray-mode')
|
||||||
|
} else if(DreamConfig.gray_mode === 'custom') {
|
||||||
|
var now = new Date().getTime()
|
||||||
|
var startTime = new Date(DreamConfig.gray_mode_start_time).getTime()
|
||||||
|
var endTime = new Date(DreamConfig.gray_mode_end_time).getTime()
|
||||||
|
if(now >= startTime && now <= endTime) {
|
||||||
|
$('html').addClass('gray-mode')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
/* 初始化评论区 */
|
/* 初始化评论区 */
|
||||||
initComment() {
|
initComment() {
|
||||||
if (!window.CommentWidget) {
|
if (!window.CommentWidget) {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
html {
|
html {
|
||||||
--theme: [(${theme.config.basic_style.theme_color})];
|
--theme: [(${theme.config.basic_style.theme_color})];
|
||||||
filter: [(${theme.config.enhance.enable_gray_mode ? 'grayscale(1) !important' : 'none'})];
|
/*filter: [(${theme.config.enhance.enable_gray_mode ? 'grayscale(1) !important' : 'none'})];*/
|
||||||
[(${theme.config.enhance.cursor_style == 'breeze' ? '--cursor-default:url(/themes/theme-dream/assets/cursor/breeze/Arrow.cur),auto;--cursor-pointer:url(/themes/theme-dream/assets/cursor/breeze/Hand.cur),pointer;--cursor-text:url(/themes/theme-dream/assets/cursor/breeze/IBeam.cur),auto;--cursor-zoom-in:url(/themes/theme-dream/assets/cursor/breeze/Cross.cur),zoom-in;'
|
[(${theme.config.enhance.cursor_style == 'breeze' ? '--cursor-default:url(/themes/theme-dream/assets/cursor/breeze/Arrow.cur),auto;--cursor-pointer:url(/themes/theme-dream/assets/cursor/breeze/Hand.cur),pointer;--cursor-text:url(/themes/theme-dream/assets/cursor/breeze/IBeam.cur),auto;--cursor-zoom-in:url(/themes/theme-dream/assets/cursor/breeze/Cross.cur),zoom-in;'
|
||||||
: theme.config.enhance.cursor_style == 'black_cat' ? '--cursor-default:url(/themes/theme-dream/assets/cursor/black_cat/normal.cur),auto;--cursor-pointer:url(/themes/theme-dream/assets/cursor/black_cat/ayuda.cur),pointer;--cursor-text:url(/themes/theme-dream/assets/cursor/black_cat/texto.cur),auto;--cursor-zoom-in:url(/themes/theme-dream/assets/cursor/black_cat/precision.cur),zoom-in;'
|
: theme.config.enhance.cursor_style == 'black_cat' ? '--cursor-default:url(/themes/theme-dream/assets/cursor/black_cat/normal.cur),auto;--cursor-pointer:url(/themes/theme-dream/assets/cursor/black_cat/ayuda.cur),pointer;--cursor-text:url(/themes/theme-dream/assets/cursor/black_cat/texto.cur),auto;--cursor-zoom-in:url(/themes/theme-dream/assets/cursor/black_cat/precision.cur),zoom-in;'
|
||||||
: theme.config.enhance.cursor_style == 'overwatch' ? '--cursor-default:url(/themes/theme-dream/assets/cursor/overwatch/pointer.cur),auto;--cursor-pointer:url(/themes/theme-dream/assets/cursor/overwatch/link.cur),pointer;--cursor-text:url(/themes/theme-dream/assets/cursor/overwatch/text.cur),auto;--cursor-zoom-in:url(/themes/theme-dream/assets/cursor/overwatch/cross.cur),zoom-in;'
|
: theme.config.enhance.cursor_style == 'overwatch' ? '--cursor-default:url(/themes/theme-dream/assets/cursor/overwatch/pointer.cur),auto;--cursor-pointer:url(/themes/theme-dream/assets/cursor/overwatch/link.cur),pointer;--cursor-text:url(/themes/theme-dream/assets/cursor/overwatch/text.cur),auto;--cursor-zoom-in:url(/themes/theme-dream/assets/cursor/overwatch/cross.cur),zoom-in;'
|
||||||
@ -72,6 +72,10 @@
|
|||||||
const DreamConfig = {};
|
const DreamConfig = {};
|
||||||
/** 站点名 */
|
/** 站点名 */
|
||||||
DreamConfig["site_title"] = [[${site.title}]];
|
DreamConfig["site_title"] = [[${site.title}]];
|
||||||
|
/** 灰色模式 */
|
||||||
|
DreamConfig["gray_mode"] = [[${theme.config.enhance.gray_mode_group.enable_gray_mode}]];
|
||||||
|
DreamConfig["gray_mode_start_time"] = [[${theme.config.enhance.gray_mode_group.gray_mode_start_time}]];
|
||||||
|
DreamConfig["gray_mode_end_time"] = [[${theme.config.enhance.gray_mode_group.gray_mode_end_time}]];
|
||||||
/** 配置分享方式 */
|
/** 配置分享方式 */
|
||||||
let post_share = []
|
let post_share = []
|
||||||
for (let share of [[${theme.config.post.custom_post_share}]]) {
|
for (let share of [[${theme.config.post.custom_post_share}]]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user