hexo-theme-solitude 1.11.0 → 1.11.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.
@@ -1,7 +1,7 @@
1
1
  # These are supported funding model platforms
2
2
 
3
- github: [efuo] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
- patreon: # Replace with a single Patreon username
3
+ github: [everfu] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: everfu # Replace with a single Patreon username
5
5
  open_collective: # Replace with a single Open Collective username
6
6
  ko_fi: # Replace with a single Ko-fi username
7
7
  tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
@@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
10
10
  issuehunt: # Replace with a single IssueHunt username
11
11
  otechie: # Replace with a single Otechie username
12
12
  lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13
- custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13
+ custom: ['https://afdian.net/a/everfu', 'https://s3.qjqq.cn/47/66374315ebd08.webp!color', 'https://s3.qjqq.cn/47/663742bac8e52.webp!color'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
package/_config.yml CHANGED
@@ -909,6 +909,18 @@ right_menu:
909
909
  # class:
910
910
  # icon: st-afdian-line
911
911
 
912
+ # 哀悼模式,网页黑白
913
+ # Mourning mode, web page black and white
914
+ memorial:
915
+ enable: false
916
+ # 日期, (M-D)
917
+ # Date, (M-D)
918
+ # eg: 7-8, 9-18, 12-13 ...
919
+ date:
920
+ - "7-8" #七八卢沟桥事变
921
+ - "9-18" #九一八事变/建军节
922
+ - "12-13" #南京国家公祭日
923
+
912
924
  # CDN
913
925
  # Don't modify the following settings unless you know how they work
914
926
  # 非必要请不要修改
@@ -93,6 +93,8 @@ aside:
93
93
  toc: Table of contents
94
94
  tagmore: View all
95
95
  avatar: Avatar
96
+ hello: Long time no see,
97
+ back: Welcome back again,
96
98
  sticker: Mood sticker
97
99
  newpost: New posts
98
100
  card:
package/languages/en.yml CHANGED
@@ -93,6 +93,8 @@ aside:
93
93
  toc: Table of contents
94
94
  tagmore: View all
95
95
  avatar: Avatar
96
+ hello: Long time no see,
97
+ back: Welcome back again,
96
98
  sticker: Mood sticker
97
99
  newpost: New posts
98
100
  card:
@@ -95,6 +95,8 @@ aside:
95
95
  toc: 文章目录
96
96
  tagmore: 查看全部
97
97
  avatar: 头像
98
+ hello: 好久不见,
99
+ back: 欢迎再次回来,
98
100
  sticker: 心情贴纸
99
101
  newpost: 最近发布
100
102
  card:
@@ -95,6 +95,8 @@ aside:
95
95
  toc: 文章目錄
96
96
  tagmore: 查看全部
97
97
  avatar: 头像
98
+ hello: 好久不見,
99
+ back: 歡迎再次回來,
98
100
  sticker: 心情贴纸
99
101
  newpost: 最近发布
100
102
  card:
@@ -23,6 +23,7 @@
23
23
  }
24
24
 
25
25
  const sayhello2 = theme.aside?.card?.sayhello2?.map(item => `"${item}"`) || [];
26
+ const [hello_prefix, hello_back] = [_p('aside.hello'), _p('aside.back')];
26
27
 
27
28
  let comment = false
28
29
 
@@ -149,6 +150,10 @@ script.
149
150
  goodnight: '!{theme.aside.card.sayhello.goodnight}',
150
151
  },
151
152
  sayhello2: [!{sayhello2}],
153
+ sayhello3: {
154
+ prefix: '!{hello_prefix}',
155
+ back: '!{hello_back}',
156
+ },
152
157
  },
