hexo-theme-solitude 1.4.7 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +16 -3
- package/README.md +2 -2
- package/README_EN.md +2 -2
- package/_config.yml +112 -183
- package/languages/en-US.yml +1 -1
- package/languages/zh-CN.yml +1 -1
- package/languages/zh-TW.yml +1 -1
- package/layout/includes/footer.pug +8 -6
- package/layout/includes/inject/body.pug +0 -2
- package/layout/includes/nav.pug +3 -3
- package/layout/includes/sidebar.pug +1 -1
- package/layout/includes/widgets/aside/asideInfoCard.pug +4 -3
- package/layout/includes/widgets/home/banner.pug +11 -4
- package/layout/includes/widgets/home/categoryGroup.pug +11 -8
- package/layout/includes/widgets/home/hometop.pug +1 -2
- package/layout/includes/widgets/home/postList.pug +3 -3
- package/layout/includes/widgets/nav/group.pug +13 -0
- package/layout/includes/widgets/nav/menu.pug +20 -16
- package/layout/includes/widgets/page/about/award.pug +1 -1
- package/layout/includes/widgets/page/equipment/content.pug +1 -1
- package/layout/includes/widgets/page/links/linksCard.pug +0 -1
- package/layout/includes/widgets/third-party/comments/waline.pug +2 -0
- package/layout/includes/widgets/third-party/news-comment/twikoo.pug +2 -2
- package/layout/includes/widgets/third-party/news-comment/waline.pug +2 -2
- package/layout/includes/widgets/third-party/search/algolia-search.pug +1 -1
- package/layout/includes/widgets/third-party/search/local-search.pug +1 -1
- package/layout/index.pug +6 -6
- package/package.json +1 -1
- package/plugins.yml +0 -5
- package/scripts/helper/stylus.js +19 -0
- package/source/css/_global/animation.styl +6 -0
- package/source/css/_layout/basic.styl +10 -1
- package/source/css/_layout/header.styl +5 -5
- package/source/css/_layout/index.styl +0 -1
- package/source/css/_page/_about/skills.styl +1 -1
- package/source/css/_page/_home/category-bar.styl +14 -14
- package/source/css/_page/_home/home-top.styl +57 -45
- package/source/css/_page/_home/recent-post.styl +1 -1
- package/source/css/_page/equipment.styl +3 -2
- package/source/css/_page/home.styl +0 -15
- package/source/css/_page/links.styl +9 -8
- package/source/css/_page/says.styl +1 -2
- package/source/css/_page/share.styl +30 -67
- package/source/css/_widgets/_aside/index.styl +1 -1
- package/source/css/_widgets/_aside/info.styl +1 -1
- package/source/css/_widgets/_comment/twikoo.styl +4 -6
- package/source/css/_widgets/_comment/waline.styl +435 -72
- package/source/css/_widgets/_extra/console.styl +1 -1
- package/source/css/_widgets/_extra/fullpage.styl +1 -1
- package/source/css/_widgets/_mixins/footer.styl +1 -1
- package/source/css/_widgets/_post/content.styl +1 -11
- package/source/css/_widgets/_post/meta.styl +2 -2
- package/source/css/_widgets/_post/relatedPost.styl +1 -1
- package/source/css/_widgets/_post/tools.styl +1 -1
- package/source/css/_widgets/_search/algolia-search.styl +4 -2
- package/source/css/_widgets/_tags/note.styl +4 -0
- package/source/js/main.js +27 -35
- package/layout/includes/widgets/nav/left.pug +0 -10
package/source/js/main.js
CHANGED
@@ -64,45 +64,37 @@ const scrollFn = function () {
|
|
64
64
|
}
|
65
65
|
}
|
66
66
|
|
67
|
-
let ticking = false;
|
68
|
-
|
69
67
|
const percent = () => {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
}
|
87
|
-
}
|
68
|
+
let scrollTop = document.documentElement.scrollTop || window.pageYOffset
|
69
|
+
let totalHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - document.documentElement.clientHeight
|
70
|
+
let scrollPercent = Math.round(scrollTop / totalHeight * 100)
|
71
|
+
let percentElement = document.querySelector("#percent")
|
72
|
+
let viewportBottom = window.scrollY + document.documentElement.clientHeight
|
73
|
+
let remainingScroll = totalHeight - scrollTop
|
74
|
+
|
75
|
+
if ((document.getElementById("post-comment") || document.getElementById("footer")).offsetTop < viewportBottom || scrollPercent > 90) {
|
76
|
+
document.querySelector("#nav-totop").classList.add("long")
|
77
|
+
percentElement.innerHTML = "返回顶部"
|
78
|
+
} else {
|
79
|
+
document.querySelector("#nav-totop").classList.remove("long")
|
80
|
+
if (scrollPercent >= 0) {
|
81
|
+
percentElement.innerHTML = scrollPercent + ""
|
82
|
+
}
|
83
|
+
}
|
88
84
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
}
|
99
|
-
ticking = false;
|
100
|
-
});
|
101
|
-
ticking = true;
|
85
|
+
let elementsToHide = document.querySelectorAll(".needEndHide")
|
86
|
+
if (remainingScroll < 100) {
|
87
|
+
elementsToHide.forEach(function (element) {
|
88
|
+
element.classList.add("hide")
|
89
|
+
})
|
90
|
+
} else {
|
91
|
+
elementsToHide.forEach(function (element) {
|
92
|
+
element.classList.remove("hide")
|
93
|
+
})
|
102
94
|
}
|
103
|
-
};
|
104
95
|
|
105
|
-
window.onscroll = percent
|
96
|
+
window.onscroll = percent
|
97
|
+
}
|
106
98
|
|
107
99
|
|
108
100
|
const showTodayCard = () => {
|
@@ -1,10 +0,0 @@
|
|
1
|
-
.back-menu-list-groups
|
2
|
-
- var menu = theme.nav && theme.nav.left && theme.nav.left.menu ? theme.nav.left.menu : {}
|
3
|
-
each groupData, x in menu
|
4
|
-
.back-menu-list-group
|
5
|
-
.back-menu-list-title= x
|
6
|
-
.back-menu-list
|
7
|
-
each data, y in groupData
|
8
|
-
a.back-menu-item(href=url_for(data.url), title=y)
|
9
|
-
img.back-menu-item-icon(src=data.icon, alt=x)
|
10
|
-
span.back-menu-item-text= y
|