hexo-theme-solitude 1.13.4 → 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 (72) hide show
  1. package/README.md +26 -29
  2. package/README_zh-Hant.md +1 -1
  3. package/{README_en-US.md → README_zh_CN.md} +29 -26
  4. package/_config.yml +150 -597
  5. package/languages/default.yml +1 -0
  6. package/languages/en.yml +1 -0
  7. package/layout/404.pug +1 -1
  8. package/layout/includes/console.pug +7 -7
  9. package/layout/includes/footer.pug +6 -6
  10. package/layout/includes/head/config.pug +5 -5
  11. package/layout/includes/inject/body.pug +1 -0
  12. package/layout/includes/inject/head.pug +1 -1
  13. package/layout/includes/mixins/articleSort.pug +3 -1
  14. package/layout/includes/mixins/pagination.pug +2 -2
  15. package/layout/includes/nav.pug +2 -1
  16. package/layout/includes/page/categories.pug +3 -2
  17. package/layout/includes/page/says.pug +5 -5
  18. package/layout/includes/page/tags.pug +3 -2
  19. package/layout/includes/rightmenu.pug +19 -20
  20. package/layout/includes/sidebar.pug +1 -1
  21. package/layout/includes/widgets/aside/asideInfoCard.pug +1 -1
  22. package/layout/includes/widgets/aside/asideNewestPost.pug +1 -1
  23. package/layout/includes/widgets/aside/asideNewstComments.pug +2 -2
  24. package/layout/includes/widgets/aside/asideToc.pug +1 -1
  25. package/layout/includes/widgets/aside/asideWebInfo.pug +10 -10
  26. package/layout/includes/widgets/home/bbTimeList.pug +7 -9
  27. package/layout/includes/widgets/home/carousel.pug +3 -1
  28. package/layout/includes/widgets/home/categoryBar.pug +1 -1
  29. package/layout/includes/widgets/home/hot/artalk.pug +1 -1
  30. package/layout/includes/widgets/home/hot/twikoo.pug +1 -1
  31. package/layout/includes/widgets/home/postList.pug +4 -2
  32. package/layout/includes/widgets/home/topGroup.pug +1 -1
  33. package/layout/includes/widgets/nav/right.pug +9 -5
  34. package/layout/includes/widgets/page/about/award.pug +1 -1
  35. package/layout/includes/widgets/page/about/hobbies.pug +1 -1
  36. package/layout/includes/widgets/page/about/other.pug +1 -1
  37. package/layout/includes/widgets/page/banner.pug +1 -1
  38. package/layout/includes/widgets/page/equipment/content.pug +1 -1
  39. package/layout/includes/widgets/page/links/banner.pug +2 -2
  40. package/layout/includes/widgets/page/recentcomment/artalk.pug +1 -1
  41. package/layout/includes/widgets/page/recentcomment/twikoo.pug +1 -1
  42. package/layout/includes/widgets/page/recentcomment/valine.pug +1 -1
  43. package/layout/includes/widgets/page/recentcomment/waline.pug +1 -1
  44. package/layout/includes/widgets/post/award.pug +1 -1
  45. package/layout/includes/widgets/post/copyright.pug +10 -10
  46. package/layout/includes/widgets/post/post-ai.pug +1 -1
  47. package/layout/includes/widgets/post/postInfo.pug +20 -18
  48. package/layout/includes/widgets/third-party/comments/comment.pug +4 -4
  49. package/layout/includes/widgets/third-party/search/algolia-search.pug +1 -4
  50. package/layout/includes/widgets/third-party/search/local-search.pug +1 -1
  51. package/layout/includes/widgets/third-party/tianli-talk.pug +1 -1
  52. package/layout/post.pug +3 -2
  53. package/layout/tag.pug +3 -2
  54. package/package.json +1 -1
  55. package/plugins.yml +6 -6
  56. package/scripts/helper/related_post.js +1 -1
  57. package/scripts/helper/stylus.js +1 -0
  58. package/source/css/_global/index.styl +13 -13
  59. package/source/css/_highlight/index.styl +2 -2
  60. package/source/css/_highlight/theme/default.styl +1 -1
  61. package/source/css/_highlight/theme/mac.styl +1 -1
  62. package/source/css/_layout/console.styl +2 -1
  63. package/source/css/_layout/footer.styl +1 -1
  64. package/source/css/_layout/header.styl +56 -11
  65. package/source/css/_page/_home/category-bar.styl +4 -4
  66. package/source/css/_page/_home/home-top.styl +2 -0
  67. package/source/css/_page/_home/hot-tip.styl +2 -1
  68. package/source/css/_post/copyright.styl +104 -105
  69. package/source/css/_search/algolia-search.styl +0 -6
  70. package/source/js/covercolor/local.js +10 -4
  71. package/source/js/main.js +5 -5
  72. package/source/js/tw_cn.js +0 -3
@@ -85,130 +85,129 @@
85
85
  color var(--efu-white)
86
86
  cursor pointer
87
87
  border-radius 4px
88
+ .social-share
89
+ display flex
90
+ justify-content center
91
+ height 40px
92
+ margin .5rem auto
93
+ gap .5rem
94
+ flex-wrap wrap
95
+
96
+ .social-share-ico
97
+ display flex
98
+ justify-content center
99
+ align-items center
100
+ width 40px
101
+ height 40px
102
+ border-radius 12px
103
+ border var(--style-border)
104
+ cursor pointer
105
+ transition .3s
88
106
 
