hexo-theme-solitude 1.3.1 → 1.4.0
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 +13 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +107 -0
- package/.github/ISSUE_TEMPLATE/config.yml +13 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +14 -0
- package/.github/workflows/npm-publish.yml +21 -0
- package/CONTRIBUTING.md +0 -0
- package/LICENSE +0 -0
- package/README.md +60 -43
- package/README_EN.md +60 -42
- package/_config.yml +606 -451
- package/languages/en-US.yml +3 -23
- package/languages/zh-CN.yml +3 -23
- package/layout/404.pug +0 -0
- package/layout/archive.pug +0 -0
- package/layout/category.pug +0 -0
- package/layout/includes/body/mode.pug +1 -6
- package/layout/includes/console.pug +3 -3
- package/layout/includes/footer.pug +16 -15
- package/layout/includes/head/config.pug +38 -30
- package/layout/includes/head/opengraph.pug +0 -0
- package/layout/includes/head/pwa.pug +5 -44
- package/layout/includes/head.pug +3 -1
- package/layout/includes/header.pug +0 -0
- package/layout/includes/inject/body.pug +114 -65
- package/layout/includes/inject/head.pug +11 -46
- package/layout/includes/layout.pug +1 -2
- package/layout/includes/loading.pug +0 -0
- package/layout/includes/mixins/articleSort.pug +0 -0
- package/layout/includes/mixins/pagination.pug +0 -0
- package/layout/includes/nav.pug +1 -1
- package/layout/includes/page/about.pug +1 -1
- package/layout/includes/page/categories.pug +0 -0
- package/layout/includes/page/default.pug +0 -0
- package/layout/includes/page/equipment.pug +0 -0
- package/layout/includes/page/links.pug +2 -2
- package/layout/includes/page/music.pug +0 -0
- package/layout/includes/page/not_configured.pug +0 -0
- package/layout/includes/page/rss.pug +3 -3
- package/layout/includes/page/says.pug +15 -15
- package/layout/includes/page/tags.pug +0 -0
- package/layout/includes/page/tlink.pug +1 -0
- package/layout/includes/recent-posts.pug +0 -0
- package/layout/includes/sidebar.pug +0 -0
- package/layout/includes/widgets/aside/aside.pug +6 -6
- package/layout/includes/widgets/aside/asideAllInfo.pug +0 -0
- package/layout/includes/widgets/aside/asideArchive.pug +0 -0
- package/layout/includes/widgets/aside/asideCustom.pug +1 -1
- package/layout/includes/widgets/aside/asideFlipCard.pug +0 -0
- package/layout/includes/widgets/aside/asideInfoCard.pug +3 -3
- package/layout/includes/widgets/aside/asideNewestPost.pug +0 -0
- package/layout/includes/widgets/aside/asideSwitch.pug +0 -4
- package/layout/includes/widgets/aside/asideTag.pug +1 -1
- package/layout/includes/widgets/aside/asideToc.pug +0 -0
- package/layout/includes/widgets/aside/asideWebInfo.pug +2 -2
- package/layout/includes/widgets/home/banner.pug +0 -0
- package/layout/includes/widgets/home/bb/json.pug +22 -0
- package/layout/includes/widgets/home/bb/local.pug +17 -0
- package/layout/includes/widgets/home/bb/memos.pug +25 -0
- package/layout/includes/widgets/home/bbTimeList.pug +11 -7
- package/layout/includes/widgets/home/categoryBar.pug +0 -0
- package/layout/includes/widgets/home/categoryGroup.pug +1 -1
- package/layout/includes/widgets/home/hometop.pug +0 -0
- package/layout/includes/widgets/home/postList.pug +0 -0
- package/layout/includes/widgets/home/topGroup.pug +0 -0
- package/layout/includes/widgets/nav/left.pug +0 -0
- package/layout/includes/widgets/nav/menu.pug +1 -1
- package/layout/includes/widgets/nav/right.pug +6 -5
- package/layout/includes/widgets/page/about/authorinfo.pug +10 -9
- package/layout/includes/widgets/page/about/award.pug +0 -0
- package/layout/includes/widgets/page/about/contentinfo.pug +35 -34
- package/layout/includes/widgets/page/about/hobbies.pug +21 -17
- package/layout/includes/widgets/page/about/motto.pug +17 -16
- package/layout/includes/widgets/page/about/other.pug +16 -16
- package/layout/includes/widgets/page/about/personalities.pug +15 -14
- package/layout/includes/widgets/page/about/skillsinfo.pug +37 -36
- package/layout/includes/widgets/page/about/tenyear.pug +0 -0
- package/layout/includes/widgets/page/banner.pug +9 -3
- package/layout/includes/widgets/page/equipment/content.pug +0 -0
- package/layout/includes/widgets/page/links/banner.pug +14 -12
- package/layout/includes/widgets/page/links/linksCard.pug +4 -6
- package/layout/includes/widgets/page/links/linksDiscn.pug +8 -0
- package/layout/includes/widgets/page/links/linksItem.pug +4 -6
- package/layout/includes/widgets/page/says/json.pug +80 -0
- package/layout/includes/widgets/page/says/local.pug +48 -0
- package/layout/includes/widgets/page/says/memos.pug +109 -0
- package/layout/includes/widgets/post/award.pug +0 -0
- package/layout/includes/widgets/post/copyright.pug +2 -2
- package/layout/includes/widgets/post/post-ai.pug +12 -0
- package/layout/includes/widgets/post/postMeta.pug +2 -2
- package/layout/includes/widgets/post/postNav.pug +0 -0
- package/layout/includes/widgets/post/wave.pug +0 -0
- package/layout/includes/widgets/randomlink.pug +1 -1
- package/layout/includes/widgets/rightside/index.pug +6 -5
- package/layout/includes/widgets/third-party/comments/comment.pug +1 -5
- package/layout/includes/widgets/third-party/comments/twikoo.pug +1 -1
- package/layout/includes/widgets/third-party/comments/waline.pug +9 -11
- package/layout/includes/widgets/third-party/music.pug +1 -1
- package/layout/includes/widgets/third-party/news-comment/newest-comment.pug +6 -0
- package/layout/includes/widgets/third-party/news-comment/twikoo.pug +70 -0
- package/layout/includes/widgets/third-party/news-comment/waline.pug +64 -0
- package/layout/includes/widgets/third-party/pjax.pug +0 -0
- package/layout/includes/widgets/third-party/search/algolia-search.pug +0 -0
- package/layout/includes/widgets/third-party/search/index.pug +8 -7
- package/layout/includes/widgets/third-party/search/local-search.pug +0 -0
- package/layout/index.pug +3 -3
- package/layout/page.pug +0 -4
- package/layout/post.pug +2 -2
- package/layout/tag.pug +0 -0
- package/package.json +18 -9
- package/plugins.yml +109 -0
- package/scripts/event/cdn.js +129 -0
- package/scripts/event/init.js +0 -0
- package/scripts/event/page.js +1 -21
- package/scripts/event/welcome.js +1 -1
- package/scripts/filter/checkThemeConfig.js +0 -0
- package/scripts/filter/default.js +0 -0
- package/scripts/filter/lazyload.js +1 -1
- package/scripts/filter/randomPosts.js +0 -0
- package/scripts/helper/cdn.js +0 -0
- package/scripts/helper/getArchiveLength.js +0 -0
- package/scripts/helper/page.js +0 -0
- package/scripts/helper/related_post.js +0 -0
- package/scripts/helper/stylus.js +0 -0
- package/scripts/tags/button.js +0 -0
- package/scripts/tags/bvideo.js +0 -0
- package/scripts/tags/card.js +0 -0
- package/scripts/tags/checkbox.js +0 -0
- package/scripts/tags/fold.js +0 -0
- package/scripts/tags/image.js +0 -0
- package/scripts/tags/inline-image.js +0 -0
- package/scripts/tags/label.js +0 -0
- package/scripts/tags/link.js +0 -0
- package/scripts/tags/media.js +0 -0
- package/scripts/tags/note.js +0 -0
- package/scripts/tags/span.js +0 -0
- package/scripts/tags/tabs.js +0 -0
- package/scripts/tags/timeline.js +0 -0
- package/scripts/tags/u.js +0 -0
- package/source/css/_global/animation.css +0 -0
- package/source/css/_global/function.styl +42 -42
- package/source/css/_global/index.styl +1 -1
- package/source/css/_global/var.styl +0 -0
- package/source/css/_layout/basic.styl +10 -12
- package/source/css/_layout/header.styl +7 -2
- package/source/css/_layout/index.styl +59 -5
- package/source/css/_mode/index.styl +1 -17
- package/source/css/_page/_home/category-bar.styl +0 -0
- package/source/css/_page/_home/home-top.styl +10 -31
- package/source/css/_page/_home/index.styl +0 -0
- package/source/css/_page/_home/pagination.styl +3 -0
- package/source/css/_page/_home/recent-post.styl +10 -3
- package/source/css/_page/about/index.styl +0 -0
- package/source/css/_page/about/tenyear.styl +0 -0
- package/source/css/_page/about.styl +9 -0
- package/source/css/_page/category.styl +0 -0
- package/source/css/_page/douban.styl +0 -1
- package/source/css/_page/equipment.styl +0 -0
- package/source/css/_page/error.styl +0 -0
- package/source/css/_page/home.styl +0 -0
- package/source/css/_page/index.styl +2 -3
- package/source/css/_page/links.styl +84 -49
- package/source/css/_page/moment.styl +0 -0
- package/source/css/_page/music.styl +0 -0
- package/source/css/_page/rss.styl +0 -0
- package/source/css/_page/says.styl +10 -0
- package/source/css/_page/tag.styl +0 -0
- package/source/css/_widgets/_aside/allinfo.styl +34 -0
- package/source/css/_widgets/_aside/flip.styl +0 -0
- package/source/css/_widgets/_aside/index.styl +1 -7
- package/source/css/_widgets/_aside/info.styl +0 -0
- package/source/css/_widgets/_aside/newPost.styl +0 -0
- package/source/css/_widgets/_aside/toc.styl +0 -0
- package/source/css/_widgets/_aside/welcome.styl +0 -0
- package/source/css/_widgets/_comment/index.styl +0 -0
- package/source/css/_widgets/_comment/twikoo.styl +0 -2
- package/source/css/_widgets/_comment/waline.styl +0 -0
- package/source/css/_widgets/_extra/console.styl +0 -0
- package/source/css/_widgets/_extra/fullpage.styl +0 -0
- package/source/css/_widgets/_extra/music.styl +1 -1
- package/source/css/_widgets/_extra/pace.styl +0 -0
- package/source/css/_widgets/_extra/rightmenu.styl +0 -0
- package/source/css/_widgets/_mixins/article-sort.styl +0 -0
- package/source/css/_widgets/_mixins/footer.styl +1 -2
- package/source/css/_widgets/_mixins/other.styl +0 -4
- package/source/css/_widgets/_mixins/sidebar.styl +0 -0
- package/source/css/_widgets/_post/_highlight/diff.styl +0 -0
- package/source/css/_widgets/_post/_highlight/index.styl +0 -1
- package/source/css/_widgets/_post/_highlight/theme/default.styl +0 -0
- package/source/css/_widgets/_post/_highlight/theme/mac.styl +0 -0
- package/source/css/_widgets/_post/_highlight/theme.styl +0 -0
- package/source/css/_widgets/_post/commentBarrage.styl +0 -0
- package/source/css/_widgets/_post/content.styl +42 -11
- package/source/css/_widgets/_post/copyright.styl +0 -0
- package/source/css/_widgets/_post/index.styl +1 -1
- package/source/css/_widgets/_post/meta.styl +0 -3
- package/source/css/_widgets/_post/pagination.styl +1 -1
- package/source/css/_widgets/_post/postAI.styl +0 -0
- package/source/css/_widgets/_post/relatedPost.styl +0 -0
- package/source/css/_widgets/_post/tools.styl +0 -0
- package/source/css/_widgets/_search/algolia-search.styl +0 -0
- package/source/css/_widgets/_search/local-search.styl +0 -0
- package/source/css/_widgets/_tags/button.styl +0 -0
- package/source/css/_widgets/_tags/bvideo.styl +0 -0
- package/source/css/_widgets/_tags/card.styl +0 -0
- package/source/css/_widgets/_tags/checkbox.styl +0 -0
- package/source/css/_widgets/_tags/fold.styl +0 -0
- package/source/css/_widgets/_tags/image.styl +0 -0
- package/source/css/_widgets/_tags/index.styl +0 -0
- package/source/css/_widgets/_tags/inline-image.styl +0 -0
- package/source/css/_widgets/_tags/label.styl +0 -0
- package/source/css/_widgets/_tags/link.styl +4 -2
- package/source/css/_widgets/_tags/note.styl +0 -0
- package/source/css/_widgets/_tags/span.styl +0 -0
- package/source/css/_widgets/_tags/tabs.styl +0 -0
- package/source/css/_widgets/_tags/timeline.styl +0 -1
- package/source/css/_widgets/index.styl +4 -4
- package/source/css/index.styl +0 -0
- package/source/img/avatar.png +0 -0
- package/source/img/default.png +0 -0
- package/source/img/error_load.png +0 -0
- package/source/js/{extend/comment/twikoo/commentBarrage.js → comment/twikoo_commentBarrage.js} +0 -0
- package/source/js/{extend/comment/waline/commentBarrage.js → comment/waline_commentBarrage.js} +0 -0
- package/source/js/covercolor/api.js +95 -0
- package/source/js/covercolor/local.js +154 -0
- package/source/js/main.js +28 -235
- package/source/js/music.js +0 -0
- package/source/js/rightside.js +404 -0
- package/source/js/{extend/search/algolia-search.js → search/algolia.js} +10 -0
- package/source/js/{extend/search/local-search.js → search/local.js} +24 -2
- package/source/js/utils.js +75 -1
- package/layout/includes/head/fest.pug +0 -22
- package/layout/includes/page/echarts.pug +0 -7
- package/layout/includes/page/moments.pug +0 -4
- package/layout/includes/widgets/aside/asideHistory.pug +0 -8
- package/layout/includes/widgets/aside/asideWelcome.pug +0 -12
- package/layout/includes/widgets/page/moments/angle.pug +0 -19
- package/layout/includes/widgets/page/moments/index.pug +0 -23
- package/layout/includes/widgets/page/says/saysBottom.pug +0 -11
- package/layout/includes/widgets/page/says/saysContent.pug +0 -6
- package/layout/includes/widgets/page/says/saysFunction.pug +0 -10
- package/layout/includes/widgets/page/says/saysMeta.pug +0 -7
- package/layout/includes/widgets/third-party/ai/index.pug +0 -12
- package/layout/includes/widgets/third-party/comments/gitalk.pug +0 -0
- package/layout/includes/widgets/third-party/comments/valine.pug +0 -0
- package/scripts/helper/echarts.js +0 -407
- package/source/css/_widgets/_aside/history.styl +0 -42
- package/source/js/extend/comment/twikoo/twikoo.js +0 -67
- package/source/js/extend/comment/waline/waline.js +0 -60
- package/source/lib/bundle.min.js +0 -27
- package/source/lib/circle.min.js +0 -1
- package/source/lib/cover-color.min.js +0 -7
- package/source/lib/friends_post.js +0 -4
- package/source/lib/lazyload.min.js +0 -1
- package/source/lib/rightside.min.js +0 -1
- package/source/lib/snackbar.min.css +0 -1
- package/source/lib/snackbar.min.js +0 -9
- package/source/lib/txmap.min.js +0 -1
- package/source/lib/universe.min.js +0 -1
- package/source/lib/view-image.min.js +0 -6
- package/source/lib/waterfall.min.js +0 -1
- /package/source/{lib → js}/sco-ai.min.js +0 -0
@@ -0,0 +1,404 @@
|
|
1
|
+
let rm = {};
|
2
|
+
|
3
|
+
rm.stopdragimg = Array.from(document.getElementsByTagName('img'));
|
4
|
+
rm.stopdragimg.forEach(function (img) {
|
5
|
+
img.addEventListener('dragstart', function () {
|
6
|
+
return false;
|
7
|
+
});
|
8
|
+
});
|
9
|
+
|
10
|
+
rm.showRightMenu = function (e, n = 0, t = 0) {
|
11
|
+
let o = document.getElementById('rightMenu');
|
12
|
+
o.style.top = n + 'px';
|
13
|
+
o.style.left = t + 'px';
|
14
|
+
|
15
|
+
if (e) {
|
16
|
+
o.style.display = 'block';
|
17
|
+
stopMaskScroll();
|
18
|
+
} else {
|
19
|
+
o.style.display = 'none';
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
rm.hideRightMenu = function () {
|
24
|
+
rm.showRightMenu(false);
|
25
|
+
document.getElementById('rightmenu-mask').style.display = 'none';
|
26
|
+
};
|
27
|
+
|
28
|
+
document.querySelector("#rightMenu").style.display = "block"
|
29
|
+
rmWidth = document.querySelector("#rightMenu").offsetWidth;
|
30
|
+
rmHeight = document.querySelector("#rightMenu").offsetHeight;
|
31
|
+
document.querySelector("#rightMenu").style.display = 'none'
|
32
|
+
|
33
|
+
rm.reloadrmSize = function () {
|
34
|
+
document.querySelector("#rightMenu").style.display = "block"
|
35
|
+
rmWidth = document.querySelector("#rightMenu").offsetWidth;
|
36
|
+
rmHeight = document.querySelector("#rightMenu").offsetHeight;
|
37
|
+
document.querySelector("#rightMenu").style.display = 'none'
|
38
|
+
}
|
39
|
+
|
40
|
+
let domhref = "", domImgSrc = "", globalEvent = null;
|
41
|
+
|
42
|
+
function imageToBlob(e) {
|
43
|
+
const n = new Image
|
44
|
+
, t = document.createElement("canvas")
|
45
|
+
, o = t.getContext("2d");
|
46
|
+
return n.crossOrigin = "",
|
47
|
+
n.src = e,
|
48
|
+
new Promise((e => {
|
49
|
+
n.onload = function () {
|
50
|
+
t.width = this.naturalWidth,
|
51
|
+
t.height = this.naturalHeight,
|
52
|
+
o.drawImage(this, 0, 0),
|
53
|
+
t.toBlob((n => {
|
54
|
+
e(n)
|
55
|
+
}
|
56
|
+
), "image/png", .75)
|
57
|
+
}
|
58
|
+
}
|
59
|
+
))
|
60
|
+
}
|
61
|
+
|
62
|
+
async function copyImage(e) {
|
63
|
+
try {
|
64
|
+
const n = await imageToBlob(e);
|
65
|
+
const t = new ClipboardItem({
|
66
|
+
"image/png": n
|
67
|
+
});
|
68
|
+
await navigator.clipboard.write([t]);
|
69
|
+
} catch (error) {
|
70
|
+
console.error('Failed to copy image: ', error);
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
function stopMaskScroll() {
|
75
|
+
if (document.getElementById("rightmenu-mask")) {
|
76
|
+
document.getElementById("rightmenu-mask").addEventListener("mousewheel", (function (e) {
|
77
|
+
rm.hideRightMenu()
|
78
|
+
}
|
79
|
+
), !1)
|
80
|
+
}
|
81
|
+
if (document.getElementById("rightMenu")) {
|
82
|
+
document.getElementById("rightMenu").addEventListener("mousewheel", (function (e) {
|
83
|
+
rm.hideRightMenu()
|
84
|
+
}
|
85
|
+
), !1)
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
window.oncontextmenu = function (e) {
|
90
|
+
if (document.body.clientWidth > 768) {
|
91
|
+
let n = e.clientX + 10;
|
92
|
+
let t = e.clientY;
|
93
|
+
let o = document.getElementsByClassName('rightMenuOther');
|
94
|
+
let i = document.getElementsByClassName('rightMenuPlugin');
|
95
|
+
let c = document.getElementById('menu-copytext');
|
96
|
+
let r = document.getElementById('menu-pastetext');
|
97
|
+
let m = document.getElementById('menu-commenttext');
|
98
|
+
let a = document.getElementById('menu-newwindow');
|
99
|
+
let u = document.getElementById('menu-copylink');
|
100
|
+
let l = document.getElementById('menu-copyimg');
|
101
|
+
let h = document.getElementById('menu-downloadimg');
|
102
|
+
let d = document.getElementById('menu-search');
|
103
|
+
let s = document.getElementById('menu-searchBaidu');
|
104
|
+
let g = document.getElementById('menu-music-toggle');
|
105
|
+
let w = document.getElementById('menu-music-back');
|
106
|
+
let f = document.getElementById('menu-music-forward');
|
107
|
+
let p = document.getElementById('menu-music-playlist');
|
108
|
+
let k = document.getElementById('menu-music-copyMusicName');
|
109
|
+
let y = e.target.href;
|
110
|
+
let M = e.target.currentSrc;
|
111
|
+
let b = false;
|
112
|
+
|
113
|
+
for (let j = 0; j < o.length; j++) {
|
114
|
+
o[j].style.display = 'block';
|
115
|
+
}
|
116
|
+
globalEvent = e;
|
117
|
+
|
118
|
+
if (selectTextNow && window.getSelection()) {
|
119
|
+
b = true;
|
120
|
+
c.style.display = 'block';
|
121
|
+
m.style.display = 'block';
|
122
|
+
d.style.display = 'block';
|
123
|
+
s.style.display = 'block';
|
124
|
+
} else {
|
125
|
+
c.style.display = 'none';
|
126
|
+
m.style.display = 'none';
|
127
|
+
s.style.display = 'none';
|
128
|
+
d.style.display = 'none';
|
129
|
+
}
|
130
|
+
|
131
|
+
if (y) {
|
132
|
+
b = true;
|
133
|
+
a.style.display = 'block';
|
134
|
+
u.style.display = 'block';
|
135
|
+
domhref = y;
|
136
|
+
} else {
|
137
|
+
a.style.display = 'none';
|
138
|
+
u.style.display = 'none';
|
139
|
+
}
|
140
|
+
|
141
|
+
if (M) {
|
142
|
+
b = true;
|
143
|
+
l.style.display = 'block';
|
144
|
+
h.style.display = 'block';
|
145
|
+
domImgSrc = M;
|
146
|
+
} else {
|
147
|
+
l.style.display = 'none';
|
148
|
+
h.style.display = 'none';
|
149
|
+
}
|
150
|
+
|
151
|
+
if (e.target.tagName.toLowerCase() === 'input' || e.target.tagName.toLowerCase() === 'textarea') {
|
152
|
+
b = true;
|
153
|
+
r.style.display = 'block';
|
154
|
+
} else {
|
155
|
+
r.style.display = 'none';
|
156
|
+
}
|
157
|
+
|
158
|
+
if (e.target.nodeName === 'METING-JS') {
|
159
|
+
b = true;
|
160
|
+
g.style.display = 'block';
|
161
|
+
w.style.display = 'block';
|
162
|
+
f.style.display = 'block';
|
163
|
+
p.style.display = 'block';
|
164
|
+
k.style.display = 'block';
|
165
|
+
} else {
|
166
|
+
g.style.display = 'none';
|
167
|
+
w.style.display = 'none';
|
168
|
+
f.style.display = 'none';
|
169
|
+
p.style.display = 'none';
|
170
|
+
k.style.display = 'none';
|
171
|
+
}
|
172
|
+
|
173
|
+
if (b) {
|
174
|
+
for (let j = 0; j < o.length; j++) {
|
175
|
+
o[j].style.display = 'none';
|
176
|
+
}
|
177
|
+
for (let j = 0; j < i.length; j++) {
|
178
|
+
i[j].style.display = 'block';
|
179
|
+
}
|
180
|
+
} else {
|
181
|
+
for (let j = 0; j < i.length; j++) {
|
182
|
+
i[j].style.display = 'none';
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
rm.reloadrmSize();
|
187
|
+
if (n + rmWidth > window.innerWidth) {
|
188
|
+
n -= rmWidth + 10;
|
189
|
+
}
|
190
|
+
|
191
|
+
if (t + rmHeight > window.innerHeight) {
|
192
|
+
t -= t + rmHeight - window.innerHeight;
|
193
|
+
}
|
194
|
+
rm.showRightMenu(true, t, n);
|
195
|
+
document.getElementById('rightmenu-mask').style.display = 'flex';
|
196
|
+
|
197
|
+
return false;
|
198
|
+
}
|
199
|
+
};
|
200
|
+
rm.downloadimging = !1
|
201
|
+
rm.writeClipImg = function (e) {
|
202
|
+
const n = "localhost" === window.location.hostname || "127.0.0.1" === window.location.hostname ? 0 : 1e4;
|
203
|
+
rm.hideRightMenu();
|
204
|
+
utils.snackbarShow("正在下载中,请稍后", !1, n);
|
205
|
+
if (0 == rm.downloadimging) {
|
206
|
+
rm.downloadimging = !0;
|
207
|
+
setTimeout(async function () {
|
208
|
+
await copyImage(e);
|
209
|
+
utils.snackbarShow("复制成功!图片已添加盲水印,请遵守版权协议");
|
210
|
+
rm.downloadimging = !1;
|
211
|
+
}, 1000);
|
212
|
+
}
|
213
|
+
}
|
214
|
+
|
215
|
+
rm.switchDarkMode = function () {
|
216
|
+
sco.switchDarkMode()
|
217
|
+
rm.hideRightMenu()
|
218
|
+
}
|
219
|
+
|
220
|
+
rm.copyUrl = function (e) {
|
221
|
+
var n = e;
|
222
|
+
var t = document.createElement('input');
|
223
|
+
t.id = 'copyVal';
|
224
|
+
document.body.appendChild(t);
|
225
|
+
t.value = n;
|
226
|
+
t.select();
|
227
|
+
t.setSelectionRange(0, t.value.length);
|
228
|
+
document.execCommand('copy');
|
229
|
+
document.body.removeChild(t);
|
230
|
+
}
|
231
|
+
|
232
|
+
rm.rightmenuCopyText = function (e) {
|
233
|
+
navigator.clipboard && navigator.clipboard.writeText(e),
|
234
|
+
utils.snackbarShow("复制文本成功", !1, 2e3),
|
235
|
+
rm.hideRightMenu()
|
236
|
+
}
|
237
|
+
|
238
|
+
rm.copyPageUrl = function () {
|
239
|
+
var e = window.location.href;
|
240
|
+
rm.copyUrl(e),
|
241
|
+
utils.snackbarShow("复制本页链接地址成功", !1, 2e3),
|
242
|
+
rm.hideRightMenu()
|
243
|
+
}
|
244
|
+
|
245
|
+
rm.sharePage = function () {
|
246
|
+
window;
|
247
|
+
rm.copyUrl(url),
|
248
|
+
utils.snackbarShow("复制本页链接地址成功", !1, 2e3),
|
249
|
+
rm.hideRightMenu()
|
250
|
+
}
|
251
|
+
|
252
|
+
var selectTextNow = "";
|
253
|
+
|
254
|
+
function selceText() {
|
255
|
+
var e;
|
256
|
+
e = document.selection ? document.selection.createRange().text : window.getSelection() + "",
|
257
|
+
selectTextNow = e || ""
|
258
|
+
}
|
259
|
+
|
260
|
+
function replaceAll(e, n, t) {
|
261
|
+
return e.split(n).join(t)
|
262
|
+
}
|
263
|
+
|
264
|
+
function addRightMenuClickEvent() {
|
265
|
+
document.getElementById('menu-backward').addEventListener('click', function () {
|
266
|
+
window.history.back();
|
267
|
+
rm.hideRightMenu();
|
268
|
+
});
|
269
|
+
|
270
|
+
document.getElementById('menu-forward').addEventListener('click', function () {
|
271
|
+
window.history.forward();
|
272
|
+
rm.hideRightMenu();
|
273
|
+
});
|
274
|
+
|
275
|
+
document.getElementById('menu-refresh').addEventListener('click', function () {
|
276
|
+
window.location.reload();
|
277
|
+
});
|
278
|
+
|
279
|
+
document.getElementById('menu-top').addEventListener('click', function () {
|
280
|
+
utils.scrollToDest(0, 500);
|
281
|
+
rm.hideRightMenu();
|
282
|
+
});
|
283
|
+
|
284
|
+
Array.from(document.getElementsByClassName('menu-link')).forEach(function (element) {
|
285
|
+
element.addEventListener('click', rm.hideRightMenu);
|
286
|
+
});
|
287
|
+
|
288
|
+
var menuDarkmode = document.getElementById('menu-darkmode');
|
289
|
+
menuDarkmode.onclick = null;
|
290
|
+
menuDarkmode.addEventListener('click', rm.switchDarkMode);
|
291
|
+
|
292
|
+
document.getElementById('menu-randomPost').addEventListener('click', function () {
|
293
|
+
toRandomPost();
|
294
|
+
});
|
295
|
+
|
296
|
+
if (GLOBAL_CONFIG.comment.commentBarrage) {
|
297
|
+
const menuCommentBarrage = document.getElementById('menu-commentBarrage');
|
298
|
+
menuCommentBarrage.onclick = null;
|
299
|
+
menuCommentBarrage.addEventListener('click', sco.switchCommentBarrage);
|
300
|
+
}
|
301
|
+
|
302
|
+
var rightmenuMask = document.getElementById('rightmenu-mask');
|
303
|
+
rightmenuMask.addEventListener('click', rm.hideRightMenu);
|
304
|
+
rightmenuMask.addEventListener('contextmenu', function () {
|
305
|
+
rm.hideRightMenu();
|
306
|
+
return false;
|
307
|
+
});
|
308
|
+
|
309
|
+
document.getElementById('menu-copy').addEventListener('click', rm.copyPageUrl);
|
310
|
+
document.getElementById('menu-pastetext').addEventListener('click', rm.pasteText);
|
311
|
+
|
312
|
+
document.getElementById('menu-copytext').addEventListener('click', function () {
|
313
|
+
rm.rightmenuCopyText(selectTextNow);
|
314
|
+
utils.snackbarShow("复制成功,复制和转载请标注本文地址");
|
315
|
+
});
|
316
|
+
|
317
|
+
document.getElementById('menu-commenttext').addEventListener('click', function () {
|
318
|
+
rm.rightMenuCommentText(selectTextNow);
|
319
|
+
});
|
320
|
+
|
321
|
+
document.getElementById('menu-newwindow').addEventListener('click', function () {
|
322
|
+
window.open(domhref);
|
323
|
+
rm.hideRightMenu();
|
324
|
+
});
|
325
|
+
|
326
|
+
document.getElementById('menu-copylink').addEventListener('click', rm.copyLink);
|
327
|
+
|
328
|
+
document.getElementById('menu-downloadimg').addEventListener('click', function () {
|
329
|
+
sco.downloadImage(domImgSrc);
|
330
|
+
});
|
331
|
+
|
332
|
+
document.getElementById('menu-copyimg').addEventListener('click', function () {
|
333
|
+
rm.writeClipImg(domImgSrc);
|
334
|
+
});
|
335
|
+
|
336
|
+
document.getElementById('menu-searchBaidu').addEventListener('click', rm.searchBaidu);
|
337
|
+
|
338
|
+
document.getElementById('menu-music-toggle').addEventListener('click', sco.musicToggle);
|
339
|
+
document.getElementById('menu-music-back').addEventListener('click', sco.musicSkipBack);
|
340
|
+
document.getElementById('menu-music-forward').addEventListener('click', sco.musicSkipForward);
|
341
|
+
|
342
|
+
document.getElementById('menu-music-copyMusicName').addEventListener('click', function () {
|
343
|
+
rm.rightmenuCopyText(sco.musicGetName());
|
344
|
+
utils.snackbarShow("复制歌曲名称成功", false, 3000);
|
345
|
+
});
|
346
|
+
}
|
347
|
+
|
348
|
+
document.onmouseup = document.ondbclick = selceText
|
349
|
+
rm.readClipboard = function () {
|
350
|
+
navigator.clipboard && navigator.clipboard.readText().then((e => rm.insertAtCaret(globalEvent.target, e)))
|
351
|
+
}
|
352
|
+
|
353
|
+
rm.insertAtCaret = function (e, n) {
|
354
|
+
const t = e.selectionStart
|
355
|
+
, o = e.selectionEnd;
|
356
|
+
if (document.selection)
|
357
|
+
e.focus(),
|
358
|
+
document.selection.createRange().text = n,
|
359
|
+
e.focus();
|
360
|
+
else if (t || "0" == t) {
|
361
|
+
var i = e.scrollTop;
|
362
|
+
e.value = e.value.substring(0, t) + n + e.value.substring(o, e.value.length),
|
363
|
+
e.focus(),
|
364
|
+
e.selectionStart = t + n.length,
|
365
|
+
e.selectionEnd = t + n.length,
|
366
|
+
e.scrollTop = i
|
367
|
+
} else
|
368
|
+
e.value += n,
|
369
|
+
e.focus()
|
370
|
+
}
|
371
|
+
|
372
|
+
rm.pasteText = function () {
|
373
|
+
rm.readClipboard();
|
374
|
+
rm.hideRightMenu()
|
375
|
+
}
|
376
|
+
|
377
|
+
rm.rightMenuCommentText = function (e) {
|
378
|
+
rm.hideRightMenu();
|
379
|
+
var n = document.getElementsByClassName("el-textarea__inner")[0];
|
380
|
+
let t = document.createEvent("HTMLEvents");
|
381
|
+
t.initEvent("input", !0, !0);
|
382
|
+
let o = replaceAll(e, "\n", "\n> ");
|
383
|
+
n.value = "> " + o + "\n\n",
|
384
|
+
n.dispatchEvent(t);
|
385
|
+
const i = document.querySelector("#post-comment").offsetTop;
|
386
|
+
window.scrollTo(0, i - 80),
|
387
|
+
n.focus(),
|
388
|
+
n.setSelectionRange(-1, -1),
|
389
|
+
document.getElementById("comment-tips") && document.getElementById("comment-tips").classList.add("show")
|
390
|
+
}
|
391
|
+
|
392
|
+
rm.searchBaidu = function () {
|
393
|
+
utils.snackbarShow("即将跳转到百度搜索", !1, 2e3);
|
394
|
+
setTimeout((function () {
|
395
|
+
window.open("https://www.baidu.com/s?wd=" + selectTextNow)
|
396
|
+
}
|
397
|
+
), 2000);
|
398
|
+
rm.hideRightMenu()
|
399
|
+
}
|
400
|
+
|
401
|
+
rm.copyLink = function () {
|
402
|
+
rm.rightmenuCopyText(domhref)
|
403
|
+
utils.snackbarShow("已复制链接地址")
|
404
|
+
}
|
@@ -32,6 +32,16 @@ window.addEventListener("load", () => {
|
|
32
32
|
|
33
33
|
const searchClickFn = () => {
|
34
34
|
utils.addEventListenerPjax(document.querySelector("#search-button > .search"), "click", openSearch);
|
35
|
+
|
36
|
+
GLOBAL_CONFIG.rightside.enable && document.getElementById("menu-search").addEventListener("click", function (){
|
37
|
+
rm.hideRightMenu();
|
38
|
+
openSearch();
|
39
|
+
let t=document.getElementsByClassName('ais-SearchBox-input')[0];
|
40
|
+
let evt = document.createEvent('HTMLEvents');
|
41
|
+
evt.initEvent('input', true,true)
|
42
|
+
t.value = selectTextNow
|
43
|
+
t.dispatchEvent(evt)
|
44
|
+
})
|
35
45
|
};
|
36
46
|
|
37
47
|
const searchFnOnce = () => {
|
@@ -27,8 +27,30 @@ window.onload = () => {
|
|
27
27
|
utils.animateOut($searchMask, "to_hide 0.5s");
|
28
28
|
window.removeEventListener("resize", fixSafariHeight);
|
29
29
|
};
|
30
|
-
|
31
|
-
|
30
|
+
|
31
|
+
const searchFnOnce = () => {
|
32
|
+
$searchMask.addEventListener("click", closeSearch);
|
33
|
+
utils.addEventListenerPjax(document.querySelector("#local-search .search-close-button"), "click", closeSearch);
|
34
|
+
};
|
35
|
+
|
36
|
+
searchFnOnce();
|
37
|
+
|
38
|
+
const searchClickFn = () =>{
|
39
|
+
utils.addEventListenerPjax(document.querySelector("#search-button > .search"), "click", openSearch);
|
40
|
+
|
41
|
+
GLOBAL_CONFIG.rightside.enable && document.getElementById("menu-search").addEventListener("click", function (){
|
42
|
+
rm.hideRightMenu();
|
43
|
+
openSearch();
|
44
|
+
let t=document.getElementsByClassName('search-box-input')[0];
|
45
|
+
let evt = document.createEvent('HTMLEvents');
|
46
|
+
evt.initEvent('input', true,true)
|
47
|
+
t.value = selectTextNow
|
48
|
+
t.dispatchEvent(evt)
|
49
|
+
})
|
50
|
+
}
|
51
|
+
|
52
|
+
searchClickFn();
|
53
|
+
|
32
54
|
function initLunr() {
|
33
55
|
fetch("/search.xml")
|
34
56
|
.then(response => response.text())
|
package/source/js/utils.js
CHANGED
@@ -169,5 +169,79 @@ const utils = {
|
|
169
169
|
ele.removeEventListener('animationend', f)
|
170
170
|
})
|
171
171
|
ele.style.animation = text
|
172
|
-
}
|
172
|
+
},
|
173
|
+
wrap: (selector, eleType, options) => {
|
174
|
+
const createEle = document.createElement(eleType)
|
175
|
+
for (const [key, value] of Object.entries(options)) {
|
176
|
+
createEle.setAttribute(key, value)
|
177
|
+
}
|
178
|
+
selector.parentNode.insertBefore(createEle, selector)
|
179
|
+
createEle.appendChild(selector)
|
180
|
+
},
|
181
|
+
lazyloadImg: function () {
|
182
|
+
window.lazyLoadInstance = new LazyLoad({
|
183
|
+
elements_selector: 'img',
|
184
|
+
threshold: 0,
|
185
|
+
data_src: 'lazy-src',
|
186
|
+
callback_error: (img) => {
|
187
|
+
img.setAttribute("src", GLOBAL_CONFIG.lazyload.error);
|
188
|
+
}
|
189
|
+
})
|
190
|
+
},
|
191
|
+
lightbox: function (selector) {
|
192
|
+
const lightbox = GLOBAL_CONFIG.lightbox
|
193
|
+
|
194
|
+
if (lightbox === 'mediumZoom' && mediumZoom) {
|
195
|
+
mediumZoom(selector, {background: "var(--sco-card-bg)"});
|
196
|
+
}
|
197
|
+
|
198
|
+
if (lightbox === 'fancybox') {
|
199
|
+
selector.forEach(i => {
|
200
|
+
if (i.parentNode.tagName !== 'A') {
|
201
|
+
const dataSrc = i.dataset.lazySrc || i.src
|
202
|
+
const dataCaption = i.title || i.alt || ''
|
203
|
+
utils.wrap(i, 'a', {
|
204
|
+
class: 'fancybox',
|
205
|
+
href: dataSrc,
|
206
|
+
'data-fancybox': 'gallery',
|
207
|
+
'data-caption': dataCaption,
|
208
|
+
'data-thumb': dataSrc
|
209
|
+
})
|
210
|
+
}
|
211
|
+
})
|
212
|
+
|
213
|
+
if (!window.fancyboxRun) {
|
214
|
+
Fancybox.bind('[data-fancybox]', {
|
215
|
+
Hash: false,
|
216
|
+
Thumbs: {
|
217
|
+
showOnStart: false
|
218
|
+
},
|
219
|
+
Images: {
|
220
|
+
Panzoom: {
|
221
|
+
maxScale: 4
|
222
|
+
}
|
223
|
+
},
|
224
|
+
Carousel: {
|
225
|
+
transition: 'slide'
|
226
|
+
},
|
227
|
+
Toolbar: {
|
228
|
+
display: {
|
229
|
+
left: ['infobar'],
|
230
|
+
middle: [
|
231
|
+
'zoomIn',
|
232
|
+
'zoomOut',
|
233
|
+
'toggle1to1',
|
234
|
+
'rotateCCW',
|
235
|
+
'rotateCW',
|
236
|
+
'flipX',
|
237
|
+
'flipY'
|
238
|
+
],
|
239
|
+
right: ['slideshow', 'thumbs', 'close']
|
240
|
+
}
|
241
|
+
}
|
242
|
+
})
|
243
|
+
window.fancyboxRun = true
|
244
|
+
}
|
245
|
+
}
|
246
|
+
},
|
173
247
|
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
- var fests = theme.fest.list || {}
|
2
|
-
|
3
|
-
script.
|
4
|
-
function setFest() {
|
5
|
-
const date = new Date();
|
6
|
-
const currentDate = `${date.getMonth() + 1}.${date.getDate()}`;
|
7
|
-
|
8
|
-
const specialDates = [!{fests}].map(String);
|
9
|
-
|
10
|
-
if (specialDates.includes(currentDate)) {
|
11
|
-
const css = `
|
12
|
-
html {
|
13
|
-
filter: grayscale(100%);
|
14
|
-
}
|
15
|
-
`;
|
16
|
-
|
17
|
-
const styleElement = document.createElement('style');
|
18
|
-
styleElement.textContent = css;
|
19
|
-
document.head.appendChild(styleElement);
|
20
|
-
}
|
21
|
-
}
|
22
|
-
setFest()
|
@@ -1,7 +0,0 @@
|
|
1
|
-
- var startDate = theme.about.echarts.startDate
|
2
|
-
- var tagLength = theme.about.echarts.tagLength
|
3
|
-
- var categoryParent = ""+theme.about.echarts.categoryParent
|
4
|
-
|
5
|
-
#posts-chart(data-start=startDate, style="border-radius: 8px; height: 300px; padding: 10px;")
|
6
|
-
#tags-chart(data-length=tagLength, style="border-radius: 8px; height: 300px; padding: 10px;")
|
7
|
-
#categories-chart(data-parent=categoryParent, style="border-radius: 8px; height: 300px; padding: 10px;")
|
@@ -1,8 +0,0 @@
|
|
1
|
-
if theme.aside.history.enable
|
2
|
-
.card-widget.card-history
|
3
|
-
.item-headline
|
4
|
-
i(class=theme.aside.history.icon || 'scoicon sco-clock-fill')
|
5
|
-
span= theme.aside.history.title || _p('aside.history')
|
6
|
-
#history-baidu
|
7
|
-
#history-container.history_swiper-container(style="width: 100%;height: 100%;margin-top: 6px")
|
8
|
-
#history_container_wrapper.swiper-wrapper
|
@@ -1,12 +0,0 @@
|
|
1
|
-
if theme.aside.welcome.enable
|
2
|
-
.card-widget.card-welcome
|
3
|
-
.item-headline
|
4
|
-
i(class=theme.aside.welcome.icon || 'scoicon sco-map-pin-fill')
|
5
|
-
span= theme.aside.welcome.title || __('aside.welcome')
|
6
|
-
#welcome-info
|
7
|
-
|
8
|
-
script(data-pjax).
|
9
|
-
var longitude = '#{theme.aside.welcome.longitude}';
|
10
|
-
var Latitude = '#{theme.aside.welcome.Latitude}';
|
11
|
-
var txkey = '#{theme.aside.welcome.key}';
|
12
|
-
var ipLoacation;
|
@@ -1,19 +0,0 @@
|
|
1
|
-
- var randomstart = page.type === "moments" ? '' : 'display: none;'
|
2
|
-
.title-h2-a
|
3
|
-
.title-h2-a-left
|
4
|
-
h2 🎣 钓鱼
|
5
|
-
a#random-post-start(href="javascript:fetchRandomPost();" style="transition-duration: 0.3s; transform: rotate(7560deg); opacity: 1;"+randomstart)
|
6
|
-
i.scoicon.sco-refresh-line
|
7
|
-
.title-h2-a-right(style=randomstart)
|
8
|
-
a.random-post-all(href="/links/") 全部友链
|
9
|
-
|
10
|
-
#random-post
|
11
|
-
|
12
|
-
script.
|
13
|
-
var fdata = {
|
14
|
-
apiurl: "#{theme.thirdparty.circle.api}",
|
15
|
-
defaultFish: 100,
|
16
|
-
hungryFish: 100,
|
17
|
-
}
|
18
|
-
|
19
|
-
script(src=cdn_url_for("/lib/friends_post.js"))
|
@@ -1,23 +0,0 @@
|
|
1
|
-
.title-h2-a
|
2
|
-
.title-h2-a-left
|
3
|
-
h2 🐟 鱼塘
|
4
|
-
.title-h2-a-right
|
5
|
-
span 以下内容自动生成,未经过审核
|
6
|
-
div#hexo-circle-of-friends-root
|
7
|
-
script.
|
8
|
-
let UserConfig = {
|
9
|
-
// 填写你的api地址
|
10
|
-
private_api_url: '!{theme.thirdparty.circle.api}',
|
11
|
-
// 默认加载文章数
|
12
|
-
page_init_number: !{theme.thirdparty.circle.page_init_number},
|
13
|
-
// 点击加载更多时,一次最多加载几篇文章,默认10
|
14
|
-
page_turning_number: !{theme.thirdparty.circle.page_turning_number},
|
15
|
-
// 头像加载失败时,默认头像地址
|
16
|
-
error_img: '!{theme.thirdparty.circle.error_img}',
|
17
|
-
// 进入页面时第一次的排序规则
|
18
|
-
sort_rule: '!{theme.thirdparty.circle.sort_rule}',
|
19
|
-
// 本地文章缓存数据过期时间(天)
|
20
|
-
expire_days: !{theme.thirdparty.circle.expire_days},
|
21
|
-
}
|
22
|
-
script(src=cdn_url_for("/lib/circle.min.js"))
|
23
|
-
script(src=cdn_url_for("/lib/bundle.min.js"))
|
@@ -1,11 +0,0 @@
|
|
1
|
-
.bber-bottom
|
2
|
-
.bber-info
|
3
|
-
.bber-info-time
|
4
|
-
i.scoicon.sco-calendar-todo-fill
|
5
|
-
time.datetime(datetime=moment(item.date).format())
|
6
|
-
if item.link
|
7
|
-
a.bber-content-link(href=url_for(item.link) title="跳转到短文指引的链接")
|
8
|
-
i.scoicon.sco-link-m-line
|
9
|
-
| 链接
|
10
|
-
a.bber-reply(onclick=`sco.toTalk('${item.content}')`)
|
11
|
-
i.scoicon.sco-chat-fill(style="font-size: 1rem;")
|
@@ -1,10 +0,0 @@
|
|
1
|
-
if item.aplayer
|
2
|
-
.bber-music
|
3
|
-
meting-js(server=item.aplayer.server type="song" id=item.aplayer.id mutex="true" preload="none" theme="var(--sco-main)" data-lrctype="0")
|
4
|
-
|
5
|
-
if item.video
|
6
|
-
.bber-video
|
7
|
-
if item.video.player
|
8
|
-
video(src=item.video.player controls="controls" style="object-fit: cover;")
|
9
|
-
if item.video.bilibili
|
10
|
-
iframe(src=item.video.bilibili scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true")
|
@@ -1,7 +0,0 @@
|
|
1
|
-
.meta
|
2
|
-
img.no-lightbox.no-lazyload.avatar(src=theme.aside.card.author.img)
|
3
|
-
.info
|
4
|
-
span.bber_nick= config.author
|
5
|
-
time.datetime.bber_date(datetime=moment(item.date).format())
|
6
|
-
a.bber-reply.goComment(onclick=`sco.toTalk('${item.content}')`)
|
7
|
-
i.scoicon.sco-chat-fill(style="font-size: 1rem;")
|