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.
- package/.github/FUNDING.yml +3 -3
- package/_config.yml +12 -0
- package/languages/default.yml +2 -0
- package/languages/en.yml +2 -0
- package/languages/zh-CN.yml +2 -0
- package/languages/zh-TW.yml +2 -0
- package/layout/includes/head/config.pug +5 -0
- package/layout/includes/inject/head.pug +12 -1
- package/layout/includes/page/says.pug +4 -0
- package/layout/includes/widgets/page/about/other.pug +47 -20
- package/package.json +1 -1
- package/source/css/_global/index.styl +9 -1
- package/source/css/_layout/footer.styl +3 -0
- 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/other.styl +1 -6
- package/source/css/_page/says.styl +3 -2
- package/source/js/main.js +36 -5
package/.github/FUNDING.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# These are supported funding model platforms
|
2
2
|
|
3
|
-
github: [
|
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
|
# 非必要请不要修改
|
package/languages/default.yml
CHANGED
package/languages/en.yml
CHANGED
package/languages/zh-CN.yml
CHANGED
package/languages/zh-TW.yml
CHANGED
@@ -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.
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
@@ -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%)
|
@@ -13,7 +13,7 @@ span.tags-punctuation
|
|
13
13
|
color var(--efu-gray)
|
14
14
|
font-size 14px;
|
15
15
|
position absolute
|
16
|
-
bottom
|
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)
|
@@ -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
|
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-
|
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;
|