hexo-theme-shokax 0.2.0-rc1 → 0.2.0-rc3
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/layout/_partials/head/head.pug +1 -1
- package/package.json +6 -7
- package/scripts/generaters/script.js +1 -1
- package/scripts/tags/links.js +0 -1
- package/source/css/_common/components/post/expand.styl +9 -1
- package/source/js/_app/components.js +1 -1
- package/source/js/_app/global.js +7 -8
- package/source/js/_app/library.js +4 -5
- package/source/js/_app/page.js +1 -1
- package/source/js/_app/player.js +6 -7
@@ -58,7 +58,7 @@ else if gt
|
|
58
58
|
link(rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css")
|
59
59
|
script(src="https://unpkg.com/gitalk/dist/gitalk.min.js")
|
60
60
|
|
61
|
-
- var qw = theme
|
61
|
+
- var qw = theme?.qweather?.enable
|
62
62
|
if qw
|
63
63
|
style.
|
64
64
|
img[data-v-7d48daab] {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.2.0-
|
3
|
+
"version": "0.2.0-rc3",
|
4
4
|
"description": "a hexo theme based on shoka",
|
5
5
|
"main": "index.js",
|
6
6
|
"repository": "https://github.com/zkz098/hexo-theme-shokaX",
|
@@ -19,23 +19,22 @@
|
|
19
19
|
"@types/jquery": "^3.5.16",
|
20
20
|
"@types/js-yaml": "^4.0.5",
|
21
21
|
"@types/lozad": "^1.16.1",
|
22
|
-
"@types/node": "^18.
|
22
|
+
"@types/node": "^18.13.0",
|
23
23
|
"@types/shelljs": "^0.8.11",
|
24
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
25
|
-
"@typescript-eslint/parser": "^5.
|
24
|
+
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
25
|
+
"@typescript-eslint/parser": "^5.51.0",
|
26
26
|
"@vuepress/client": "2.0.0-beta.60",
|
27
|
+
"@vuepress/plugin-docsearch": "2.0.0-beta.60",
|
27
28
|
"eslint": "^8.34.0",
|
28
29
|
"eslint-config-standard": "^17.0.0",
|
29
30
|
"eslint-plugin-import": "^2.27.5",
|
30
31
|
"eslint-plugin-n": "^15.6.1",
|
31
32
|
"eslint-plugin-promise": "^6.1.1",
|
32
33
|
"eslint-plugin-vue": "^9.9.0",
|
33
|
-
"hexo-fs": "^4.1.1",
|
34
|
-
"hexo-util": "^3.0.1",
|
35
34
|
"typescript": "^4.9.5",
|
36
35
|
"vue": "^3.2.47",
|
37
36
|
"vuepress": "2.0.0-beta.60",
|
38
|
-
"vuepress-plugin-sitemap2": "2.0.0-beta.
|
37
|
+
"vuepress-plugin-sitemap2": "2.0.0-beta.180"
|
39
38
|
},
|
40
39
|
"dependencies": {
|
41
40
|
"js-yaml": "^4.1.0"
|
package/scripts/tags/links.js
CHANGED
@@ -13,13 +13,21 @@
|
|
13
13
|
img,
|
14
14
|
.tabs,
|
15
15
|
.links {
|
16
|
-
|
16
|
+
content-visibility: auto;
|
17
|
+
contain-intrinsic-size: 979px 1.1em;
|
17
18
|
&:last-child {
|
18
19
|
margin-bottom: 0;
|
19
20
|
}
|
20
21
|
}
|
21
22
|
|
23
|
+
span {
|
24
|
+
content-visibility: auto;
|
25
|
+
contain-intrinsic-size: 979px 1.1em;
|
26
|
+
}
|
27
|
+
|
22
28
|
ul, dd, ol {
|
29
|
+
content-visibility: auto;
|
30
|
+
contain-intrinsic-size: 979px 3.5em;
|
23
31
|
ul, ol {
|
24
32
|
margin-top: 0;
|
25
33
|
}
|
@@ -248,7 +248,7 @@ const sidebarTOC = function () {
|
|
248
248
|
const link = element.child('a.toc-link');
|
249
249
|
const anchor = $dom(decodeURI(link.attr('href')));
|
250
250
|
if (!anchor)
|
251
|
-
return;
|
251
|
+
return null;
|
252
252
|
const alink = anchor.child('a.anchor');
|
253
253
|
const anchorScroll = function (event) {
|
254
254
|
event.preventDefault();
|
package/source/js/_app/global.js
CHANGED
@@ -104,7 +104,7 @@ const themeColorListener = function () {
|
|
104
104
|
}
|
105
105
|
};
|
106
106
|
const visibilityListener = function () {
|
107
|
-
|
107
|
+
const iconNode = $dom('[rel="icon"]');
|
108
108
|
document.addEventListener('visibilitychange', function () {
|
109
109
|
switch (document.visibilityState) {
|
110
110
|
case 'hidden':
|
@@ -182,8 +182,7 @@ const scrollHandle = function (event) {
|
|
182
182
|
siteNav.removeClass('down');
|
183
183
|
siteNav.toggleClass('up', SHOW);
|
184
184
|
}
|
185
|
-
else {
|
186
|
-
}
|
185
|
+
else { }
|
187
186
|
scrollAction.y = window.scrollY;
|
188
187
|
const scrollPercent = Math.round(Math.min(100 * window.scrollY / contentVisibilityHeight, 100)) + '%';
|
189
188
|
backToTop.child('span').innerText = scrollPercent;
|
@@ -287,16 +286,16 @@ const clickMenu = function () {
|
|
287
286
|
event.preventDefault();
|
288
287
|
let x = event.offsetX;
|
289
288
|
let y = event.offsetY;
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
289
|
+
const winWidth = window.innerWidth;
|
290
|
+
const winHeight = window.innerHeight;
|
291
|
+
const menuWidth = menuElement.offsetWidth;
|
292
|
+
const menuHeight = menuElement.offsetHeight;
|
294
293
|
x = winWidth - menuWidth >= x ? x : winWidth - menuWidth;
|
295
294
|
y = winHeight - menuHeight >= y ? y : winHeight - menuHeight;
|
296
295
|
menuElement.style.top = y + 'px';
|
297
296
|
menuElement.style.left = x + 'px';
|
298
297
|
menuElement.classList.add('active');
|
299
|
-
$dom.each(
|
298
|
+
$dom.each('.clickSubmenu', (submenu) => {
|
300
299
|
if (x > (winWidth - menuWidth - submenu.offsetWidth)) {
|
301
300
|
submenu.style.left = '-200px';
|
302
301
|
}
|
@@ -105,13 +105,12 @@ Object.assign(HTMLElement.prototype, {
|
|
105
105
|
},
|
106
106
|
_class: function (type, className, display) {
|
107
107
|
const classNames = className.indexOf(' ') ? className.split(' ') : [className];
|
108
|
-
|
109
|
-
classNames.forEach(function (name) {
|
108
|
+
classNames.forEach((name) => {
|
110
109
|
if (type === 'toggle') {
|
111
|
-
|
110
|
+
this.classList.toggle(name, display);
|
112
111
|
}
|
113
112
|
else {
|
114
|
-
|
113
|
+
this.classList[type](name);
|
115
114
|
}
|
116
115
|
});
|
117
116
|
},
|
@@ -150,7 +149,7 @@ const getScript = function (url, callback, condition) {
|
|
150
149
|
let script = document.createElement('script');
|
151
150
|
script.onload = function (_, isAbort) {
|
152
151
|
if (isAbort || !script.readyState) {
|
153
|
-
console.log(
|
152
|
+
console.log('abort!');
|
154
153
|
script.onload = null;
|
155
154
|
script = undefined;
|
156
155
|
if (!isAbort && callback)
|
package/source/js/_app/page.js
CHANGED
@@ -555,7 +555,7 @@ const pjaxReload = function () {
|
|
555
555
|
menuToggle.removeClass('close');
|
556
556
|
});
|
557
557
|
}
|
558
|
-
|
558
|
+
const mainNode = $dom('#main');
|
559
559
|
mainNode.innerHTML = '';
|
560
560
|
mainNode.appendChild(loadCat.lastChild.cloneNode(true));
|
561
561
|
pageScroll(0);
|
package/source/js/_app/player.js
CHANGED
@@ -444,25 +444,24 @@ const mediaPlayer = function (t, config) {
|
|
444
444
|
return this;
|
445
445
|
},
|
446
446
|
fetch: function () {
|
447
|
-
|
448
|
-
return new Promise(function (resolve, reject) {
|
447
|
+
return new Promise((resolve, reject) => {
|
449
448
|
if (playlist.data.length > 0) {
|
450
449
|
resolve(true);
|
451
450
|
}
|
452
451
|
else {
|
453
|
-
if (
|
452
|
+
if (this.options.rawList) {
|
454
453
|
const promises = [];
|
455
|
-
|
454
|
+
this.options.rawList.forEach(function (raw, index) {
|
456
455
|
promises.push(new Promise(function (resolve, reject) {
|
457
456
|
let group = index;
|
458
457
|
let source;
|
459
458
|
if (!raw.list) {
|
460
459
|
group = 0;
|
461
|
-
|
460
|
+
this.group = false;
|
462
461
|
source = [raw];
|
463
462
|
}
|
464
463
|
else {
|
465
|
-
|
464
|
+
this.group = true;
|
466
465
|
source = raw.list;
|
467
466
|
}
|
468
467
|
utils.fetch(source).then(function (list) {
|
@@ -480,7 +479,7 @@ const mediaPlayer = function (t, config) {
|
|
480
479
|
if (c) {
|
481
480
|
playlist.create();
|
482
481
|
controller.create();
|
483
|
-
|
482
|
+
this.mode();
|
484
483
|
}
|
485
484
|
});
|
486
485
|
},
|