Skip to content

Commit

Permalink
Merge pull request #522 from chengzhongxue/main
Browse files Browse the repository at this point in the history
优化标签,分类,首页 文章布局
  • Loading branch information
chengzhongxue authored Oct 17, 2023
2 parents 4eac5f1 + f716fae commit fd405f1
Show file tree
Hide file tree
Showing 19 changed files with 528 additions and 306 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
- 追番插件 [plugin-bilibili-bangumi](https://githubfast.com/Roozenlz/plugin-bilibili-bangumi)
- 图库插件 [plugin-photos](https://githubfast.com/halo-sigs/plugin-photos)
- 主题标签 [plugin-haotag](https://githubfast.com/chengzhongxue/plugin-haotag)
- 我的装备 [plugin-equipments](https://githubfast.com/chengzhongxue/plugin-equipments)

> 更多插件请参见:https://githubfast.com/halo-sigs/awesome-halo
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "halo-theme-hao",
"version": "1.3.9",
"version": "1.4.0",
"dependencies": {
}
}
2 changes: 1 addition & 1 deletion templates/archives.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<main class="layout" id="content-inner">
<!-- archive -->
<div id="archive">
<div class="article-sort-title">文章 - [[${siteStatsFinder.getStats().post}]]</div>
<div class="article-sort-title">文章<sup>[[${siteStatsFinder.getStats().post}]]</sup></div>
<div class="article-sort" th:each="archive : ${archives.items}"
th:with='postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg+"&" : theme.config.layout.postRandomImg+"?"}'>
<div class="article-sort-item year" th:text="${archive.year}"></div>
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/css/related-posts-two.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
padding: 0 1rem;
width: 100%;
}
.is-center {
.relatedPosts>.relatedPosts-list .is-center {
text-align: center;
display: flex;
flex-wrap: wrap;
Expand Down
42 changes: 39 additions & 3 deletions templates/assets/js/heo.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,36 @@ var heo = {
$("#cookies-window").hide())
},

tagPageActive: function() {
var e = window.location.pathname;
if (/\/tags\/.*?/.test(e = decodeURIComponent(e))) {
var t = e.split("/")[2];
if (document.querySelector("#tag-page-tags")) {
$("a").removeClass("select");
var o = document.getElementById(t);
o && (o.classList.add("select"),
o.style.order = "-1")
}
}
},

categoriesBarActive: function() {
document.querySelector("#category-bar") && $(".category-bar-item").removeClass("select");
var e = window.location.pathname;
if ("/" == (e = decodeURIComponent(e)))
document.querySelector("#category-bar") && document.getElementById("category-bar-home").classList.add("select");
else {
if (/\/categories\/.*?/.test(e)) {
var t = e.split("/")[2];
if (document.querySelector("#category-bar")) {
var o = document.getElementById(t);
o && (o.classList.add("select"),
o.style.order = "-1")
}
}
}
},

// 页脚友链
addFriendLinksInFooter: function () {
var footerRandomFriendsBtn = document.getElementById("footer-random-friends-btn");
Expand Down Expand Up @@ -449,9 +479,15 @@ var heo = {
$htmlDom.contains("hide-aside") ? document.querySelector("#consoleHideAside").classList.add("on") : document.querySelector("#consoleHideAside").classList.remove("on")
},
toPage: function() {
var e, t = document.querySelectorAll(".page-number"), o = parseInt(t[t.length - 1].innerHTML), n = document.getElementById("toPageText"), a = parseInt(n.value);
!isNaN(a) && a > 0 && "0" !== ("" + a)[0] && a <= o && (e = 1 === a ? "/" : "/page/" + a,
document.getElementById("toPageButton").href = e)
var e = document.querySelectorAll(".page-number")
, t = parseInt(e[e.length - 1].innerHTML)
, o = document.getElementById("toPageText")
, n = parseInt(o.value);
if (!isNaN(n) && n > 0 && "0" !== ("" + n)[0] && n <= t) {
var a, l = window.location.href.replace(/\/page\/\d$/, "");
a = 1 === n ? l : l + (l.endsWith("/") ? "" : "/") + "page/" + n,
document.getElementById("toPageButton").href = a
}
},
changeSayHelloText: function() {
const greetings = GLOBAL_CONFIG.helloText.length == 0 ? ["🤖️ 数码科技爱好者", "🔍 分享与热心帮助", "🏠 智能家居小能手", "🔨 设计开发一条龙", "🤝 专修交互与设计", "🏃 脚踏实地行动派", "🧱 团队小组发动机", "💢 壮汉人狠话不多"] : GLOBAL_CONFIG.helloText
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/libs/artalk/Artalk.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion templates/assets/libs/artalk/Artalk.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion templates/assets/libs/twikoo/twikoo.all.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions templates/assets/zhheo/blogex.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,12 @@ function initBlog() {
heo.initIndexEssay(),
heo.reflashEssayWaterFall(),
heo.darkModeStatus(),
heo.categoriesBarActive(),
heo.initThemeColor(),
heo.topCategoriesBarScroll(),
//隐藏加载动画
GLOBAL_CONFIG.loadingBox && heo.hideLoading(),
heo.tagPageActive(),
initObserver(),
checkUrlAndAddHideBanner()

Expand Down
11 changes: 9 additions & 2 deletions templates/assets/zhheo/commentBarrage.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@
}

.comment-barrage-item .comment-barrage-close:hover {
color: var(--heo-main);
color: var(--heo-lighttext);
}

.comment-barrage-item .comment-barrage-close .heofont {
.comment-barrage-item .comment-barrage-close .haofont {
color: var(--heo-fontcolor);
transition: all 0.3s ease 0s;
font-size: 18px !important;
}

.comment-barrage-item .comment-barrage-close:hover .haofont {
color: var(--heo-lighttext);
}


.comment-barrage-item pre {
display: none;
}
Expand Down
9 changes: 7 additions & 2 deletions templates/assets/zhheo/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ i.haofont.hao-icon-arrow-right.banner-righticon{
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
display: box;
display: flex;
-webkit-box-align: center;
-moz-box-align: center;
Expand All @@ -98,7 +97,9 @@ i.haofont.hao-icon-arrow-right.banner-righticon{
-o-box-lines: single;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap
flex-wrap: nowrap;
border-radius: 12px;

}

.card-widget.card-friend-link a.card-friend-item:hover {
Expand Down Expand Up @@ -157,6 +158,10 @@ i.haofont.hao-icon-arrow-right.banner-righticon{
align-items: flex-start
}

.card-widget.card-friend-link a.card-friend-item:hover .card-friend-name {
color: var(--heo-card-bg) !important;
}

.card-widget.card-friend-link .card-friend-name {
color: var(--card-friend-name-color)
}
Expand Down
Loading

0 comments on commit fd405f1

Please sign in to comment.