89
- .social-share
90
- display flex
91
- justify-content center
92
- height 40px
93
- margin .5rem auto
94
- gap .5rem
95
- flex-wrap wrap
96
-
97
- .social-share-ico
98
- display flex
99
- justify-content center
100
- align-items center
101
- width 40px
102
- height 40px
103
- border-radius 12px
104
- border var(--style-border)
105
- cursor pointer
106
- transition .3s
107
+ +maxWidth768()
108
+ &:nth-child(n+6)
109
+ display none
107
110
 
108
- +maxWidth768()
109
- &:nth-child(n+6)
110
- display none
111
+ &:hover
112
+ color white
111
113
 
112
- &:hover
113
- color white
114
+ .icon-qq
115
+ color #56b6e7
116
+ border-color #56b6e7
117
+ &:hover
118
+ background-color #56b6e7
114
119
 
115
- .icon-qq
116
- color #56b6e7
117
- border-color #56b6e7
118
- &:hover
119
- background-color #56b6e7
120
+ .icon-weibo
121
+ color #d44040
122
+ border-color #d44040
120
123
 
121
- .icon-weibo
122
- color #d44040
123
- border-color #d44040
124
+ &:hover
125
+ background-color #d44040
124
126
 
125
- &:hover
126
- background-color #d44040
127
+ .icon-facebook
128
+ color #415dc9
129
+ border-color #415dc9
127
130
 
128
- .icon-facebook
129
- color #415dc9
130
- border-color #415dc9
131
+ &:hover
132
+ background-color #415dc9
131
133
 
132
- &:hover
133
- background-color #415dc9
134
+ .icon-twitter
135
+ color #56b6e7
136
+ border-color #56b6e7
134
137
 
135
- .icon-twitter
136
- color #56b6e7
137
- border-color #56b6e7
138
+ &:hover
139
+ background-color #56b6e7
138
140
 
139
- &:hover
140
- background-color #56b6e7
141
+ .icon-telegram
142
+ color #56b6e7
143
+ border-color #56b6e7
141
144
 
142
- .icon-telegram
143
- color #56b6e7
144
- border-color #56b6e7
145
+ &:hover
146
+ background-color #56b6e7
145
147
 
146
- &:hover
147
- background-color #56b6e7
148
+ .icon-linkedin
149
+ color #0077b5
150
+ border-color #0077b5
148
151
 
149
- .icon-linkedin
150
- color #0077b5
151
- border-color #0077b5
152
+ &:hover
153
+ background-color #0077b5
154
+ .icon-whatsapp
155
+ color #25d366
156
+ border-color #25d366
152
157
 
153
- &:hover
154
- background-color #0077b5
155
- .icon-whatsapp
156
- color #25d366
157
- border-color #25d366
158
+ &:hover
159
+ background-color #25d366
160
+ .icon-link
161
+ color #425AEF
162
+ border-color #425AEF
158
163
 
159
- &:hover
160
- background-color #25d366
161
- .icon-link
162
- color #425AEF
163
- border-color #425AEF
164
+ &:hover
165
+ background-color #425AEF
166
+ .icon-qrcode
167
+ position relative
168
+ color #000
169
+ border-color #000
164
170
 
165
- &:hover
166
- background-color #425AEF
167
- .icon-qrcode
168
- position relative
169
- color #000
170
- border-color #000
171
+ +maxWidth900()
172
+ display none
171
173
 
172
- +maxWidth900()
173
- display none
174
+ &:hover
175
+ background-color #000
174
176
 
175
- &:hover
176
- background-color #000
177
+ .share-main
178
+ display flex
177
179
 
178
- .share-main
179
- display flex
180
+ .share-main
181
+ display none
182
+ position absolute
183
+ bottom 1.7rem
184
+ z-index 100
185
+ padding-bottom 15px
180
186
 
181
- .share-main
182
- display none
183
- position absolute
184
- bottom 1.7rem
185
- z-index 100
186
- padding-bottom 15px
187
-
188
- &-all
189
- padding 12px
190
- border-radius 12px
191
- background var(--efu-background)
192
- animation donate_effcet 0.3s 0.1s ease both
193
- flex-direction column
194
- border var(--style-border-always)
195
-
196
- .reward-dec
197
- font-size 0.6rem
198
- color var(--efu-fontcolor)!important
199
- text-align center
200
-
201
- #qrcode
202
- width 150px
203
- height 150px
204
- min-width 150px
205
- min-height 150px
206
- background var(--efu-white)
207
- padding 8px
208
- border-radius 8px
209
- margin-bottom 8px
187
+ &-all
188
+ padding 12px
189
+ border-radius 12px
190
+ background var(--efu-background)
191
+ animation donate_effcet 0.3s 0.1s ease both
192
+ flex-direction column
210
193
  border var(--style-border-always)
211
194
 
212
- img
213
- width 132px
214
- height 132px
195
+ .reward-dec
196
+ font-size 0.6rem
197
+ color var(--efu-fontcolor)!important
198
+ text-align center
199
+
200
+ #qrcode
201
+ width 150px
202
+ height 150px
203
+ min-width 150px
204
+ min-height 150px
205
+ background var(--efu-white)
206
+ padding 8px
207
+ border-radius 8px
208
+ margin-bottom 8px
209
+ border var(--style-border-always)
210
+
211
+ img
212
+ width 132px
213
+ height 132px
@@ -33,12 +33,6 @@
33
33
  align-items center
34
34
  margin-bottom 8px
35
35
 
36
- .algolia-tips
37
- color var(--efu-secondtext)
38
- right 0
39
- margin-left auto
40
- opacity .8
41
-
42
36
  .search-close-button
43
37
  color var(--efu-secondtext)
44
38
  font-size 1.4em
@@ -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
  }