Merge branch 'liuzhihang:main' into main

This commit is contained in:
石头君 2023-08-04 15:57:12 +08:00 committed by GitHub
commit f4fc8d037f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 23 deletions

View File

@ -15,10 +15,7 @@
<!-- 快捷导航 -->
<p align="center">
[主题预览](#-预览) |
[快速上手](#-安装) |
[使用文档](https://docs.liuzhihang.com) |
[加入我们](#-讨论)
[主题预览](#-预览) | [快速上手](#-安装) | [使用文档](https://docs.liuzhihang.com) | [加入我们](#-讨论)
</p>
</div>

View File

@ -1052,7 +1052,7 @@ spec:
label: 页脚友链
value:
enable_footer_group:
fetchUrl:
num:
children:
- $formkit: radio
name: enable_footer_group
@ -1064,6 +1064,12 @@ spec:
value: true
- label: 禁用
value: false
- $formkit: number
if: $get(enable_footer_group).value
name: num
label: 友链数
value: 3
validation: required
- $formkit: group
name: footerContent
label: 页脚内容

View File

@ -57,7 +57,7 @@
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
justify-content: space-between;
margin: var(--album-spacing-xxl) 0 0
}

View File

@ -139,7 +139,8 @@ var heo = {
addFriendLinksInFooter: function () {
const linksUrl = GLOBAL_CONFIG.source.links.linksUrl
const links = GLOBAL_CONFIG.source.links.linksData
var randomFriendLinks = getArrayItems(links, 3);
const num = GLOBAL_CONFIG.source.links.linksNum
var randomFriendLinks = getArrayItems(links, num);
var htmlText = '';
for (let i = 0; i < randomFriendLinks.length; ++i) {
var item = randomFriendLinks[i]

View File

@ -38,25 +38,11 @@
t = Math.trunc(234e8 + (now - grt) / 1e3 * 17)
n = (t / 1496e5).toFixed(6)
}
// 更新网页中显示的网站运行时间
function updateHtml() {
const footer = document.getElementById("footer");
if (!footer) return
let currentTimeHtml = "";
if (nowHour < 18 && nowHour >= 9) {
// 如果是上班时间,默认就是"困困鱼-上班摸鱼中.svg"图片,不需要更改
currentTimeHtml = `本站居然运行了 ${dnum} 天<span id='runtime'> ${hnum} 小时 ${mnum} 分 ${snum} 秒 </span><i class='haofont hao-icon-heartbeat' style='color:red'></i> <br> 旅行者 1 号当前距离地球 ${t} 千米,约为 ${n} 个天文单位 🚀`;
} else {
// 如果是下班时间,插入"困困鱼-下班啦.svg"图片
let img = document.querySelector("#workboard .workSituationImg");
img.src = "[[${theme.config.footer.footerContent.style_one.offduty_img}]]";
img.title = "[[${theme.config.footer.footerContent.style_one.offduty_description}]]";
img.alt = "[[${theme.config.footer.footerContent.style_one.offduty_description}]]";
currentTimeHtml = `本站居然运行了 ${dnum} 天<span id='runtime'> ${hnum} 小时 ${mnum} 分 ${snum} 秒 </span><i class='haofont hao-icon-heartbeat' style='color:red'></i> <br> 旅行者 1 号当前距离地球 ${t} 千米,约为 ${n} 个天文单位 🚀`;
}
let currentTimeHtml = `本站居然运行了 ${dnum} 天<span id='runtime'> ${hnum} 小时 ${mnum} 分 ${snum} 秒 </span><i class='haofont hao-icon-heartbeat' style='color:red'></i> <br> 旅行者 1 号当前距离地球 ${t} 千米,约为 ${n} 个天文单位 🚀`;
if (document.getElementById("runtimeTextTip")) {
document.getElementById("runtimeTextTip").innerHTML = currentTimeHtml;
}
@ -66,6 +52,15 @@
updateTime();
updateHtml();
}, 1000);
setTimeout(()=>{
if (!(nowHour < 18 && nowHour >= 9)) {
// 如果是下班时间,插入"困困鱼-下班啦.svg"图片
let img = document.querySelector("#workboard .workSituationImg");
img.src = "[[${theme.config.footer.footerContent.style_one.offduty_img}]]";
img.title = "[[${theme.config.footer.footerContent.style_one.offduty_description}]]";
img.alt = "[[${theme.config.footer.footerContent.style_one.offduty_description}]]";
}
},1100)
})();</script>
</th:block>

View File

@ -211,7 +211,8 @@
source: {
links: {
linksUrl: [[${ theme.config.link.linksUrl }]],
linksData: []
linksData: [],
linksNum: [[${theme.config.footer.footer_group.num}]],
},
jQuery: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js',
justifiedGallery: {