添加动态视频壁纸可选项

This commit is contained in:
roozen 2023-08-02 19:11:43 +08:00
parent 93f6c21b09
commit c1ea954e1b
2 changed files with 34 additions and 5 deletions

View File

@ -83,8 +83,10 @@ spec:
value: value:
enable_above: enable_above:
typed: typed:
enable_above_video:
index_img: index_img:
phone_index_img: phone_index_img:
index_video:
children: children:
- $formkit: radio - $formkit: radio
name: enable_above name: enable_above
@ -106,12 +108,30 @@ spec:
name: text name: text
label: 文字 label: 文字
placeholder: 请输入文字 placeholder: 请输入文字
- $formkit: radio
if: $get(enable_above).value
name: enable_above_video
key: enable_above_video
id: enable_above_video
value: false
options:
- label: 显示视频
value: true
- label: 显示图片
value: false
- $formkit: attachment
name: index_video
if: $get(enable_above).value
label: 动态壁纸
placeholder: 请填写动态壁纸地址
value:
help: http(s)://xxx.mp4
- $formkit: attachment - $formkit: attachment
name: index_img name: index_img
if: $get(enable_above).value if: $get(enable_above).value
label: PC背景图 label: PC背景图
placeholder: 请填写背景图地址 placeholder: 请填写背景图地址
value: https://rp.realxlfd.cloud/alist value: https://www.dmoe.cc/random.php
- $formkit: attachment - $formkit: attachment
name: phone_index_img name: phone_index_img
if: $get(enable_above).value if: $get(enable_above).value

View File

@ -4,9 +4,18 @@
<th:block th:fragment="index-img"> <th:block th:fragment="index-img">
<th:block th:if="${theme.config.top.above.enable_above}"> <th:block th:if="${theme.config.top.above.enable_above}">
<div class="pl-container"> <div class="pl-container">
<th:block th:if="!${theme.config.top.above.enable_above_video}">
<div class="pl-img pl-blur pl-visible"></div> <div class="pl-img pl-blur pl-visible"></div>
<div class="pl-img pl-visible"></div> <div class="pl-img pl-visible"></div>
<video class="video"></video> <video class="video"></video>
</th:block>
<th:block th:if="${theme.config.top.above.enable_above_video}">
<video class="index-video" id="index-video" autoplay=""
th:src="${theme.config.top.above.index_video}" loop="" muted="" playsinline=""
webkit-playsinline=""
style="display:block;object-fit:cover;width:100%;height:100%;pointer-events:none;">
</video>
</th:block>
</div> </div>
<div id="site-info"> <div id="site-info">
@ -236,7 +245,7 @@
fetch("https://v1.hitokoto.cn").then((t => t.json())).then((t => { fetch("https://v1.hitokoto.cn").then((t => t.json())).then((t => {
{ {
const e = "出自 " + t.from; const e = "出自 " + t.from;
const n = [[${theme.config.top.above.typed}]].map((item)=>{ const n = [[${theme.config.top.above.typed}]].map((item) => {
return item.realNode.text; return item.realNode.text;
}); });
n.unshift(t.hitokoto, e), window.typed = new Typed("#subtitle", { n.unshift(t.hitokoto, e), window.typed = new Typed("#subtitle", {