hexo-theme-solitude 1.11.0 → 1.11.2

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/README.md CHANGED
@@ -38,7 +38,7 @@
38
38
  [![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
39
39
  [![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)
40
40
 
41
- [文档 & 预览](https://solitude.js.org/)
41
+ [文档](https://solitude.js.org/)丨[预览](https://www.efu.me/)
42
42
 
43
43
  </div>
44
44
 
@@ -60,7 +60,7 @@
60
60
  - [x] 双评论
61
61
  - [x] 相册
62
62
  - [x] 弹幕留言页
63
- - [ ] 首页顶部新样式
63
+ - [x] 首页顶部新样式
64
64
 
65
65
  > 如有问题请提 [issue](https://github.com/valor-x/hexo-theme-solitude/issues)
66
66
 
@@ -87,4 +87,4 @@
87
87
 
88
88
  ## 版权
89
89
 
90
- [MIT](./LICENSE) License &copy; 2023-至今 [EverFu](https://github.com/efuo)
90
+ [MIT](./LICENSE) License &copy; 2023-至今 [EverFu](https://github.com/efuo)
package/README_en-US.md CHANGED
@@ -38,7 +38,7 @@
38
38
  [![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
39
39
  [![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)
40
40
 
41
- [Documentation & Preview](https://solitude.js.org/)
41
+ [Documentation](https://solitude.js.org/)丨[Preview](https://www.efu.me/)
42
42
 
43
43
  </div>
44
44
 
@@ -87,4 +87,4 @@ Check out the [Documentation](https://solitude.js.org/) for more information.
87
87
 
88
88
  ## License
89
89
 
90
- [MIT](./LICENSE) License &copy; 2023-PRESENT [EverFu](https://github.com/efuo)
90
+ [MIT](./LICENSE) License &copy; 2023-PRESENT [EverFu](https://github.com/efuo)
package/README_zh-Hant.md CHANGED
@@ -38,7 +38,7 @@
38
38
  [![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
39
39
  [![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)
40
40
 
41
- [文档 & 預覽](https://solitude.js.org/)
41
+ [文档](https://solitude.js.org/)丨[預覽](https://www.efu.me/)
42
42
 
43
43
  </div>
44
44
 
@@ -85,4 +85,4 @@
85
85
 
86
86
  ## 版權
87
87
 
88
- [MIT](./LICENSE) License &copy; 2023-至今 [Efu](https://github.com/efuo)
88
+ [MIT](./LICENSE) License &copy; 2023-至今 [Efu](https://github.com/efuo)
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.2",
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.
@@ -1,5 +1,5 @@
1
1
  - const { server, site, option } = theme.artalk
2
- - const { lazyload, count ,use} = theme.comment
2
+ - const { lazyload ,use} = theme.comment
3
3
 
4
4
  script.
5
5
  (() => {
@@ -10,7 +10,7 @@ script.
10
10
  server: '!{server}',
11
11
  site: "!{site}",
12
12
  pageKey: location.pathname,
13
- darkMode: document.documentElement.getAttribute('data-theme') === 'dark',
13
+ darkMode: document.documentElement.getAttribute('data-theme') === 'dark'
14
14
  }, !{JSON.stringify(option)})
15
15
  if (GLOBAL_CONFIG.lightbox === 'null') return
16
16
  artalkItem.on('list-loaded', () => {
@@ -1,23 +1,32 @@
1
1
  - const { server, site, option } = theme.artalk
2
- - const avatarCdn = option !== null && option.gravatar && option.gravatar.mirror
3
- - const avatarDefault = option !== null && option.gravatar && (option.gravatar.params || option.gravatar.default)
2
+ - const avatarCdn = theme.comment.avatar
4
3
 
5
4
  script.
6
5
  window.addEventListener('load', () => {
7
6
  const changeContent = content => {
8
- if (content === '') return content
7
+ if (content === '') return content;
9
8
  const replacements = [
10
- {regex: /<img.*?src="(.*?)"?[^\>]+>/ig, replacement: '[!{_p("console.newest_comment.image")}]'},
9
+ {
10
+ regex: /<img.*?src="(.*?)"?[^\>]+>/ig,
11
+ replacement: '[!{_p("console.newest_comment.image")}]'
12
+ },
11
13
  {
12
14
  regex: /<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi,
13
15
  replacement: '[!{_p("console.newest_comment.link")}]'
14
16
  },
15
- {regex: /<pre><code>.*?<\/pre>/gi, replacement: '[!{_p("console.newest_comment.code")}]'},
16
- {regex: /<[^>]+>/g, replacement: ''}
17
- ]
18
- content = replacements.reduce((str, {regex, replacement}) => str.replace(regex, replacement), content)
19
- return content.length > 150 ? content.substring(0, 150) + '...' : content
20
- }
17
+ {
18
+ regex: /<pre><code>.*?<\/pre>/gi,
19
+ replacement: '[!{_p("console.newest_comment.code")}]'
20
+ },
21
+ {
22
+ regex: /<[^>]+>/g,
23
+ replacement: ''
24
+ }
25
+ ];
26
+ content = replacements.reduce((str, {regex, replacement}) => str.replace(regex, replacement), content);
27
+ return content.length > 150 ? content.substring(0, 150) + '...' : content;
28
+ };
29
+
21
30
  const generateHtml = (array, asideList) => {
22
31
  asideList.innerHTML = array.length ? array.map(item => `
23
32
  <div class='aside-list-item'>
@@ -30,58 +39,56 @@ script.
30
39
  <time class="datetime" datetime="${item.date}"></time>
31
40
  </div>
32
41
  </div>
33
- `).join('') : "!{_p('newest_comment.zero')}"
34
- window.lazyLoadInstance?.update()
35
- window.pjax?.refresh()
36
- sco?.changeTimeFormat(document.querySelectorAll('.aside-list-item time'))
37
- }
42
+ `).join('') : "!{_p('newest_comment.zero')}";
43
+ window.lazyLoadInstance?.update();
44
+ window.pjax?.refresh();
45
+ sco?.changeTimeFormat(document.querySelectorAll('.aside-list-item time'));
46
+ };
38
47
 
39
48
  const getSetting = async () => {
40
49
  try {
41
- const res = await fetch('!{server}/api/v2/conf', {method: 'GET'})
42
- return await res.json()
50
+ const res = await fetch('!{server}/api/v2/conf', {method: 'GET'});
51
+ return await res.json();
43
52
  } catch (e) {
44
- console.error(e)
45
- return null
53
+ console.error(e);
54
+ return null;
46
55
  }
47
- }
56
+ };
48
57
 
49
58
  const getComment = async (asideList) => {
50
- const searchParams = new URLSearchParams({'site_name': "!{site}", 'limit': '6'})
59
+ const searchParams = new URLSearchParams({'site_name': "!{site}", 'limit': '6'});
51
60
  await fetch(`!{server}/api/v2/stats/latest_comments?${searchParams}`, {method: 'GET'}).then(async res => {
52
- const result = await res.json()
53
- const avatarConfig = await getSetting()
54
- const {mirror, params, default: defaults} = avatarConfig.frontend_conf.gravatar
55
- const avatarCdn = !{avatarCdn} || mirror
56
- let avatarDefault = !{avatarDefault} || params || defaults
57
- avatarDefault = avatarDefault.startsWith('d=') ? avatarDefault : `d=${avatarDefault}`
61
+ const result = await res.json();
62
+ const avatarConfig = await getSetting();
63
+ const avatarCdn = '!{avatarCdn}' + '/avatar/';
64
+ const params = avatarConfig?.gravatar?.params || '';
58
65
  const artalk = result.data.map(e => ({
59
- avatar: `${avatarCdn}${e.email_encrypted}?${avatarDefault}`,
66
+ avatar: avatarCdn + e.email_encrypted + '?' + params,
60
67
  content: changeContent(e.content_marked),
61
68
  nick: e.nick,
62
- url: e.page_key,
69
+ url: e.page_key + `#atk-comment-${e.id}`,
63
70
  date: e.date,
64
- })).slice(0, 6)
65
- utils.saveToLocal.set('artalk-newest-comments', artalk, !{theme.comment.newest_comment.storage})
66
- generateHtml(artalk, asideList)
71
+ })).slice(0, 6);
72
+ utils.saveToLocal.set('artalk-newest-comments', artalk, !{theme.comment.newest_comment.storage});
73
+ generateHtml(artalk, asideList);
67
74
  }).catch(error => {
68
75
  console.error(error);
69
- asideList.textContent = "!{_p('newest_comment.error')}"
70
- })
71
- }
76
+ asideList.textContent = "!{_p('newest_comment.error')}";
77
+ });
78
+ };
72
79
 
73
80
  const newestCommentInit = (asideList) => {
74
- const data = utils.saveToLocal.get('artalk-newest-comments')
81
+ const data = utils.saveToLocal.get('artalk-newest-comments');
75
82
  if (data) {
76
- generateHtml(data, asideList)
83
+ generateHtml(data, asideList);
77
84
  } else {
78
- getComment(asideList)
85
+ getComment(asideList);
79
86
  }
80
- }
87
+ };
81
88
 
82
- const $asideList = document.querySelector('#card-newest-comments .aside-list')
89
+ const $asideList = document.querySelector('#card-newest-comments .aside-list');
83
90
  if ($asideList) {
84
- newestCommentInit($asideList)
85
- utils.addGlobalFn('pjaxComplete', () => newestCommentInit($asideList), 'artalk_newestComment')
91
+ newestCommentInit($asideList);
92
+ utils.addGlobalFn('pjaxComplete', () => newestCommentInit($asideList), 'artalk_newestComment');
86
93
  }
87
94
  });
package/layout/post.pug CHANGED
@@ -3,7 +3,7 @@ extends includes/layout.pug
3
3
  block content
4
4
  main.layout#content-inner
5
5
  #post
6
- if theme.post_ai.enable
6
+ if theme.post_ai.enable && page.ai
7
7
  include includes/widgets/post/post-ai
8
8
  article.post-content#article-container!= page.content
9
9
  include includes/widgets/post/copyright
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.2",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by EverFu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
package/plugins.yml CHANGED
@@ -5,7 +5,7 @@ algolia_search:
5
5
  instantsearch:
6
6
  name: instantsearch.js
7
7
  file: dist/instantsearch.production.min.js
8
- version: 4.68.1
8
+ version: 4.70.0
9
9
  pjax:
10
10
  name: pjax
11
11
  file: pjax.min.js
@@ -13,16 +13,16 @@ pjax:
13
13
  twikoo:
14
14
  name: twikoo
15
15
  file: dist/twikoo.all.min.js
16
- version: 1.6.32
16
+ version: 1.6.36
17
17
  waline_js:
18
18
  name: '@waline/client'
19
19
  file: dist/waline.js
20
20
  other_name: waline
21
- version: 3.1.3
21
+ version: 3.2.1
22
22
  waline_css:
23
23
  name: '@waline/client'
24
24
  file: dist/waline.css
25
- version: 3.1.3
25
+ version: 3.2.1
26
26
  other_name: waline
27
27
  valine:
28
28
  name: valine
@@ -110,7 +110,7 @@ fancyapps_css:
110
110
  mermaid_js:
111
111
  name: mermaid
112
112
  file: dist/mermaid.min.js
113
- version: 10.9.0
113
+ version: 10.9.1
114
114
  blueimp_md5:
115
115
  name: blueimp-md5
116
116
  file: js/md5.min.js
@@ -11,6 +11,7 @@ hexo.extend.filter.register('after_post_render', function (data) {
11
11
  data.cover = data.cover || cover[getRandomInt(0, cover?.length)]
12
12
  data.excerpt = data.description || data.excerpt
13
13
  data.toc = !!(config.aside.toc.post && data.toc !== false)
14
+ data.ai = data.ai !== false
14
15
  }
15
16
  if (data.layout === 'page') {
16
17
  let {cover} = hexo.theme.config.page.default
@@ -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%)
@@ -56,6 +56,7 @@
56
56
  margin-right .5rem
57
57
  width 40%
58
58
  height 100%
59
+ min-width fit-content
59
60
 
60
61
  +maxWidth1300()
61
62
  display none
@@ -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)
@@ -10,7 +10,6 @@
10
10
  background 0 center
11
11
 
12
12
  #nav
13
- z-index 998
14
13
  transition .3s
15
14
  background var(--efu-card-bg)
16
15
 
@@ -187,7 +186,6 @@
187
186
  #nav
188
187
  position fixed
189
188
  top 0
190
- z-index 103
191
189
  transition .3s
192
190
  box-shadow none
193
191
  background var(--efu-card-bg)
@@ -287,7 +285,7 @@
287
285
  padding 0
288
286
  position absolute
289
287
  top 0
290
- z-index 90
288
+ z-index 10
291
289
  display flex
292
290
  flex-wrap wrap
293
291
  -webkit-box-align center
@@ -307,7 +305,6 @@
307
305
  top 0
308
306
  transition .2s
309
307
  position fixed
310
- z-index 91
311
308
  opacity 1
312
309
  filter none
313
310
 
@@ -862,8 +859,6 @@ if hexo-config('nav.group')
862
859
  height 35px
863
860
  line-height 35px
864
861
  border-radius 40px
865
- if hexo-config('language') == 'en'
866
- letter-spacing 0
867
862
 
868
863
  #travellings_button
869
864
  display inline
@@ -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,34 @@ 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
+ return JSON.parse(data);
404
+ }
405
+ }
406
+ return null;
407
+ };
408
+ const nick = localData ? (localData.nick ? localData.nick : localData.display_name) : null;
409
+
410
+ let prefix;
411
+ if (wasPageHidden) {
412
+ prefix = GLOBAL_CONFIG.aside.sayhello3.back + nick;
413
+ wasPageHidden = false;
414
+ } else {
415
+ prefix = GLOBAL_CONFIG.aside.sayhello3.prefix + nick;
416
+ }
417
+
394
418
  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},
419
+ {start: 0, end: 5, text: nick ? prefix : lang.goodnight},
420
+ {start: 6, end: 10, text: nick ? prefix : lang.morning},
421
+ {start: 11, end: 14, text: nick ? prefix : lang.noon},
422
+ {start: 15, end: 18, text: nick ? prefix : lang.afternoon},
423
+ {start: 19, end: 24, text: nick ? prefix : lang.night},
400
424
  ];
401
425
  const greeting = greetings.find(g => hours >= g.start && hours <= g.end);
402
426
  el.innerText = greeting.text;
@@ -804,6 +828,12 @@ window.refreshFn = () => {
804
828
  document.addEventListener('DOMContentLoaded', () => {
805
829
  [addCopyright, sco.initConsoleState, window.refreshFn, asideStatus, () => window.onscroll = percent].forEach(fn => fn());
806
830
  });
831
+ // 监听切换标签页
832
+ document.addEventListener('visibilitychange', () => {
833
+ if (document.hidden) {
834
+ wasPageHidden = true;
835
+ }
836
+ });
807
837
  // 一些快捷键绑定
808
838
  window.onkeydown = e => {
809
839
  const {keyCode, ctrlKey, shiftKey} = e;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * efuAI
3
- * author: @efuo
4
- * version: 1.0.0
2
+ * author: Efu
3
+ * email: o@efu.me
4
+ * website: https://efu.me
5
5
  */
6
- const _0x13613d=_0x413b;function _0x413b(_0x2b151b,_0x2765b5){const _0x2e2ac7=_0x2e2a();return _0x413b=function(_0x413be1,_0x2731a7){_0x413be1=_0x413be1-0x6a;let _0x48e6e4=_0x2e2ac7[_0x413be1];return _0x48e6e4;},_0x413b(_0x2b151b,_0x2765b5);}(function(_0x23c5ad,_0x1d8983){const _0x4a3867=_0x413b,_0x549d7e=_0x23c5ad();while(!![]){try{const _0x23e9f6=parseInt(_0x4a3867(0xa9))/0x1*(-parseInt(_0x4a3867(0x95))/0x2)+parseInt(_0x4a3867(0x7d))/0x3*(-parseInt(_0x4a3867(0x83))/0x4)+-parseInt(_0x4a3867(0xb2))/0x5*(parseInt(_0x4a3867(0xb7))/0x6)+-parseInt(_0x4a3867(0x77))/0x7*(-parseInt(_0x4a3867(0x72))/0x8)+parseInt(_0x4a3867(0x7e))/0x9+-parseInt(_0x4a3867(0xb8))/0xa+parseInt(_0x4a3867(0x9f))/0xb*(parseInt(_0x4a3867(0x6f))/0xc);if(_0x23e9f6===_0x1d8983)break;else _0x549d7e['push'](_0x549d7e['shift']());}catch(_0xf0b15c){_0x549d7e['push'](_0x549d7e['shift']());}}}(_0x2e2a,0x24be2));class efuAI{constructor(){const _0x5c45b1=_0x413b;this[_0x5c45b1(0x98)]=_0x5c45b1(0xb1),this[_0x5c45b1(0x84)]=!0x1,this[_0x5c45b1(0x7c)]='',this[_0x5c45b1(0x8a)]=GLOBAL_CONFIG[_0x5c45b1(0xb3)],this[_0x5c45b1(0x90)]=!0x1;}['init'](){const _0x185d66=_0x413b;this[_0x185d66(0x90)]=!0x1,this[_0x185d66(0x7c)]=PAGE_CONFIG[_0x185d66(0x87)]?PAGE_CONFIG[_0x185d66(0x87)]+'':![],!this['aiPostExplanation']?this[_0x185d66(0xa6)]():this[_0x185d66(0x76)](Promise[_0x185d66(0x78)](this[_0x185d66(0x7c)])),this['AIEngine']();}['getTitleAndContent'](){const _0x1c05d3=_0x413b,_0x497431=document['getElementById'](_0x1c05d3(0x6d)),_0x1134ec=document[_0x1c05d3(0xb4)],_0x30a3a2=_0x497431[_0x1c05d3(0xa3)]('p'),_0x2d35eb=_0x497431['querySelectorAll'](_0x1c05d3(0x80));return(_0x1134ec+'\x20'+Array[_0x1c05d3(0xa0)](_0x2d35eb)[_0x1c05d3(0x9d)](Array[_0x1c05d3(0xa0)](_0x30a3a2))[_0x1c05d3(0x74)](_0x25a656=>_0x25a656[_0x1c05d3(0x88)][_0x1c05d3(0x86)](/https?:\/\/[^\s]+/g,''))[_0x1c05d3(0xac)]('\x20'))[_0x1c05d3(0xb0)](0x0,0x3e8);}async[_0x13613d(0xa6)](){const _0x23a9bd=_0x13613d;this[_0x23a9bd(0x76)](this['fetch'](document[_0x23a9bd(0xb4)],this[_0x23a9bd(0x96)](),this['config'][_0x23a9bd(0xaf)]));}async[_0x13613d(0x8f)](_0x22e80e,_0x3dcc90,_0x24437c){const _0xaf00b3=_0x13613d,_0x565c45=this[_0xaf00b3(0x98)]+'/?content='+encodeURIComponent(_0x3dcc90)+_0xaf00b3(0x7a)+_0x22e80e+_0xaf00b3(0x75)+encodeURIComponent(_0x24437c)+_0xaf00b3(0x92)+encodeURIComponent(window[_0xaf00b3(0x9e)][_0xaf00b3(0xad)]),_0x460d6f=await fetch(_0x565c45),_0x1b4076=await _0x460d6f[_0xaf00b3(0xa4)]();return _0x460d6f['ok']?(this[_0xaf00b3(0x7c)]=_0x1b4076['summary'],_0x1b4076['summary']):(console[_0xaf00b3(0xa1)]('Request\x20failed:',_0x1b4076[_0xaf00b3(0xa8)]),_0x1b4076['err_msg']);}['aiShowAnimation'](_0xad4d41,_0x42d337=!0x1){const _0x59e5bb=_0x13613d,_0x3e9d86=document[_0x59e5bb(0x8e)](_0x59e5bb(0x70)),_0xd29cf1=document[_0x59e5bb(0x8e)](_0x59e5bb(0xb5));if(!_0x3e9d86||this[_0x59e5bb(0x90)])return;this[_0x59e5bb(0x90)]=!0x0,this[_0x59e5bb(0x8c)](),_0xd29cf1[_0x59e5bb(0x8b)][_0x59e5bb(0x9b)](_0x59e5bb(0x85)),_0x3e9d86[_0x59e5bb(0x93)][_0x59e5bb(0x9a)]='block',_0x3e9d86[_0x59e5bb(0x7b)]=_0x59e5bb(0x89),setTimeout(()=>{const _0x40cf66=_0x59e5bb;let _0x214250,_0x4a5de1,_0x4f6a34=!0x0,_0x238416=0x0,_0x1792a7=!0x0;const _0x24b6fe=new IntersectionObserver(_0x46a81a=>{const _0x30414d=_0x413b;_0x4f6a34=_0x46a81a[0x0][_0x30414d(0x6e)],_0x4f6a34&&requestAnimationFrame(_0x4a5de1);},{'threshold':0x0});_0xad4d41['then'](_0x12449a=>{const _0x4a1249=_0x413b;_0x214250=performance[_0x4a1249(0xa7)](),_0x4a5de1=()=>{const _0x12a8a9=_0x4a1249;if(_0x238416<_0x12449a[_0x12a8a9(0x73)]&&_0x4f6a34){const _0x27454f=performance[_0x12a8a9(0xa7)](),_0x2ece04=_0x27454f-_0x214250,_0x493a62=_0x12449a['slice'](_0x238416,_0x238416+0x1),_0x29dd3e=/[,。!、?,.!?]/[_0x12a8a9(0x91)](_0x493a62),_0x323f23=/[a-zA-Z0-9]/[_0x12a8a9(0x91)](_0x493a62);_0x2ece04>=(_0x29dd3e?0x64*Math['random']()+0x64:_0x323f23?0xa:0x19)&&(_0x3e9d86[_0x12a8a9(0x88)]=_0x12449a[_0x12a8a9(0xb0)](0x0,_0x238416+0x1),_0x214250=_0x27454f,_0x238416++,_0x238416<_0x12449a[_0x12a8a9(0x73)]?_0x3e9d86[_0x12a8a9(0x7b)]=_0x12449a[_0x12a8a9(0xb0)](0x0,_0x238416)+_0x12a8a9(0x79):(_0x3e9d86['innerHTML']=_0x12449a,_0x3e9d86['style'][_0x12a8a9(0x9a)]='block',this[_0x12a8a9(0x90)]=!0x1,_0xd29cf1[_0x12a8a9(0x8b)]['remove'](_0x12a8a9(0x85)),_0x24b6fe[_0x12a8a9(0x82)](),_0x42d337&&this[_0x12a8a9(0x6a)]())),_0x4f6a34&&requestAnimationFrame(_0x4a5de1);}},_0x4f6a34&&_0x1792a7&&setTimeout(()=>{requestAnimationFrame(_0x4a5de1),_0x1792a7=!0x1;},0xbb8),_0x24b6fe['observe'](_0x3e9d86);})[_0x40cf66(0xab)](_0x497c7f=>{const _0x16a888=_0x40cf66;console[_0x16a888(0xa1)](_0x16a888(0x6c),_0x497c7f),_0x3e9d86[_0x16a888(0x7b)]='检索信息失败',_0x3e9d86['style'][_0x16a888(0x9a)]=_0x16a888(0x97),this[_0x16a888(0x90)]=!0x1,_0xd29cf1[_0x16a888(0x8b)][_0x16a888(0xa5)](_0x16a888(0x85)),_0x24b6fe[_0x16a888(0x82)]();});},0xbb8);}[_0x13613d(0x71)](){const _0xa48776=_0x13613d,_0x294414=document[_0xa48776(0x8e)](_0xa48776(0xb5));_0x294414&&_0x294414['addEventListener'](_0xa48776(0xa2),()=>{const _0x5e3005=_0xa48776;this['scoGPTIsRunning']||(this[_0x5e3005(0x84)]=!0x0,this['aiShowAnimation'](Promise['resolve'](this['config'][_0x5e3005(0xae)]),!0x0));});}[_0x13613d(0x8c)](){const _0x4e5582=_0x13613d,_0x355d20=document[_0x4e5582(0x8e)](_0x4e5582(0xb6));_0x355d20?_0x355d20[_0x4e5582(0x7b)]='':console[_0x4e5582(0xa1)](_0x4e5582(0xaa));}['createSuggestions'](){const _0x1196c6=_0x13613d;this[_0x1196c6(0x84)]&&(this[_0x1196c6(0x8c)](),this[_0x1196c6(0x99)](_0x1196c6(0x81),()=>{const _0x2d4131=_0x1196c6;''===this[_0x2d4131(0x7c)]?this[_0x2d4131(0xa6)]():this[_0x2d4131(0x76)](Promise[_0x2d4131(0x78)](this[_0x2d4131(0x7c)]),!0x0);}),this[_0x1196c6(0x8a)][_0x1196c6(0xb9)]&&this['createSuggestionItemWithAction']('带我去看看其他文章',()=>toRandomPost()),this[_0x1196c6(0x84)]=!0x0);}['createSuggestionItemWithAction'](_0x411977,_0x1ee9c4){const _0x15cc5f=_0x13613d,_0x5e399f=document[_0x15cc5f(0x8e)](_0x15cc5f(0xb6));if(!_0x5e399f)return void console['error']('无法找到具有class为ai-suggestions的元素');const _0x504608=document[_0x15cc5f(0x6b)]('div');_0x504608['classList'][_0x15cc5f(0x9b)](_0x15cc5f(0x94)),_0x504608[_0x15cc5f(0x9c)]=_0x411977,_0x504608[_0x15cc5f(0x7f)](_0x15cc5f(0xa2),_0x1ee9c4),_0x5e399f[_0x15cc5f(0x8d)](_0x504608);}}function _0x2e2a(){const _0x17cf3e=['loadingAI','replace','ai_text','innerText','生成中...<span\x20class=\x22blinking-cursor\x22></span>','config','classList','cleanSuggestions','appendChild','querySelector','fetch','scoGPTIsRunning','test','&url=','style','ai-suggestions-item','6YFtYAZ','getTitleAndContent','block','root','createSuggestionItemWithAction','display','add','textContent','concat','location','11mBQjxP','from','error','click','getElementsByTagName','json','remove','generate','now','err_msg','95089WLUpyk','没有这个元素:\x27ai-suggestions\x27','catch','join','href','talk','key','slice','https://summary.tianli0.top','106175QRactq','post_ai','title','.ai-tag','.ai-suggestions','66dgrcvD','2694560CoUACr','randomPost','createSuggestions','createElement','检索信息失败:','article-container','isIntersecting','11202588AcRnYR','.ai-explanation','AIEngine','32wwjFQL','length','map','&key=','aiShowAnimation','238161ujxgZE','resolve','<span\x20class=\x22blinking-cursor\x22></span>','&title=','innerHTML','aiPostExplanation','28326zDzbwu','267111zRGBLY','addEventListener','h1,\x20h2,\x20h3,\x20h4,\x20h5','这篇文章讲了什么?','disconnect','68AXICSD','aiTalkMode'];_0x2e2a=function(){return _0x17cf3e;};return _0x2e2a();}const efu_ai=new efuAI();
6
+ class efuAI{constructor(){this.root="https://summary.tianli0.top",this.aiTalkMode=!1,this.aiPostExplanation='',this.config=GLOBAL_CONFIG.post_ai,this.scoGPTIsRunning=!1}init(){if(!document.querySelector(".ai-explanation"))return;this.scoGPTIsRunning=!1;this.aiPostExplanation=PAGE_CONFIG.ai_text?PAGE_CONFIG.ai_text+"":false;if(!this.aiPostExplanation){this.generate()}else{this.aiShowAnimation(Promise.resolve(this.aiPostExplanation))}this.AIEngine()}getTitleAndContent(){const e=document.getElementById("article-container"),t=document.title,n=e.getElementsByTagName("p"),i=e.querySelectorAll("h1, h2, h3, h4, h5");return(t+" "+Array.from(i).concat(Array.from(n)).map((e=>e.innerText.replace(/https?:\/\/[^\s]+/g,""))).join(" ")).slice(0,1e3)}async generate(){this.aiShowAnimation(this.fetch(document.title,this.getTitleAndContent(),this.config.key))}async fetch(e,t,n){const i=`${this.root}/?content=${encodeURIComponent(t)}&title=${e}&key=${encodeURIComponent(n)}&url=${encodeURIComponent(window.location.href)}`,s=await fetch(i),o=await s.json();return s.ok?(this.aiPostExplanation=o.summary,o.summary):(console.error("Request failed:",o.err_msg),o.err_msg)}aiShowAnimation(e,t=!1){const n=document.querySelector(".ai-explanation"),i=document.querySelector(".ai-tag");if(!n||this.scoGPTIsRunning)return;this.scoGPTIsRunning=!0,this.cleanSuggestions(),i.classList.add("loadingAI"),n.style.display="block",n.innerHTML='生成中...<span class="blinking-cursor"></span>';let s,o,a=!0,c=0,r=!0;const l=new IntersectionObserver((e=>{a=e[0].isIntersecting,a&&requestAnimationFrame(o)}),{threshold:0});e.then((e=>{s=performance.now(),o=()=>{if(c<e.length&&a){const r=performance.now(),g=r-s,h=e.slice(c,c+1),u=/[,。!、?,.!?]/.test(h),m=/[a-zA-Z0-9]/.test(h);g>=(u?100*Math.random()+100:m?10:25)&&(n.innerText=e.slice(0,c+1),s=r,c++,c<e.length?n.innerHTML=e.slice(0,c)+'<span class="blinking-cursor"></span>':(n.innerHTML=e,n.style.display="block",this.scoGPTIsRunning=!1,i.classList.remove("loadingAI"),l.disconnect(),t&&this.createSuggestions())),a&&requestAnimationFrame(o)}},a&&r&&setTimeout((()=>{requestAnimationFrame(o),r=!1}),3e3),l.observe(n)})).catch((e=>{console.error("检索信息失败:",e),n.innerHTML="检索信息失败",n.style.display="block",this.scoGPTIsRunning=!1,i.classList.remove("loadingAI"),l.disconnect()}))}AIEngine(){const e=document.querySelector(".ai-tag");e&&e.addEventListener("click",(()=>{this.scoGPTIsRunning||(this.aiTalkMode=!0,this.aiShowAnimation(Promise.resolve(this.config.talk),!0))}))}cleanSuggestions(){const e=document.querySelector(".ai-suggestions");e?e.innerHTML="":console.error("没有这个元素:'ai-suggestions'")}createSuggestions(){this.aiTalkMode&&(this.cleanSuggestions(),this.createSuggestionItemWithAction("这篇文章讲了什么?",(()=>{""===this.aiPostExplanation?this.generate():this.aiShowAnimation(Promise.resolve(this.aiPostExplanation),!0)})),this.config.randomPost&&this.createSuggestionItemWithAction("带我去看看其他文章",(()=>toRandomPost())),this.aiTalkMode=!0)}createSuggestionItemWithAction(e,t){const n=document.querySelector(".ai-suggestions");if(!n)return void console.error("无法找到具有class为ai-suggestions的元素");const i=document.createElement("div");i.classList.add("ai-suggestions-item"),i.textContent=e,i.addEventListener("click",t),n.appendChild(i)}}const efu_ai=new efuAI;