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.
Files changed (91) hide show
  1. package/.github/FUNDING.yml +1 -1
  2. package/README.md +26 -29
  3. package/README_zh-Hant.md +1 -1
  4. package/{README_en-US.md → README_zh_CN.md} +29 -26
  5. package/_config.yml +153 -590
  6. package/languages/default.yml +2 -1
  7. package/languages/en.yml +2 -1
  8. package/languages/zh-CN.yml +1 -1
  9. package/languages/zh-TW.yml +1 -1
  10. package/layout/404.pug +1 -1
  11. package/layout/includes/console.pug +8 -8
  12. package/layout/includes/footer.pug +6 -6
  13. package/layout/includes/head/config.pug +5 -5
  14. package/layout/includes/inject/body.pug +1 -0
  15. package/layout/includes/inject/head.pug +1 -1
  16. package/layout/includes/layout.pug +0 -1
  17. package/layout/includes/mixins/articleSort.pug +3 -1
  18. package/layout/includes/mixins/pagination.pug +2 -2
  19. package/layout/includes/nav.pug +2 -1
  20. package/layout/includes/page/categories.pug +3 -2
  21. package/layout/includes/page/says.pug +5 -5
  22. package/layout/includes/page/tags.pug +3 -2
  23. package/layout/includes/rightmenu.pug +19 -20
  24. package/layout/includes/sidebar.pug +1 -1
  25. package/layout/includes/widgets/aside/asideInfoCard.pug +1 -1
  26. package/layout/includes/widgets/aside/asideNewestPost.pug +3 -3
  27. package/layout/includes/widgets/aside/asideNewstComments.pug +2 -2
  28. package/layout/includes/widgets/aside/asideToc.pug +1 -1
  29. package/layout/includes/widgets/aside/asideWebInfo.pug +10 -10
  30. package/layout/includes/widgets/home/bbTimeList.pug +7 -9
  31. package/layout/includes/widgets/home/carousel.pug +3 -1
  32. package/layout/includes/widgets/home/categoryBar.pug +1 -1
  33. package/layout/includes/widgets/home/hot/artalk.pug +45 -0
  34. package/layout/includes/widgets/home/hot/index.pug +3 -1
  35. package/layout/includes/widgets/home/hot/twikoo.pug +1 -1
  36. package/layout/includes/widgets/home/postList.pug +4 -2
  37. package/layout/includes/widgets/home/topGroup.pug +1 -1
  38. package/layout/includes/widgets/nav/right.pug +9 -5
  39. package/layout/includes/widgets/page/about/award.pug +1 -1
  40. package/layout/includes/widgets/page/about/hobbies.pug +1 -1
  41. package/layout/includes/widgets/page/about/other.pug +1 -1
  42. package/layout/includes/widgets/page/banner.pug +1 -1
  43. package/layout/includes/widgets/page/equipment/content.pug +1 -1
  44. package/layout/includes/widgets/page/links/banner.pug +2 -2
  45. package/layout/includes/widgets/page/recentcomment/artalk.pug +1 -1
  46. package/layout/includes/widgets/page/recentcomment/twikoo.pug +1 -1
  47. package/layout/includes/widgets/page/recentcomment/valine.pug +1 -1
  48. package/layout/includes/widgets/page/recentcomment/waline.pug +1 -1
  49. package/layout/includes/widgets/post/award.pug +1 -1
  50. package/layout/includes/widgets/post/copyright.pug +10 -10
  51. package/layout/includes/widgets/post/post-ai.pug +1 -1
  52. package/layout/includes/widgets/post/postInfo.pug +20 -18
  53. package/layout/includes/widgets/third-party/comments/artalk.pug +7 -0
  54. package/layout/includes/widgets/third-party/comments/comment.pug +4 -4
  55. package/layout/includes/widgets/third-party/search/algolia-search.pug +1 -4
  56. package/layout/includes/widgets/third-party/search/local-search.pug +1 -1
  57. package/layout/includes/widgets/third-party/tianli-talk.pug +1 -1
  58. package/layout/post.pug +3 -2
  59. package/layout/tag.pug +3 -2
  60. package/package.json +2 -2
  61. package/plugins.yml +9 -9
  62. package/scripts/helper/related_post.js +1 -1
  63. package/scripts/helper/stylus.js +1 -0
  64. package/source/css/_comments/comment.styl +3 -4
  65. package/source/css/_global/index.styl +15 -14
  66. package/source/css/_highlight/index.styl +2 -2
  67. package/source/css/_highlight/theme/default.styl +1 -1
  68. package/source/css/_highlight/theme/mac.styl +1 -1
  69. package/source/css/_layout/article-container.styl +13 -4
  70. package/source/css/_layout/aside.styl +4 -3
  71. package/source/css/_layout/console.styl +2 -1
  72. package/source/css/_layout/footer.styl +1 -1
  73. package/source/css/_layout/header.styl +62 -12
  74. package/source/css/_page/_about/author.styl +4 -1
  75. package/source/css/_page/_about/buff.styl +1 -1
  76. package/source/css/_page/_about/contentinfo.styl +3 -2
  77. package/source/css/_page/_about/maxim.styl +1 -1
  78. package/source/css/_page/_home/category-bar.styl +19 -13
  79. package/source/css/_page/_home/home-top.styl +2 -0
  80. package/source/css/_page/_home/hot-tip.styl +2 -1
  81. package/source/css/_page/category.styl +0 -1
  82. package/source/css/_post/copyright.styl +104 -105
  83. package/source/css/_post/meta.styl +1 -1
  84. package/source/css/_post/pagination.styl +1 -1
  85. package/source/css/_post/tools.styl +1 -1
  86. package/source/css/_search/algolia-search.styl +0 -6
  87. package/source/css/_tags/image.styl +4 -0
  88. package/source/css/_tags/timeline.styl +3 -0
  89. package/source/js/covercolor/local.js +10 -4
  90. package/source/js/main.js +5 -5
  91. package/source/js/tw_cn.js +0 -3
@@ -63,6 +63,9 @@ div.timenode
63
63
  border-radius 8px
64
64
  background var(--blockquote-bg)
65
65
 
66
+ p
67
+ margin 0 !important
68
+
66
69
  p:first-child
67
70
  margin-top 0
68
71
 
@@ -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", !document.documentElement.classList.contains("hide-aside"));
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 st-copy-fill copy-button"></i>` : '<i></i>';
468
- const expandEle = `<i class="solitude st-arrow-down expand"></i>`;
469
- const limitEle = limit ? `<i class="solitude st-show-line"></i>` : '<i></i>';
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, sco.initConsoleState, window.refreshFn, asideStatus, () => window.onscroll = percent].forEach(fn => fn());
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) {
@@ -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
  }