hexo-theme-solitude 1.10.6 → 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.
- package/.github/FUNDING.yml +3 -3
- package/_config.yml +28 -0
- package/languages/default.yml +5 -0
- package/languages/en.yml +5 -0
- package/languages/zh-CN.yml +5 -0
- package/languages/zh-TW.yml +5 -0
- package/layout/includes/console.pug +5 -1
- package/layout/includes/head/config.pug +5 -0
- package/layout/includes/inject/head.pug +12 -1
- package/layout/includes/page/recentcomment.pug +16 -0
- package/layout/includes/page/says.pug +4 -0
- package/layout/includes/widgets/page/about/other.pug +47 -20
- package/layout/includes/widgets/page/banner.pug +2 -2
- package/layout/includes/widgets/page/message/artalk.pug +45 -0
- package/layout/includes/widgets/page/message/js.pug +5 -1
- package/layout/includes/widgets/page/message/twikoo.pug +19 -16
- package/layout/includes/widgets/page/message/valine.pug +12 -3
- package/layout/includes/widgets/page/message/waline.pug +42 -0
- package/layout/includes/widgets/page/recentcomment/artalk.pug +78 -0
- package/layout/includes/widgets/page/recentcomment/twikoo.pug +83 -0
- package/layout/includes/widgets/page/recentcomment/valine.pug +79 -0
- package/layout/includes/widgets/page/recentcomment/waline.pug +72 -0
- package/layout/includes/widgets/third-party/comments/artalk.pug +1 -1
- package/layout/includes/widgets/third-party/news-comment/valine.pug +19 -17
- package/layout/includes/widgets/third-party/news-comment/waline.pug +3 -3
- package/layout/page.pug +2 -0
- package/package.json +1 -1
- package/plugins.yml +3 -3
- package/scripts/event/merge_config.js +7 -0
- package/source/css/_comments/comment.styl +1 -1
- package/source/css/_comments/valine.styl +1 -0
- package/source/css/_global/index.styl +9 -1
- package/source/css/_layout/console.styl +11 -0
- package/source/css/_layout/footer.styl +4 -1
- package/source/css/_layout/other.styl +2 -1
- package/source/css/_page/_about/skills.styl +1 -1
- package/source/css/_page/_about/statistic.styl +1 -1
- package/source/css/_page/_home/home-top.styl +3 -0
- package/source/css/_page/index.styl +3 -0
- package/source/css/_page/other.styl +1 -6
- package/source/css/_page/recentcomment.styl +85 -0
- package/source/css/_page/says.styl +5 -13
- package/source/js/main.js +36 -5
@@ -13,22 +13,13 @@ if hexo-config('says.home_mini')
|
|
13
13
|
user-select none
|
14
14
|
align-items center
|
15
15
|
padding .5rem 1rem
|
16
|
+
animation slide-in .6s 0s backwards
|
17
|
+
margin-bottom .5rem
|
16
18
|
|
17
19
|
&.more-page
|
18
20
|
margin-bottom 0
|
19
21
|
|
20
|
-
if hexo-config('hometop.enable')
|
21
|
-
margin-bottom 1rem
|
22
|
-
|
23
|
-
+maxWidth1300()
|
24
|
-
if hexo-config('hometop.enable')
|
25
|
-
margin-bottom 1rem
|
26
|
-
animation slide-in .6s 0s backwards
|
27
|
-
|
28
22
|
+minWidth1300()
|
29
|
-
if hexo-config('hometop.enable')
|
30
|
-
margin-bottom .5rem
|
31
|
-
animation slide-in .6s 0s backwards
|
32
23
|
&:hover
|
33
24
|
border var(--style-border-hover)
|
34
25
|
box-shadow var(--efu-shadow-main)
|
@@ -115,7 +106,8 @@ if hexo-config('says.enable')
|
|
115
106
|
.fa-rectangles-mixed
|
116
107
|
margin-right 8px
|
117
108
|
|
118
|
-
.bber-info-time
|
109
|
+
.bber-info-time, .bber-info-location
|
110
|
+
margin-right .5rem
|
119
111
|
color var(--efu-fontcolor)
|
120
112
|
font-size .7rem
|
121
113
|
background-color var(--efu-gray-op)
|
@@ -140,7 +132,7 @@ if hexo-config('says.enable')
|
|
140
132
|
|
141
133
|
.bber-content-link
|
142
134
|
display flex
|
143
|
-
margin-
|
135
|
+
margin-right .5rem
|
144
136
|
color var(--efu-secondtext)
|
145
137
|
font-size .7rem
|
146
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;
|