Merge pull request #354 from Roozenlz/main

添加动态视频壁纸可选项
This commit is contained in:
Roozen 2023-08-02 19:44:07 +08:00 committed by GitHub
commit 06326d5c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 5 deletions

View File

@ -83,8 +83,10 @@ spec:
value:
enable_above:
typed:
enable_above_video:
index_img:
phone_index_img:
index_video:
children:
- $formkit: radio
name: enable_above
@ -106,12 +108,30 @@ spec:
name: text
label: 文字
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
name: index_img
if: $get(enable_above).value
label: PC背景图
placeholder: 请填写背景图地址
value: https://rp.realxlfd.cloud/alist
value: https://www.dmoe.cc/random.php
- $formkit: attachment
name: phone_index_img
if: $get(enable_above).value

View File

@ -4,9 +4,18 @@
<th:block th:fragment="index-img">
<th:block th:if="${theme.config.top.above.enable_above}">
<div class="pl-container">
<div class="pl-img pl-blur pl-visible"></div>
<div class="pl-img pl-visible"></div>
<video class="video"></video>
<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-visible"></div>
<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 id="site-info">
@ -236,7 +245,7 @@
fetch("https://v1.hitokoto.cn").then((t => t.json())).then((t => {
{
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;
});
n.unshift(t.hitokoto, e), window.typed = new Typed("#subtitle", {