hexo-theme-shokax 0.0.4-alpha → 0.0.4-alpha2

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.
@@ -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=`ic i-${ theme.footer.icon.name }`)
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="ic i-' + trimn(path[1]) + '"></i>'
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="ic i-' + trimn(path[1]) + '"></i>'
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="ic i-' + link.split('||')[1].trim() + '"></i>'
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.0.4-alpha",
3
+ "version": "0.0.4-alpha2",
4
4
  "description": "a hexo theme based on shoka",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/zkz098/hexo-theme-shokaX",
@@ -11,6 +11,11 @@
11
11
  margin-left: .25rem;
12
12
  }
13
13
 
14
+ .exturl .fa {
15
+ font-size: $font-size-small;
16
+ margin-left: .25rem;
17
+ }
18
+
14
19
  .button {
15
20
  margin-top: 2.5rem;
16
21
  text-align: center;
@@ -191,6 +191,10 @@
191
191
  color: var(--primary-color);
192
192
  }
193
193
 
194
+ &.actived .fa {
195
+ color: var(--primary-color);
196
+ }
197
+
194
198
  .ic {
195
199
  color: var(--grey-6);
196
200
  transition: all .25s ease;
@@ -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 .ic');
28
+ const btn = $dom('.theme .fa');
29
29
  if (type === 'dark') {
30
30
  HTML.attr('data-theme', type);
31
- btn.removeClass('i-sun');
32
- btn.addClass('i-moon');
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('i-moon');
37
- btn.addClass('i-sun');
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,
@@ -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="ic i-align-left"></i></span><span class="copy-btn"><i class="ic i-clipboard"></i></span><span class="fullscreen-btn"><i class="ic i-expand"></i></span></div>');
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('.ic').className = result ? 'ic i-check' : 'ic i-times';
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('.ic').className = 'ic i-clipboard';
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('.ic').className = 'ic i-align-left';
209
+ target.child('.fa').className = 'fa fa-solid fa-align-left';
210
210
  }
211
211
  else {
212
212
  element.addClass('breakline');
213
- target.child('.ic').className = 'ic i-align-justify';
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('.ic').className = 'ic i-expand';
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('.ic').className = 'ic i-compress';
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="ic i-angle-down"></i></div>');
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="ic i-search"></i></span><div class="search-input-container"></div><span class="close-btn"><i class="ic i-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>'
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="ic i-angle-right"></i>') + '</span>' : '';
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="ic i-angle-double-left"></i>',
482
- last: '<i class="ic i-angle-double-right"></i>',
483
- previous: '<i class="ic i-angle-left"></i>',
484
- next: '<i class="ic i-angle-right"></i>'
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="ic i-list-ol"></i></div><div class="item chat"><i class="ic i-comments"></i></div><div class="item back-to-top"><i class="ic i-arrow-up"></i><span>0%</span></div>'
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');
@@ -5,7 +5,7 @@ Vue.createApp({
5
5
  methods: {
6
6
  changeThemeByBtn() {
7
7
  let c;
8
- const btn = $dom('.theme').child('.ic');
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>'