hexo-theme-shokax 0.0.4-alpha → 0.0.4-alpha2
Sign up to get free protection for your applications and to get access to all the features.
- package/layout/_partials/footer.pug +1 -1
- package/layout/_partials/sidebar/menu.pug +2 -2
- package/layout/_partials/sidebar/overview.pug +1 -1
- package/package.json +1 -1
- package/source/css/_common/components/post/post.styl +5 -0
- package/source/css/_common/components/third-party/valine.styl +4 -0
- package/source/js/_app/global.js +5 -5
- package/source/js/_app/library.js +0 -12
- package/source/js/_app/page.js +18 -16
- package/source/js/_app/vue.js +1 -1
@@ -5,7 +5,7 @@ div(class="status")
|
|
5
5
|
span(itemprop="copyrightYear")
|
6
6
|
!= copyright_year
|
7
7
|
span(class="with-love")
|
8
|
-
i(class=`
|
8
|
+
i(class=`fa fa-solid fa-${ theme.footer.icon.name }`)
|
9
9
|
span(class="author" itemprop="copyrightHolder")
|
10
10
|
!= `${author} @ ${ alternate?alternate:title}`
|
11
11
|
if theme.footer.count
|
@@ -3,7 +3,7 @@ mixin item(name, path, parent, dropdown, sublist)
|
|
3
3
|
- var path = path.split('||')
|
4
4
|
- var itemURL = path[0].trim()
|
5
5
|
- if (!itemURL.startsWith('http')){ itemURL = itemURL.replace('//', '/') }
|
6
|
-
- var menuIcon = '<i class="
|
6
|
+
- var menuIcon = '<i class="fa fa-solid fa-' + trimn(path[1]) + '"></i>'
|
7
7
|
- var menuText = __('menu.' + name).replace('menu.', '')
|
8
8
|
if parent
|
9
9
|
li(class="item dropdown")
|
@@ -21,7 +21,7 @@ mixin item(name, path, parent, dropdown, sublist)
|
|
21
21
|
- var menuText = __('menu.' + subname).replace('menu.', '')
|
22
22
|
if subname == 'default'
|
23
23
|
- var menuText = __('menu.' + name).replace('menu.', '')
|
24
|
-
- var menuIcon = '<i class="
|
24
|
+
- var menuIcon = '<i class="fa fa-solid fa-' + trimn(path[1]) + '"></i>'
|
25
25
|
li(class="item")
|
26
26
|
!= _url(itemURL, menuIcon + menuText, {rel: 'section'})
|
27
27
|
else
|
@@ -32,7 +32,7 @@ nav(class="state")
|
|
32
32
|
div(class="social")
|
33
33
|
each link, name in theme.social
|
34
34
|
- var sidebarURL = link.split('||')[0].trim()
|
35
|
-
- var sidebarIcon = '<i class="
|
35
|
+
- var sidebarIcon = '<i class="fa fa-solid fa-' + link.split('||')[1].trim() + '"></i>'
|
36
36
|
!= _url(sidebarURL, sidebarIcon, {title: sidebarURL, class: 'item ' + name})
|
37
37
|
|
38
38
|
!= shokax_inject('sidebar')
|
package/package.json
CHANGED
package/source/js/_app/global.js
CHANGED
@@ -25,16 +25,16 @@ let LOCAL_HASH = 0;
|
|
25
25
|
let LOCAL_URL = window.location.href;
|
26
26
|
let pjax;
|
27
27
|
const changeTheme = function (type) {
|
28
|
-
const btn = $dom('.theme .
|
28
|
+
const btn = $dom('.theme .fa');
|
29
29
|
if (type === 'dark') {
|
30
30
|
HTML.attr('data-theme', type);
|
31
|
-
btn.removeClass('
|
32
|
-
btn.addClass('
|
31
|
+
btn.removeClass('fa-sunrise');
|
32
|
+
btn.addClass('fa-moon-stars');
|
33
33
|
}
|
34
34
|
else {
|
35
35
|
HTML.attr('data-theme', null);
|
36
|
-
btn.removeClass('
|
37
|
-
btn.addClass('
|
36
|
+
btn.removeClass('fa-moon-stars');
|
37
|
+
btn.addClass('fa-sunrise');
|
38
38
|
}
|
39
39
|
};
|
40
40
|
const autoDarkmode = function () {
|
@@ -288,18 +288,6 @@ const pjaxScript = function (element) {
|
|
288
288
|
}
|
289
289
|
parent.appendChild(script);
|
290
290
|
};
|
291
|
-
const pageScrollOld = function (target, offset, complete) {
|
292
|
-
const opt = {
|
293
|
-
targets: typeof offset === 'number' ? target.parentNode : document.scrollingElement,
|
294
|
-
duration: 500,
|
295
|
-
easing: 'easeInOutQuad',
|
296
|
-
scrollTop: offset || (typeof target === 'number' ? target : (target ? target.top() + document.documentElement.scrollTop - siteNavHeight : 0)),
|
297
|
-
complete: function () {
|
298
|
-
complete && complete();
|
299
|
-
}
|
300
|
-
};
|
301
|
-
anime(opt);
|
302
|
-
};
|
303
291
|
const pageScroll = (target, offset, complete) => {
|
304
292
|
const opt = {
|
305
293
|
left: 0,
|
package/source/js/_app/page.js
CHANGED
@@ -175,7 +175,7 @@ const postBeauty = function () {
|
|
175
175
|
$dom.each('figure.highlight', function (element) {
|
176
176
|
const code_container = element.child('.code-container');
|
177
177
|
const caption = element.child('figcaption');
|
178
|
-
element.insertAdjacentHTML('beforeend', '<div class="operation"><span class="breakline-btn"><i class="
|
178
|
+
element.insertAdjacentHTML('beforeend', '<div class="operation"><span class="breakline-btn"><i class="fa fa-solid fa-align-left"></i></span><span class="copy-btn"><i class="fa fa-solid fa-clipboard"></i></span><span class="fullscreen-btn"><i class="fa fa-solid fa-expand"></i></span></div>');
|
179
179
|
const copyBtn = element.child('.copy-btn');
|
180
180
|
if (LOCAL.nocopy) {
|
181
181
|
copyBtn.remove();
|
@@ -190,14 +190,14 @@ const postBeauty = function () {
|
|
190
190
|
comma = '\n';
|
191
191
|
});
|
192
192
|
clipBoard(code, function (result) {
|
193
|
-
target.child('.
|
193
|
+
target.child('.fa').className = result ? 'fa fa-solid fa-check' : 'fa fa-solid fa-times';
|
194
194
|
target.blur();
|
195
195
|
showtip(LOCAL.copyright);
|
196
196
|
});
|
197
197
|
}, { passive: true });
|
198
198
|
copyBtn.addEventListener('mouseleave', function (event) {
|
199
199
|
setTimeout(function () {
|
200
|
-
event.target.child('.
|
200
|
+
event.target.child('.fa').className = 'fa fa-solid fa-clipboard';
|
201
201
|
}, 1000);
|
202
202
|
});
|
203
203
|
}
|
@@ -206,11 +206,11 @@ const postBeauty = function () {
|
|
206
206
|
const target = event.currentTarget;
|
207
207
|
if (element.hasClass('breakline')) {
|
208
208
|
element.removeClass('breakline');
|
209
|
-
target.child('.
|
209
|
+
target.child('.fa').className = 'fa fa-solid fa-align-left';
|
210
210
|
}
|
211
211
|
else {
|
212
212
|
element.addClass('breakline');
|
213
|
-
target.child('.
|
213
|
+
target.child('.fa').className = 'fa fa-solid fa-align-justify';
|
214
214
|
}
|
215
215
|
});
|
216
216
|
const fullscreenBtn = element.child('.fullscreen-btn');
|
@@ -218,7 +218,7 @@ const postBeauty = function () {
|
|
218
218
|
element.removeClass('fullscreen');
|
219
219
|
element.scrollTop = 0;
|
220
220
|
BODY.removeClass('fullscreen');
|
221
|
-
fullscreenBtn.child('.
|
221
|
+
fullscreenBtn.child('.fa').className = 'fa fa-solid fa-expand';
|
222
222
|
};
|
223
223
|
const fullscreenHandle = function (event) {
|
224
224
|
const target = event.currentTarget;
|
@@ -234,7 +234,7 @@ const postBeauty = function () {
|
|
234
234
|
else {
|
235
235
|
element.addClass('fullscreen');
|
236
236
|
BODY.addClass('fullscreen');
|
237
|
-
fullscreenBtn.child('.
|
237
|
+
fullscreenBtn.child('.fa').className = 'fa fa-solid fa-compress';
|
238
238
|
if (code_container && code_container.find('tr').length > 15) {
|
239
239
|
const showBtn = code_container.child('.show-btn');
|
240
240
|
code_container.style.maxHeight = '';
|
@@ -246,7 +246,7 @@ const postBeauty = function () {
|
|
246
246
|
caption && caption.addEventListener('click', fullscreenHandle);
|
247
247
|
if (code_container && code_container.find('tr').length > 15) {
|
248
248
|
code_container.style.maxHeight = '300px';
|
249
|
-
code_container.insertAdjacentHTML('beforeend', '<div class="show-btn"><i class="
|
249
|
+
code_container.insertAdjacentHTML('beforeend', '<div class="show-btn"><i class="fa fa-solid fa-angle-down"></i></div>');
|
250
250
|
const showBtn = code_container.child('.show-btn');
|
251
251
|
const hideCode = function () {
|
252
252
|
code_container.style.maxHeight = '300px';
|
@@ -414,7 +414,7 @@ const algoliaSearch = function (pjax) {
|
|
414
414
|
if (!siteSearch) {
|
415
415
|
siteSearch = BODY.createChild('div', {
|
416
416
|
id: 'search',
|
417
|
-
innerHTML: '<div class="inner"><div class="header"><span class="icon"><i class="
|
417
|
+
innerHTML: '<div class="inner"><div class="header"><span class="icon"><i class="fa fa-solid fa-magnifying-glass"></i></span><div class="search-input-container"></div><span class="close-btn"><i class="fa fa-solid fa-times-circle"></i></span></div><div class="results"><div class="inner"><div id="search-stats"></div><div id="search-hits"></div><div id="search-pagination"></div></div></div></div>'
|
418
418
|
});
|
419
419
|
}
|
420
420
|
const search = instantsearch({
|
@@ -459,7 +459,7 @@ const algoliaSearch = function (pjax) {
|
|
459
459
|
container: '#search-hits',
|
460
460
|
templates: {
|
461
461
|
item: function (data) {
|
462
|
-
const cats = data.categories ? '<span>' + data.categories.join('<i class="
|
462
|
+
const cats = data.categories ? '<span>' + data.categories.join('<i class="fa fa-solid fa-angle-right"></i>') + '</span>' : '';
|
463
463
|
return '<a href="' + CONFIG.root + data.path + '">' + cats + data._highlightResult.title.value + '</a>';
|
464
464
|
},
|
465
465
|
empty: function (data) {
|
@@ -478,10 +478,10 @@ const algoliaSearch = function (pjax) {
|
|
478
478
|
showFirst: false,
|
479
479
|
showLast: false,
|
480
480
|
templates: {
|
481
|
-
first: '<i class="
|
482
|
-
last: '<i class="
|
483
|
-
previous: '<i class="
|
484
|
-
next: '<i class="
|
481
|
+
first: '<i class="fa fa=solid fa-angle-double-left"></i>',
|
482
|
+
last: '<i class="fa fa-solid fa-angle-double-right"></i>',
|
483
|
+
previous: '<i class="fa fa-solid fa-angle-left"></i>',
|
484
|
+
next: '<i class="fa fa-solid fa-angle-right"></i>'
|
485
485
|
},
|
486
486
|
cssClasses: {
|
487
487
|
root: 'pagination',
|
@@ -530,7 +530,7 @@ const domInit = function () {
|
|
530
530
|
if (!toolBtn) {
|
531
531
|
toolBtn = siteHeader.createChild('div', {
|
532
532
|
id: 'tool',
|
533
|
-
innerHTML: '<div class="item player"></div><div class="item contents"><i class="
|
533
|
+
innerHTML: '<div class="item player"></div><div class="item contents"><i class="fa fa-solid fa-list-ol"></i></div><div class="item chat"><i class="fa fa-solid fa-comments"></i></div><div class="item back-to-top"><i class="fa fa-solid fa-arrow-up"></i><span>0%</span></div>'
|
534
534
|
});
|
535
535
|
}
|
536
536
|
toolPlayer = toolBtn.child('.player');
|
@@ -618,6 +618,8 @@ const siteInit = function () {
|
|
618
618
|
});
|
619
619
|
siteRefresh(1);
|
620
620
|
};
|
621
|
-
window.addEventListener('DOMContentLoaded', siteInit
|
621
|
+
window.addEventListener('DOMContentLoaded', siteInit, {
|
622
|
+
passive: true
|
623
|
+
});
|
622
624
|
console.log('%c Theme.ShokaX v' + CONFIG.version + ' %c https://github.com/zkz098/hexo-theme-shokaX ', 'color: white; background: #e9546b; padding:5px 0;', 'padding:4px;border:1px solid #e9546b;');
|
623
625
|
console.log('%c by kaitaku ' + '%c https://www.kaitaku.xyz', 'color: white; background: #00bfff; padding: 5px 3px;', 'padding: 4px;border:1px solid #00bfff');
|
package/source/js/_app/vue.js
CHANGED
@@ -5,7 +5,7 @@ Vue.createApp({
|
|
5
5
|
methods: {
|
6
6
|
changeThemeByBtn() {
|
7
7
|
let c;
|
8
|
-
const btn = $dom('.theme').child('.
|
8
|
+
const btn = $dom('.theme').child('.fa');
|
9
9
|
const neko = BODY.createChild('div', {
|
10
10
|
id: 'neko',
|
11
11
|
innerHTML: '<div class="planet"><div class="sun"></div><div class="moon"></div></div><div class="body"><div class="face"><section class="eyes left"><span class="pupil"></span></section><section class="eyes right"><span class="pupil"></span></section><span class="nose"></span></div></div>'
|