Merge branch 'liuzhihang:main' into main

This commit is contained in:
Nonoas 2024-01-06 11:19:16 +08:00 committed by GitHub
commit 12a3e8b57c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 190 additions and 280 deletions

View File

@ -1,6 +1,6 @@
{
"name": "halo-theme-hao",
"version": "1.4.5",
"version": "1.4.6",
"dependencies": {
}
}

View File

@ -1489,24 +1489,6 @@ spec:
value: true
- label: 禁用
value: false
- $formkit: radio
name: qq_edit
help: 启用分享到QQ
value: true
options:
- label: 启用
value: true
- label: 禁用
value: false
- $formkit: radio
name: wechat_edit
help: 启用分享到微信朋友圈
value: true
options:
- label: 启用
value: true
- label: 禁用
value: false
- $formkit: group
name: copyrights
label: 版权声明

View File

@ -9,19 +9,19 @@
_type = 'website')}"></th:block>
</th:block>
<th:block th:fragment="content">
<div class="page" id="body-wrap">
<!-- 头部导航栏 -->
<header class="not-top-img" id="page-header">
<nav th:replace="~{modules/nav :: nav(title = ${singlePage.spec.title})}"></nav>
</header>
<main class="layout hide-aside" id="content-inner">
<div id="page">
<div id="about-page">
<div class="author-info">
<div class="author-tag-left"
th:if="${not #lists.isEmpty(theme.config.about.authorInfoLeftTags)}"
@ -41,24 +41,26 @@
</div>
</div>
<div class="author-title" th:text="${singlePage.spec.title}"></div>
<th:block th:replace="~{modules/about-widgets :: about-widgets(${theme.config.about.widgetList})}"></th:block>
<th:block
th:replace="~{modules/about-widgets :: about-widgets(${theme.config.about.widgetList})}"></th:block>
<div class="author-content">
<div class="create-site-post author-content-item single" th:utext="${theme.config.about.xjlc}">
</div>
</div>
<th:block th:replace="~{modules/widgets/about-widgets/tenyear}"></th:block>
<th:block th:replace="~{modules/widgets/about-widgets/about-reward}"></th:block>
<th:block th:replace="~{modules/widgets/about-widgets/tenyear}"></th:block>
<th:block th:replace="~{modules/widgets/about-widgets/about-reward}"></th:block>
</div>
<th:block th:if="${theme.config.about.tenyear.tenyear_enable}">
<link rel="stylesheet" th:href="${assets_link + '/css/tenyear.css' + theme_version}" media="all" onload="this.media='all'">
<link rel="stylesheet" th:href="${assets_link + '/css/tenyear.css' + theme_version}" media="all"
onload="this.media='all'">
<script> (() => {
const t = document.querySelector(".progress"),
const t = document.querySelector(".progress"),
n = document.querySelector(".past-time"),
o = document.querySelector(".percentage-label"),
r = document.querySelector(".start-time"),
@ -66,17 +68,18 @@
a = new Date("[(${theme.config.about.tenyear.start_time})]").getTime(),
i = new Date("[(${theme.config.about.tenyear.end_time})]").getTime(),
c = ((new Date).getTime() - a) / (i - a) * 100,
u = c <= 100 ? c + "%" : "100%";
n.style.setProperty("--past-time-percentage", c + "%"), t.style.setProperty("--progress-percentage", u), o.textContent = c.toFixed(0) + "%", o.style.left = `calc(${c}% - 33px)`, r.textContent = "" + new Date(a).toLocaleDateString(), s.textContent = "" + new Date(i).toLocaleDateString(), setTimeout(() => {
o.style.visibility = "visible"
}, 2500);
})()
u = c <= 100 ? c + "%" : "100%",
m = c <= 100 ? c.toFixed(0) + "%" : "已达标 ";
n.style.setProperty("--past-time-percentage", c + "%"), t.style.setProperty("--progress-percentage", u), o.textContent = m, o.style.left = `calc(${c}% - 3rem)`, r.textContent = "" + new Date(a).toLocaleDateString(), s.textContent = "" + new Date(i).toLocaleDateString(), setTimeout(() => {
o.style.visibility = "visible"
}, 2500);
})()
</script>
</th:block>
</div>
</main>
<!-- 底部 -->
<footer th:replace="~{modules/footer}"/>