153
158
  covercolor: {
154
159
  enable: !{theme.post.covercolor.enable}
@@ -27,12 +27,23 @@ include ../head/pwa.pug
27
27
 
28
28
  script.
29
29
  console.log(
30
- "%c Program: Hexo %c Theme: Solitude %c Version: v1.11.0",
30
+ "%c Program: Hexo %c Theme: Solitude %c Version: v1.11.1",
31
31
  "border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
32
32
  "padding: 5px 10px;color:white;background:#3e9f50;",
33
33
  "padding: 5px 10px;color:white;background:#0084ff;border-radius:0 5px 5px 0",
34
34
  )
35
35
 
36
+ if theme.memorial.enable
37
+ script.
38
+ let mdate = "!{theme.memorial.date}";
39
+ mdate = (mdate.split(","));
40
+ let ndate = new Date();
41
+ for (let i of mdate) {
42
+ if (i == (ndate.getMonth()+1) + "-" + (ndate.getDate())) {
43
+ document.documentElement.classList.add('memorial');
44
+ }
45
+ }
46
+
36
47
  if theme.extends.head
37
48
  each item in theme.extends.head
38
49
  != item
@@ -40,6 +40,10 @@ if theme.says.enable
40
40
  .bber-info-time
41
41
  i.solitude.st-calendar-todo-fill
42
42
  time.datetime(datetime=moment(item.date).format())
43
+ if item.location
44
+ .bber-info-location
45
+ i.solitude.st-map-pin-fill
46
+ | #{item.location}
43
47
  if item.link
44
48
  a.bber-content-link(href=url_for(item.link) target="_blank")
45
49
  i.solitude.st-link-m-line
@@ -10,26 +10,53 @@
10
10
  #statistic
11
11
  .post-tips
12
12
  = _p('about.other.tj.post_tip')
13
- a(href="https://v6.51.la/") 51la网站统计
14
-
15
- script.
16
- fetch("#{tj.url}")
17
- .then(res => res.text())
18
- .then(data => {
19
- const title = ["最近活跃", "今日人数", "今日访问", "昨日人数", "昨日访问", "本月访问", "总访问量"];
20
- let num = data.match(/(<\/span><span>).*?(\/span><\/p>)/g);
21
- num = num.map(el => {
22
- let val = el.replace(/(<\/span><span>)/g, "");
23
- return val.replace(/(<\/span><\/p>)/g, "");
24
- });
25
- const s = document.getElementById("statistic");
26
- let html = '';
27
- for (let i = 0; i < num.length; i++) {
28
- if (i === 0 || i === num.length - 1) continue;
29
- html += `<div><span>${title[i]}</span><span id="${title[i]}">${num[i]}</span></div>`;
30
- }
31
- s.innerHTML = html;
32
- });
13
+ case tj.provider
14
+ when '51la'
15
+ a(href="https://v6.51.la/") 51la网站统计
16
+ when 'baidu'
17
+ a(href="https://tongji.baidu.com/") 百度统计
18
+ if tj.button
19
+ .banner-button-group
20
+ a.banner-button(href=url_for(tj.button_link))
21
+ i.solitude.st-right-btn-fill
22
+ span.banner-button-text= tj.button_text
23
+
24
+ case tj.provider
25
+ when '51la'
26
+ script.
27
+ fetch("#{tj.url}")
28
+ .then(res => res.text())
29
+ .then(data => {
30
+ const title = ["最近活跃", "今日人数", "今日访问", "昨日人数", "昨日访问", "本月访问", "总访问量"];
31
+ let num = data.match(/(<\/span><span>).*?(\/span><\/p>)/g);
32
+ num = num.map(el => {
33
+ let val = el.replace(/(<\/span><span>)/g, "");
34
+ return val.replace(/(<\/span><\/p>)/g, "");
35
+ });
36
+ const s = document.getElementById("statistic");
37
+ let html = '';
38
+ for (let i = 0; i < num.length; i++) {
39
+ if (i === 0 || i === num.length - 1) continue;
40
+ html += `<div><span>${title[i]}</span><span id="${title[i]}">${num[i]}</span></div>`;
41
+ }
42
+ s.innerHTML = html;
43
+ });
44
+ when 'baidu'
45
+ script.
46
+ fetch("#{tj.url}")
47
+ .then(res => res.json())
48
+ .then(data => {
49
+ const title = {"today_uv": "今日人数", "today_pv": "今日访问", "yesterday_uv": "昨日人数", "yesterday_pv": "昨日访问", "last_month_pv": "最近月访问", "last_year_pv": "最近年访问"};
50
+
51
+ let s = document.getElementById("statistic");
52
+
53
+ for (let key in data) {
54
+ if (data.hasOwnProperty(key) && title[key]) {
55
+ s.innerHTML += `<div><span>${title[key]}</span><span id="${key}">${data[key]}</span></div>`;
56
+ }
57
+ }
58
+ });
59
+
33
60
 
34
61
  if oneself
35
62
  style.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by EverFu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -422,4 +422,12 @@ span.tags-punctuation::before
422
422
 
423
423
  #post-info &
424
424
  font-size 14px
425
- line-height 32px
425
+ line-height 32px
426
+
427
+ if hexo-config('memorial.enable')
428
+ .memorial
429
+ -webkit-filter grayscale(100%)
430
+ -moz-filter grayscale(100%)
431
+ -ms-filter grayscale(100%)
432
+ -o-filter grayscale(100%)
433
+ filter grayscale(100%)
@@ -197,6 +197,9 @@
197
197
  padding 0 8px
198
198
  margin 0 4px
199
199
 
200
+ .footer-bar-link
201
+ margin 0
202
+
200
203
  .footer-bar-link
201
204
  margin 0 4px
202
205
  color var(--efu-fontcolor)
@@ -13,7 +13,7 @@ span.tags-punctuation
13
13
  color var(--efu-gray)
14
14
  font-size 14px;
15
15
  position absolute
16
- bottom 2rem
16
+ bottom 1rem
17
17
  left 2rem
18
18
 
19
19
  +maxWidth768()
@@ -22,6 +22,7 @@ span.tags-punctuation
22
22
  a
23
23
  color var(--efu-gray)
24
24
  border none
25
+ margin-left 4px
25
26
 
26
27
  &:hover
27
28
  color var(--efu-main)
@@ -13,7 +13,7 @@
13
13
  transition .3s
14
14
 
15
15
  .tags-group-wrapper
16
- margin-top 20px
16
+ margin-top 40px
17
17
  display flex
18
18
  flex-wrap nowrap
19
19
  animation rowleft 60s linear infinite
@@ -28,7 +28,7 @@
28
28
  justify-content space-between
29
29
  flex-direction row
30
30
  flex-wrap wrap
31
- margin-top 1rem
31
+ margin-top 4px
32
32
  margin-bottom 2rem
33
33
 
34
34
  div
@@ -61,6 +61,9 @@
61
61
  +maxWidth1200()
62
62
  overflow-x auto
63
63
 
64
+ &::-webkit-scrollbar
65
+ display none
66
+
64
67
  +minWidth1201()
65
68
  display flex
66
69
  flex-direction row
@@ -132,11 +132,6 @@ div#banners
132
132
  font-weight 700
133
133
  box-shadow var(--efu-shadow-blackdeep)
134
134
 
135
- #page &
136
- +maxWidth768()
137
- width 50px
138
- height 50px
139
-
140
135
  &:nth-child(even)
141
136
  margin-top 1rem
142
137
  transform translate(-60px)
@@ -224,7 +219,7 @@ div#banners
224
219
 
225
220
  .banner-button-group
226
221
  position absolute
227
- bottom 1.5rem
222
+ bottom 1rem
228
223
  right 2rem
229
224
 
230
225
  .banner-button
@@ -106,7 +106,8 @@ if hexo-config('says.enable')
106
106
  .fa-rectangles-mixed
107
107
  margin-right 8px
108
108
 
109
- .bber-info-time
109
+ .bber-info-time, .bber-info-location
110
+ margin-right .5rem
110
111
  color var(--efu-fontcolor)
111
112
  font-size .7rem
112
113
  background-color var(--efu-gray-op)
@@ -131,7 +132,7 @@ if hexo-config('says.enable')
131
132
 
132
133
  .bber-content-link
133
134
  display flex
134
- margin-left .5rem
135
+ margin-right .5rem
135
136
  color var(--efu-secondtext)
136
137
  font-size .7rem
137
138
  align-items center
package/source/js/main.js CHANGED
@@ -155,6 +155,8 @@ const handleThemeChange = mode => {
155
155
 
156
156
  // lastSayHello 上次打招呼的内容
157
157
  let lastSayHello = "";
158
+ // 用于记录标签页是否被隐藏,从而改变下次执行打招呼的内容
159
+ let wasPageHidden = false;
158
160
  // musicPlaying 是否正在播放音乐
159
161
  let musicPlaying = false
160
162
  // is_rm 是否启用右键菜单
@@ -391,12 +393,35 @@ let sco = {
391
393
  if (el) {
392
394
  const hours = new Date().getHours();
393
395
  const lang = GLOBAL_CONFIG.aside.sayhello;
396
+
397
+ const localData = getLocalData(['twikoo', 'WALINE_USER_META', 'WALINE_USER', '_v_Cache_Meta', 'ArtalkUser']);
398
+
399
+ function getLocalData(keys) {
400
+ for (let key of keys) {
401
+ const data = localStorage.getItem(key);
402
+ if (data) {
403
+ console.log(key, data);
404
+ return JSON.parse(data);
405
+ }
406
+ }
407
+ return null;
408
+ };
409
+ const nick = localData ? (localData.nick ? localData.nick : localData.display_name) : null;
410
+
411
+ let prefix;
412
+ if (wasPageHidden) {
413
+ prefix = GLOBAL_CONFIG.aside.sayhello3.back + nick;
414
+ wasPageHidden = false;
415
+ } else {
416
+ prefix = GLOBAL_CONFIG.aside.sayhello3.prefix + nick;
417
+ }
418
+
394
419
  const greetings = [
395
- {start: 0, end: 5, text: lang.goodnight},
396
- {start: 6, end: 10, text: lang.morning},
397
- {start: 11, end: 14, text: lang.noon},
398
- {start: 15, end: 18, text: lang.afternoon},
399
- {start: 19, end: 24, text: lang.night},
420
+ {start: 0, end: 5, text: nick ? prefix : lang.goodnight},
421
+ {start: 6, end: 10, text: nick ? prefix : lang.morning},
422
+ {start: 11, end: 14, text: nick ? prefix : lang.noon},
423
+ {start: 15, end: 18, text: nick ? prefix : lang.afternoon},
424
+ {start: 19, end: 24, text: nick ? prefix : lang.night},
400
425
  ];
401
426
  const greeting = greetings.find(g => hours >= g.start && hours <= g.end);
402
427
  el.innerText = greeting.text;
@@ -804,6 +829,12 @@ window.refreshFn = () => {
804
829
  document.addEventListener('DOMContentLoaded', () => {
805
830
  [addCopyright, sco.initConsoleState, window.refreshFn, asideStatus, () => window.onscroll = percent].forEach(fn => fn());
806
831
  });
832
+ // 监听切换标签页
833
+ document.addEventListener('visibilitychange', () => {
834
+ if (document.hidden) {
835
+ wasPageHidden = true;
836
+ }
837
+ });
807
838
  // 一些快捷键绑定
808
839
  window.onkeydown = e => {
809
840
  const {keyCode, ctrlKey, shiftKey} = e;