hexo-theme-solitude 1.13.3 → 2.0.1
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/.github/FUNDING.yml +1 -1
- package/README.md +26 -29
- package/README_zh-Hant.md +1 -1
- package/{README_en-US.md → README_zh_CN.md} +29 -26
- package/_config.yml +153 -590
- package/languages/default.yml +2 -1
- package/languages/en.yml +2 -1
- package/languages/zh-CN.yml +1 -1
- package/languages/zh-TW.yml +1 -1
- package/layout/404.pug +1 -1
- package/layout/includes/console.pug +8 -8
- package/layout/includes/footer.pug +6 -6
- package/layout/includes/head/config.pug +5 -5
- package/layout/includes/inject/body.pug +1 -0
- package/layout/includes/inject/head.pug +1 -1
- package/layout/includes/layout.pug +0 -1
- package/layout/includes/mixins/articleSort.pug +3 -1
- package/layout/includes/mixins/pagination.pug +2 -2
- package/layout/includes/nav.pug +2 -1
- package/layout/includes/page/categories.pug +3 -2
- package/layout/includes/page/says.pug +5 -5
- package/layout/includes/page/tags.pug +3 -2
- package/layout/includes/rightmenu.pug +19 -20
- package/layout/includes/sidebar.pug +1 -1
- package/layout/includes/widgets/aside/asideInfoCard.pug +1 -1
- package/layout/includes/widgets/aside/asideNewestPost.pug +3 -3
- package/layout/includes/widgets/aside/asideNewstComments.pug +2 -2
- package/layout/includes/widgets/aside/asideToc.pug +1 -1
- package/layout/includes/widgets/aside/asideWebInfo.pug +10 -10
- package/layout/includes/widgets/home/bbTimeList.pug +7 -9
- package/layout/includes/widgets/home/carousel.pug +3 -1
- package/layout/includes/widgets/home/categoryBar.pug +1 -1
- package/layout/includes/widgets/home/hot/artalk.pug +45 -0
- package/layout/includes/widgets/home/hot/index.pug +3 -1
- package/layout/includes/widgets/home/hot/twikoo.pug +1 -1
- package/layout/includes/widgets/home/postList.pug +4 -2
- package/layout/includes/widgets/home/topGroup.pug +1 -1
- package/layout/includes/widgets/nav/right.pug +9 -5
- package/layout/includes/widgets/page/about/award.pug +1 -1
- package/layout/includes/widgets/page/about/hobbies.pug +1 -1
- package/layout/includes/widgets/page/about/other.pug +1 -1
- package/layout/includes/widgets/page/banner.pug +1 -1
- package/layout/includes/widgets/page/equipment/content.pug +1 -1
- package/layout/includes/widgets/page/links/banner.pug +2 -2
- package/layout/includes/widgets/page/recentcomment/artalk.pug +1 -1
- package/layout/includes/widgets/page/recentcomment/twikoo.pug +1 -1
- package/layout/includes/widgets/page/recentcomment/valine.pug +1 -1
- package/layout/includes/widgets/page/recentcomment/waline.pug +1 -1
- package/layout/includes/widgets/post/award.pug +1 -1
- package/layout/includes/widgets/post/copyright.pug +10 -10
- package/layout/includes/widgets/post/post-ai.pug +1 -1
- package/layout/includes/widgets/post/postInfo.pug +20 -18
- package/layout/includes/widgets/third-party/comments/artalk.pug +7 -0
- package/layout/includes/widgets/third-party/comments/comment.pug +4 -4
- package/layout/includes/widgets/third-party/search/algolia-search.pug +1 -4
- package/layout/includes/widgets/third-party/search/local-search.pug +1 -1
- package/layout/includes/widgets/third-party/tianli-talk.pug +1 -1
- package/layout/post.pug +3 -2
- package/layout/tag.pug +3 -2
- package/package.json +2 -2
- package/plugins.yml +9 -9
- package/scripts/helper/related_post.js +1 -1
- package/scripts/helper/stylus.js +1 -0
- package/source/css/_comments/comment.styl +3 -4
- package/source/css/_global/index.styl +15 -14
- package/source/css/_highlight/index.styl +2 -2
- package/source/css/_highlight/theme/default.styl +1 -1
- package/source/css/_highlight/theme/mac.styl +1 -1
- package/source/css/_layout/article-container.styl +13 -4
- package/source/css/_layout/aside.styl +4 -3
- package/source/css/_layout/console.styl +2 -1
- package/source/css/_layout/footer.styl +1 -1
- package/source/css/_layout/header.styl +62 -12
- package/source/css/_page/_about/author.styl +4 -1
- package/source/css/_page/_about/buff.styl +1 -1
- package/source/css/_page/_about/contentinfo.styl +3 -2
- package/source/css/_page/_about/maxim.styl +1 -1
- package/source/css/_page/_home/category-bar.styl +19 -13
- package/source/css/_page/_home/home-top.styl +2 -0
- package/source/css/_page/_home/hot-tip.styl +2 -1
- package/source/css/_page/category.styl +0 -1
- package/source/css/_post/copyright.styl +104 -105
- package/source/css/_post/meta.styl +1 -1
- package/source/css/_post/pagination.styl +1 -1
- package/source/css/_post/tools.styl +1 -1
- package/source/css/_search/algolia-search.styl +0 -6
- package/source/css/_tags/image.styl +4 -0
- package/source/css/_tags/timeline.styl +3 -0
- package/source/js/covercolor/local.js +10 -4
- package/source/js/main.js +5 -5
- package/source/js/tw_cn.js +0 -3
@@ -26,7 +26,7 @@ const calculateColor = img => {
|
|
26
26
|
const data = ctx.getImageData(0, 0, img.width, img.height).data;
|
27
27
|
const {r, g, b} = calculateRGB(data);
|
28
28
|
let value = rgbToHex(r, g, b);
|
29
|
-
return getContrastYIQ(value) === "light" ? LightenDarkenColor(value, -50) : value;
|
29
|
+
return getContrastYIQ(value) === "light" ? LightenDarkenColor(value, -50) : LightenDarkenColor(value, 20);
|
30
30
|
}
|
31
31
|
|
32
32
|
function calculateRGB(data) {
|
@@ -56,9 +56,9 @@ function LightenDarkenColor(col, amt) {
|
|
56
56
|
}
|
57
57
|
|
58
58
|
const num = parseInt(col, 16);
|
59
|
-
const r = Math.min(255, Math.max(0, (num >> 16) + amt));
|
60
|
-
const b = Math.min(255, Math.max(0, ((num >> 8) & 0xff) + amt));
|
61
|
-
const g = Math.min(255, Math.max(0, (num & 0xff) + amt));
|
59
|
+
const r = Math.min(255, Math.max(0, (num >> 16) + amt * 2));
|
60
|
+
const b = Math.min(255, Math.max(0, ((num >> 8) & 0xff) + amt * 2));
|
61
|
+
const g = Math.min(255, Math.max(0, (num & 0xff) + amt * 2));
|
62
62
|
|
63
63
|
return `${usePound ? "#" : ""}${(g | (b << 8) | (r << 16)).toString(16).padStart(6, "0")}`;
|
64
64
|
}
|
@@ -121,6 +121,12 @@ function setThemeColors(value, r = null, g = null, b = null) {
|
|
121
121
|
authorInfo[i].style.setProperty('background', 'var(--efu-white-op)');
|
122
122
|
authorInfo[i].style.setProperty('color', 'var(--efu-white)');
|
123
123
|
}
|
124
|
+
|
125
|
+
value = LightenDarkenColor(value, 50);
|
126
|
+
document.documentElement.style.setProperty('--efu-main', value);
|
127
|
+
document.documentElement.style.setProperty('--efu-main-op', value + '23');
|
128
|
+
document.documentElement.style.setProperty('--efu-main-op-deep', value + 'dd');
|
129
|
+
document.documentElement.style.setProperty('--efu-main-none', value + '00');
|
124
130
|
}
|
125
131
|
}
|
126
132
|
|
package/source/js/main.js
CHANGED
@@ -198,7 +198,7 @@ const sco = {
|
|
198
198
|
},
|
199
199
|
initConsoleState() {
|
200
200
|
const consoleHideAside = document.querySelector("#consoleHideAside");
|
201
|
-
consoleHideAside.classList.toggle("on",
|
201
|
+
consoleHideAside.classList.toggle("on", document.documentElement.classList.contains("hide-aside"));
|
202
202
|
},
|
203
203
|
changeSayHelloText() {
|
204
204
|
const greetings = GLOBAL_CONFIG.aside.sayhello2;
|
@@ -464,9 +464,9 @@ const addHighlight = () => {
|
|
464
464
|
const expandClass = !expand === true ? 'closed' : ''
|
465
465
|
const $syntaxHighlight = syntax === 'highlight.js' ? document.querySelectorAll('figure.highlight') : document.querySelectorAll('pre[class*="language-"]')
|
466
466
|
if (!(($isShowTool || limit) && $syntaxHighlight.length)) return
|
467
|
-
const copyEle = copy ? `<i class="solitude
|
468
|
-
const expandEle = `<i class="solitude
|
469
|
-
const limitEle = limit ? `<i class="solitude
|
467
|
+
const copyEle = copy ? `<i class="solitude far fa-copy copy-button"></i>` : '<i></i>';
|
468
|
+
const expandEle = `<i class="solitude fas fa-angle-down expand"></i>`;
|
469
|
+
const limitEle = limit ? `<i class="solitude fas fa-angles-down"></i>` : '<i></i>';
|
470
470
|
const alertInfo = (ele, text) => utils.snackbarShow(text, false, 2000)
|
471
471
|
const copyFn = (e) => {
|
472
472
|
const $buttonParent = e.parentNode
|
@@ -694,7 +694,7 @@ window.refreshFn = () => {
|
|
694
694
|
if (lure) tabs.lureAddListener();
|
695
695
|
}
|
696
696
|
document.addEventListener('DOMContentLoaded', () => {
|
697
|
-
[addCopyright,
|
697
|
+
[addCopyright, window.refreshFn, asideStatus, () => window.onscroll = percent, sco.initConsoleState].forEach(fn => fn());
|
698
698
|
});
|
699
699
|
document.addEventListener('visibilitychange', () => {
|
700
700
|
if (document.hidden) {
|
package/source/js/tw_cn.js
CHANGED
@@ -59,13 +59,11 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
59
59
|
currentEncoding = 1
|
60
60
|
targetEncoding = 2
|
61
61
|
translateButtonObject.lastChild.textContent = msgToTraditionalChinese
|
62
|
-
translateButtonObject.firstChild.className = 'solitude st-panben-line'
|
63
62
|
utils.snackbarShow('你已切换为简体')
|
64
63
|
} else if (targetEncoding === 2) {
|
65
64
|
currentEncoding = 2
|
66
65
|
targetEncoding = 1
|
67
66
|
translateButtonObject.lastChild.textContent = msgToSimplifiedChinese
|
68
|
-
translateButtonObject.firstChild.className = 'solitude st-jianben-line'
|
69
67
|
utils.snackbarShow('你已切換為繁體')
|
70
68
|
}
|
71
69
|
utils.saveToLocal.set(targetEncodingCookie, targetEncoding, 2)
|
@@ -111,7 +109,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
111
109
|
if (translateButtonObject) {
|
112
110
|
if (currentEncoding !== targetEncoding) {
|
113
111
|
translateButtonObject.lastChild.textContent = targetEncoding === 1 ? msgToSimplifiedChinese : msgToTraditionalChinese
|
114
|
-
translateButtonObject.firstChild.className = targetEncoding === 1 ? 'solitude st-jianben-line' : 'solitude st-panben-line'
|
115
112
|
setLang()
|
116
113
|
setTimeout(translateBody, translateDelay)
|
117
114
|
}
|