View File

@ -2,7 +2,7 @@
if (!document.getElementById('post-comment')) return
const initArtalk = () => {
window.artalkItem = new Artalk(Object.assign({
window.artalkItem = Artalk.init(Object.assign({
el: '#artalk-wrap',
server: GLOBAL_CONFIG.source.artalk.artalkUrl,
site: GLOBAL_CONFIG.source.artalk.siteName,
@ -12,7 +12,7 @@
}, null))
if (GLOBAL_CONFIG.lightbox === 'null') return
window.artalkItem.use(ctx => {
Artalk.use(ctx => {
ctx.on('list-loaded', () => {
ctx.getCommentList().forEach(comment => {
const $content = comment.getRender().$content

View File

@ -380,7 +380,7 @@ let halo = {
if (values.length === 0) {
powerStar.href = GLOBAL_CONFIG.source.power.powerLink
powerStar.innerHTML = `
<div id="power-star-image" style="background-image: url('https://redirect.cnkj.site:8099/b/2023/6583b34d95d08.webp?type=blog')">
<div id="power-star-image" style="background-image: url('/themes/theme-hao/assets/images/afadian/afadian.webp')">
</div>
<div class="power-star-body">
<div id="power-star-title">还没有人赞助</div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -262,54 +262,6 @@ rm.sharePage = function () {
rm.hideRightMenu();
}
function isMobileDevice() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
rm.shareToQQ = function () {
var url = /*[[${post.status.permalink}]]*/ window.location.href;
var title = $('#post-info .post-title')[0].innerText;
if (isMobileDevice()) {
// 使用手机分享方式
window.location.href = "mqqapi://share/to_fri?src_type=web&version=1&file_type=news&url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title) + "&callback_type=scheme&generalpastboard=1";
} else {
// 使用Web分享方式
window.open("https://connect.qq.com/widget/shareqq/index.html?url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title));
}
btf.snackbarShow('分享链接地址成功', false, 2000);
rm.hideRightMenu();
}
rm.shareToWechat = function () {
// 手机分享逻辑
if (isMobileDevice) {
wx.config({
// 配置微信的appID、timestamp、nonceStr、signature等参数
// ...
debug: false,
jsApiList: ['onMenuShareTimeline'] // 需要使用的微信接口
});
wx.ready(function () {
wx.onMenuShareTimeline({
title: $('#post-info .post-title')[0].innerText,
link: window.location.href,
imgUrl: $('#coverdiv img')[0].src,
success: function () {
btf.snackbarShow('分享链接地址成功', false, 2000);
rm.hideRightMenu();
},
cancel: function () {
btf.snackbarShow('分享链接地址失败', false, 2000);
rm.hideRightMenu();
}
});
});
}
}
// 复制当前选中文本
var selectTextNow = '';
document.onmouseup = document.ondbclick = selceText;

View File

@ -163,8 +163,6 @@
<!-- 复制 https://githubfast.com/zenorocha/clipboard.js -->
<script th:src="${assets_link + '/libs/clipboard/clipboard.min.js'}"></script>
<script th:if="${theme.config.post.share_right.wechat_edit}" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- 关于统计-->
<script th:if="${#strings.contains(theme.config.about.widgetList,'statistics-map')}" th:src="${assets_link + '/libs/countup/countup.js'}"></script>

View File

@ -1,7 +1,7 @@
<th:block
th:with='postItems=${posts.items},
th:with='postItems=${posts.items},
postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg+"&" : theme.config.layout.postRandomImg+"?"}'>
<!-- card需要添加在没有图片时使用随机图片 -->
<div class="recent-post-item"
th:classappend="${theme.config.layout.post.cols} + ' ' +
@ -41,14 +41,6 @@
<div class="content" th:text="${post.status.excerpt}"></div>
</div>
<div class="dateshow">
<i class="haofont hao-icon-calendar-alt dateshowicon"></i>
<span class="banner-button-text" th:text="发表于 + '&nbsp;' + ${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"></span>
&nbsp;&nbsp;
<i class="haofont hao-icon-history dateshowicon"></i>
<span class="banner-button-text" th:text="更新于 + '&nbsp;' + ${#dates.format(post.status.lastModifyTime,'yyyy-MM-dd')}"></span>
</div>
<div class="article-meta-wrap">
<!-- tag -->
<th:block th:if="${not #lists.isEmpty(post.tags)}">
@ -85,8 +77,9 @@
</time>
</span>
</div>
</div>
<!-- 文章卡片擦亮效果 -->
<style th:if="${theme.config.layout.articleCardPolish}">
#recent-posts > .recent-post-item:not(a)::before {
@ -101,35 +94,13 @@
transition: transform 0.5s linear;
z-index: 1;
}
#recent-posts > .recent-post-item:not(a):hover::before {
transform: translateX(100%) skewX(-60deg);
}
</style>
<style>
.dateshow {
position: absolute;
bottom: 55px;
transition: 0.3s;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
width: 100%;
left: 0;
padding: 0 32px;
white-space: nowrap;
}
i.haofont.hao-icon-calendar-alt.dateshowicon {
font-size: 20px;
margin-top: 6px;
}
i.haofont.hao-icon-history.dateshowicon {
font-size: 20px;
margin-top: 6px;
}
</style>
</div>
<!-- 分页 -->
<div th:replace="~{modules/widgets/page :: page('',${posts},true,'')}"></div>

View File

@ -61,16 +61,6 @@
<div class="share-button" id="post-share-url" onclick="rm.copyPageUrl()" title="复制链接"><i
class="haofont hao-icon-link"></i></div>
</div>
<div class="share-link weibo" th:if="${theme.config.post.share_right.qq_edit}">
<div class="share-button" id="post-share-url-qq" onclick="rm.shareToQQ()" title="分享到QQ">
<i class="haofont hao-icon-qq" style="font-size:19px"></i>
</div>
</div>
<div class="share-link weibo" th:if="${theme.config.post.share_right.wechat_edit}">
<div class="share-button" id="post-share-url-wechat" onclick="rm.shareToWechat()" title="分享到微信朋友圈">
<i class="haofont hao-icon-weixin" style="font-size:22px"></i>
</div>
</div>
</div>
<div class="post-tools-right">
<div class="tag_share">

View File

@ -67,16 +67,6 @@
<div class="share-button" id="post-share-url" onclick="rm.copyPageUrl()" title="复制链接"><i
class="haofont hao-icon-link"></i></div>
</div>
<div class="share-link weibo" th:if="${theme.config.post.share_right.qq_edit}">
<div class="share-button" id="post-share-url-qq" onclick="rm.shareToQQ()" title="分享到QQ">
<i class="haofont hao-icon-qq" style="font-size:19px"></i>
</div>
</div>
<div class="share-link weibo" th:if="${theme.config.post.share_right.wechat_edit}">
<div class="share-button" id="post-share-url-wechat" onclick="rm.shareToWechat()" title="分享到微信朋友圈">
<i class="haofont hao-icon-weixin" style="font-size:22px"></i>
</div>
</div>
</div>
</div>
</div>

View File

@ -61,7 +61,7 @@
</th:block>
<span class="sidebar-menu-item-title">标签</span>
<div class="card-widget card-tags card-archives card-webinfo card-allinfo"
th:with="tags = ${tagFinder.listAll()}">
th:with="tags = ${tagFinder.listAll()}, tagQuantity = ${#conversions.convert(theme.config.sidebar.tagQuantity, 'java.lang.Integer')}">
<div class="item-headline"></div>
<div class="card-tag-cloud">
<a class="tag-item" style="font-size:1em" th:each="tag,iterStat : ${tags}"

View File

@ -1,11 +1,11 @@
<div class="author-content" th:if="${theme.config.aboutReward.aboutRewardEnable}">
<div class="author-content-item single reward" id="about-reward">
<div class="author-content-item-tips">致谢</div>
<span class="author-content-item-title" >[[${theme.config.aboutReward.title}]]</span>
<div class="author-content-item-description" >
<span class="author-content-item-title">[[${theme.config.aboutReward.title}]]</span>
<div class="author-content-item-description">
[[${theme.config.aboutReward.content}]]
</div>
<div th:if="${theme.config.aboutReward.reward.enable_reward}" class="about-reward">
<div id="con"></div>
<div id="TA-con" onclick="heo.rewardShowConsole()">
@ -14,57 +14,63 @@
<div id="TA">[[${theme.config.aboutReward.reward.name}]]</div>
</div>
</div>
<div id="tube-con"><svg viewBox="0 0 1028 385" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 77H234.226L307.006 24H790" stroke="#e5e9ef" stroke-width="20"></path>
<path d="M0 140H233.035L329.72 71H1028" stroke="#e5e9ef" stroke-width="20"></path>
<path d="M1 255H234.226L307.006 307H790" stroke="#e5e9ef" stroke-width="20"></path>
<path d="M0 305H233.035L329.72 375H1028" stroke="#e5e9ef" stroke-width="20"></path>
<rect y="186" width="236" height="24" fill="#e5e9ef"></rect>
<ellipse cx="790" cy="25.5" rx="25" ry="25.5" fill="#e5e9ef"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 25)" fill="white"></circle>
<ellipse cx="790" cy="307.5" rx="25" ry="25.5" fill="#e5e9ef"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 308)" fill="white"></circle>
</svg>
<div id="mask"><svg viewBox="0 0 1028 385" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 77H234.226L307.006 24H790" stroke="#f25d8e" stroke-width="20"></path>
<path d="M0 140H233.035L329.72 71H1028" stroke="#f25d8e" stroke-width="20"></path>
<path d="M1 255H234.226L307.006 307H790" stroke="#f25d8e" stroke-width="20"></path>
<path d="M0 305H233.035L329.72 375H1028" stroke="#f25d8e" stroke-width="20"></path>
<rect y="186" width="236" height="24" fill="#f25d8e"></rect>
<ellipse cx="790" cy="25.5" rx="25" ry="25.5" fill="#f25d8e"></ellipse>
<div id="tube-con">
<svg viewBox="0 0 1028 385" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 77H234.226L307.006 24H790" stroke="#e5e9ef" stroke-width="20"></path>
<path d="M0 140H233.035L329.72 71H1028" stroke="#e5e9ef" stroke-width="20"></path>
<path d="M1 255H234.226L307.006 307H790" stroke="#e5e9ef" stroke-width="20"></path>
<path d="M0 305H233.035L329.72 375H1028" stroke="#e5e9ef" stroke-width="20"></path>
<rect y="186" width="236" height="24" fill="#e5e9ef"></rect>
<ellipse cx="790" cy="25.5" rx="25" ry="25.5" fill="#e5e9ef"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 25)" fill="white"></circle>
<ellipse cx="790" cy="307.5" rx="25" ry="25.5" fill="#f25d8e"></ellipse>
<ellipse cx="790" cy="307.5" rx="25" ry="25.5" fill="#e5e9ef"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 308)" fill="white"></circle>
</svg></div>
<div id="orange-mask"><svg viewBox="0 0 1028 385" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 77H234.226L307.006 24H790" stroke="#ffd52b" stroke-width="20"></path>
<path d="M0 140H233.035L329.72 71H1028" stroke="#ffd52b" stroke-width="20"></path>
<path d="M1 255H234.226L307.006 307H790" stroke="#ffd52b" stroke-width="20"></path>
<path d="M0 305H233.035L329.72 375H1028" stroke="#ffd52b" stroke-width="20"></path>
<rect y="186" width="236" height="24" fill="#ffd52b"></rect>
<ellipse cx="790" cy="25.5" rx="25" ry="25.5" fill="#ffd52b"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 25)" fill="white"></circle>
<ellipse cx="790" cy="307.5" rx="25" ry="25.5" fill="#ffd52b"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 308)" fill="white"></circle>
</svg></div>
</svg>
<div id="mask">
<svg viewBox="0 0 1028 385" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 77H234.226L307.006 24H790" stroke="#f25d8e" stroke-width="20"></path>
<path d="M0 140H233.035L329.72 71H1028" stroke="#f25d8e" stroke-width="20"></path>
<path d="M1 255H234.226L307.006 307H790" stroke="#f25d8e" stroke-width="20"></path>
<path d="M0 305H233.035L329.72 375H1028" stroke="#f25d8e" stroke-width="20"></path>
<rect y="186" width="236" height="24" fill="#f25d8e"></rect>
<ellipse cx="790" cy="25.5" rx="25" ry="25.5" fill="#f25d8e"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 25)" fill="white"></circle>
<ellipse cx="790" cy="307.5" rx="25" ry="25.5" fill="#f25d8e"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 308)" fill="white"></circle>
</svg>
</div>
<div id="orange-mask">
<svg viewBox="0 0 1028 385" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 77H234.226L307.006 24H790" stroke="#ffd52b" stroke-width="20"></path>
<path d="M0 140H233.035L329.72 71H1028" stroke="#ffd52b" stroke-width="20"></path>
<path d="M1 255H234.226L307.006 307H790" stroke="#ffd52b" stroke-width="20"></path>
<path d="M0 305H233.035L329.72 375H1028" stroke="#ffd52b" stroke-width="20"></path>
<rect y="186" width="236" height="24" fill="#ffd52b"></rect>
<ellipse cx="790" cy="25.5" rx="25" ry="25.5" fill="#ffd52b"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 25)" fill="white"></circle>
<ellipse cx="790" cy="307.5" rx="25" ry="25.5" fill="#ffd52b"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 308)" fill="white"></circle>
</svg>
</div>
<p id="people"><b>[[${theme.config.aboutReward.reward_list.size()}]]</b></p>
</div>
</div>
<div class="reward-list-all" th:if="${not #lists.isEmpty(theme.config.aboutReward.reward_list)}"
th:with="authorRewardList = ${theme.config.aboutReward.reward_list}">
<div class="reward-list-item" th:each="authorReward : ${authorRewardList}">
<div class="reward-list-item-name">[[${authorReward.name}]]</div>
<div class="reward-list-bottom-group">
<div th:if="${authorReward.sign == 'N'}" class="reward-list-item-money">¥
[[${authorReward.amount}]]</div>
[[${authorReward.amount}]]
</div>
<div th:if="${authorReward.sign == 'Y'}" class="reward-list-item-money"
style="background: var(--heo-vip);">¥ [[${authorReward.amount}]]
</div>
<time class="datatime reward-list-item-time">[[${authorReward.datatime}]]</time>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,42 +1,53 @@
<!-- 数据统计&作者相关信息 -->
<div class="author-content" >
<div class="author-content">
<div class="about-statistic author-content-item"
style="background: url(https://bu.dusays.com/2023/03/12/640dc8c72f623.webp);">
<div class="card-content">
<div class="author-content-item-tips">数据</div>
<span class="author-content-item-title">访问统计</span>
<div id="statistic"></div>
<div class="post-tips">统计信息来自 <a href="https://invite.51.la/1NzKqTeb?target=V6" rel="noopener nofollow"
<div class="post-tips">统计信息来自 <a href="https://invite.51.la/1NzKqTeb?target=V6"
rel="noopener nofollow"
target="_blank">51la网站统计</a></div>
<div class="banner-button-group"><a class="banner-button" onclick="pjax.loadUrl('/archives')"
data-pjax-state=""><i class="haofont hao-icon-circle-arrow-up-right-1"></i><span
class="banner-button-text">文章隧道</span></a></div>
<div class="banner-button-group">
<a class="banner-button" onclick="pjax.loadUrl('/archives')" data-pjax-state="">
<i class="haofont hao-icon-circle-arrow-up-right-1"></i>
<span class="banner-button-text">文章隧道</span>
</a>
</div>
</div>
</div>
<div class="author-content-item-group column mapAndInfo">
<div class="author-content-item map single">
<span class="map-title">我现在住在
<b>[[${theme.config.about.map.StrengthenTitle}]]</b></span>
<b>[[${theme.config.about.map.StrengthenTitle}]]</b>
</span>
</div>
<div class="author-content-item selfInfo single"
th:if="${not #lists.isEmpty(theme.config.about.map.authorInfo)}"
th:with="texts = ${theme.config.about.map.authorInfo}">
<div th:if="${theme.config.about.map.authorInfo.size()}>'0'"><span class="selfInfo-title"
th:text="${texts[0].authorInfoTitle}">生于</span><span class="selfInfo-content"
id="selfInfo-content-year" th:style="'color:' + ${texts[0].authorInfoColor}"
th:text="${texts[0].authorInfoContent}">2000</span>
<div th:if="${theme.config.about.map.authorInfo.size()}>'0'">
<span class="selfInfo-title"
th:text="${texts[0].authorInfoTitle}">生于</span><span
class="selfInfo-content"
id="selfInfo-content-year" th:style="'color:' + ${texts[0].authorInfoColor}"
th:text="${texts[0].authorInfoContent}">2000</span>
</div>
<div th:if="${theme.config.about.map.authorInfo.size()}>'1'"><span class="selfInfo-title"
th:text="${texts[1].authorInfoTitle}">太原理工大学</span><span class="selfInfo-content"
th:style="'color:' + ${texts[1].authorInfoColor}"
th:text="${texts[1].authorInfoContent}">计算机科学</span>
<div th:if="${theme.config.about.map.authorInfo.size()}>'1'">
<span class="selfInfo-title"
th:text="${texts[1].authorInfoTitle}">太原理工大学</span><span
class="selfInfo-content"
th:style="'color:' + ${texts[1].authorInfoColor}"
th:text="${texts[1].authorInfoContent}">计算机科学</span>
</div>
<div th:if="${theme.config.about.map.authorInfo.size()}>'2'"><span class="selfInfo-title"
th:text="${texts[2].authorInfoTitle}">现在职业</span><span class="selfInfo-content"
th:style="'color:' + ${texts[2].authorInfoColor}"
th:text="${texts[2].authorInfoContent}">BI工程师</span>
<div th:if="${theme.config.about.map.authorInfo.size()}>'2'">
<span class="selfInfo-title"
th:text="${texts[2].authorInfoTitle}">现在职业</span><span
class="selfInfo-content"
th:style="'color:' + ${texts[2].authorInfoColor}"
th:text="${texts[2].authorInfoContent}">BI工程师</span>
</div>
</div>
</div>
@ -52,18 +63,19 @@
background-size: 100%;
transition: 1s ease-in-out;
}
[data-theme=dark] .author-content-item.map {
background: url([[${theme.config.about.map.backgroundDark}]]) no-repeat center;
background-size: 100%;
}
.author-content-item.map:hover {
background-size: 120%;
transition: 4s ease-in-out;
background-position-x: 0;
background-position-y: 36%;
}
.author-content-item.map .map-title {
position: absolute;
bottom: 0px;
@ -75,21 +87,23 @@
-webkit-backdrop-filter: blur(20px);
transition: 1s ease-in-out;
font-size: 20px;
border-radius: 0 0 1rem 1rem;
}
.author-content-item.map:hover .map-title {
bottom: -100%;
border-radius: 0 0 1rem 1rem;
}
.author-content-item.map .map-title b {
color: var(--heo-fontcolor);
}
@media screen and (max-width: 768px) {
.author-content-item.map.myphoto {
background-size: cover !important;
}
.author-content-item.map .map-title {
padding: 1rem;
}
@ -100,71 +114,74 @@
// 链接替换即可,不需要后面的参数
function initAboutPage() {
fetch("https://v6-widget.51.la/v6/[[${theme.config.about.LingQueMonitorID}]]/quote.js")
.then(res => res.text())
.then(data => {
let title = ["最近活跃", "今日人数", "今日访问", "昨日人数", "昨日访问", "本月访问", "总访问量"];
// let num = data.match(/(?<=<\/span><span>).*?(?=<\/span><\/p>)/g)
let num = data.match(/(<\/span><span>).*?(\/span><\/p>)/g);
num = num.map(el => {
let val = el.replace(/(<\/span><span>)/g, "");
let str = val.replace(/(<\/span><\/p>)/g, "");
return str;
});
let statisticEl = document.getElementById("statistic");
// 自定义不显示哪个或者显示哪个,如下为不显示 最近活跃访客 和 总访问量
let statistic = [];
for (let i = 0; i < num.length; i++) {
if (!statisticEl) return;
if (i == 0) continue;
statisticEl.innerHTML +=
"<div><span>" + title[i] + "</span><span id=" + title[i] + ">" + num[i] + "</span></div>";
queueMicrotask(() => {
statistic.push(
new CountUp(title[i], 0, num[i], 0, 2, {
useEasing: true,
useGrouping: true,
separator: ",",
decimal: ".",
prefix: "",
suffix: "",
})
);
.then(res => res.text())
.then(data => {
let title = ["最近活跃", "今日人数", "今日访问", "昨日人数", "昨日访问", "本月访问", "总访问量"];
// let num = data.match(/(?<=<\/span><span>).*?(?=<\/span><\/p>)/g)
let num = data.match(/(<\/span><span>).*?(\/span><\/p>)/g);
num = num.map(el => {
let val = el.replace(/(<\/span><span>)/g, "");
let str = val.replace(/(<\/span><\/p>)/g, "");
return str;
});
}
let statisticElement = document.querySelector(".about-statistic.author-content-item");
function statisticUP() {
if (!statisticElement) return;
const callback = (entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
for (let i = 0; i < num.length; i++) {
if (i == 0) continue;
queueMicrotask(() => {
statistic[i - 1].start();
});
}
observer.disconnect(); // 停止观察元素,因为不再需要触发此回调
}
let statisticEl = document.getElementById("statistic");
// 自定义不显示哪个或者显示哪个,如下为不显示 最近活跃访客 和 总访问量
let statistic = [];
for (let i = 0; i < num.length; i++) {
if (!statisticEl) return;
if (i == 0) continue;
statisticEl.innerHTML +=
"<div><span>" + title[i] + "</span><span id=" + title[i] + ">" + num[i] + "</span></div>";
queueMicrotask(() => {
statistic.push(
new CountUp(title[i], 0, num[i], 0, 2, {
useEasing: true,
useGrouping: true,
separator: ",",
decimal: ".",
prefix: "",
suffix: "",
})
);
});
};
const options = {
root: null,
rootMargin: "0px",
threshold: 0
};
const observer = new IntersectionObserver(callback, options);
observer.observe(statisticElement);
}
statisticUP()
});
}
let statisticElement = document.querySelector(".about-statistic.author-content-item");
function statisticUP() {
if (!statisticElement) return;
const callback = (entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
for (let i = 0; i < num.length; i++) {
if (i == 0) continue;
queueMicrotask(() => {
statistic[i - 1].start();
});
}
observer.disconnect(); // 停止观察元素,因为不再需要触发此回调
}
});
};
const options = {
root: null,
rootMargin: "0px",
threshold: 0
};
const observer = new IntersectionObserver(callback, options);
observer.observe(statisticElement);
}
statisticUP()
});
}
initAboutPage();
</script>
</div>

View File

@ -51,5 +51,5 @@ spec:
repo: https://githubfast.com/liuzhihang/halo-theme-hao
settingName: "theme-hao-setting"
configMapName: "theme-hao-configMap"
version: "1.4.5"
version: "1.4.7-beta1"
require: ">=2.10.0"