hexo-theme-shokax 0.0.4-alpha → 0.0.4-alpha3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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-brands 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-alpha3",
4
4
  "description": "a hexo theme based on shoka",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/zkz098/hexo-theme-shokaX",
@@ -243,7 +243,7 @@ code,
243
243
  background: var(--grey-2);
244
244
  }
245
245
 
246
- .ic {
246
+ .fa {
247
247
  margin-top: 1rem;
248
248
  @extend .up-down;
249
249
  }
@@ -256,7 +256,7 @@ code,
256
256
  display: none;
257
257
  }
258
258
 
259
- .ic {
259
+ .fa {
260
260
  @extend .down-up;
261
261
  }
262
262
  }
@@ -69,7 +69,7 @@ $item {
69
69
  font-size: $font-size-smaller;
70
70
  color: var(--grey-5);
71
71
 
72
- .ic {
72
+ .fa {
73
73
  margin-right: .0625rem;
74
74
  }
75
75
 
@@ -208,7 +208,7 @@ $item {
208
208
  }
209
209
 
210
210
  .title {
211
- .ic {
211
+ .fa {
212
212
  font-size: 80%;
213
213
  }
214
214
  }
@@ -5,7 +5,7 @@
5
5
  margin: 1.25rem 0;
6
6
  flex-wrap: wrap;
7
7
 
8
- .ic {
8
+ .fa {
9
9
  margin: 0 .125rem;
10
10
  color: var(--grey-4);
11
11
 
@@ -6,7 +6,7 @@
6
6
  font-family: $font-family-posts;
7
7
  word-wrap();
8
8
 
9
- .exturl .ic {
9
+ .exturl .fa {
10
10
  font-size: $font-size-small;
11
11
  margin-left: .25rem;
12
12
  }
@@ -39,7 +39,7 @@
39
39
  font-weight: bold;
40
40
  color: var(--bg-color);
41
41
  border: none;
42
- .ic {
42
+ .fa {
43
43
  display: none;
44
44
  }
45
45
  }
@@ -186,12 +186,11 @@
186
186
  margin: .5rem;
187
187
  overflow: hidden;
188
188
  vertical-align: middle;
189
-
190
- &.actived .ic {
189
+ &.actived .fa {
191
190
  color: var(--primary-color);
192
191
  }
193
192
 
194
- .ic {
193
+ .fa {
195
194
  color: var(--grey-6);
196
195
  transition: all .25s ease;
197
196
 
@@ -22,7 +22,7 @@
22
22
  }
23
23
  }
24
24
 
25
- .ic {
25
+ .fa {
26
26
  margin-right: .5rem;
27
27
  }
28
28
 
@@ -32,7 +32,7 @@
32
32
  }
33
33
  }
34
34
 
35
- .ic {
35
+ .fa {
36
36
  margin-right: .625rem;
37
37
  }
38
38
 
@@ -129,15 +129,15 @@ dd {
129
129
  input, textarea {
130
130
  color: var(--text-color);
131
131
  }
132
- @font-face {
133
- font-family: 'ic';
134
- src: url('//at.alicdn.com/t/font_' + $iconfont + '.eot');
135
- src: url('//at.alicdn.com/t/font_' + $iconfont + '.eot?#iefix') format('embedded-opentype'),
136
- url('//at.alicdn.com/t/font_' + $iconfont + '.woff2') format('woff2'),
137
- url('//at.alicdn.com/t/font_' + $iconfont + '.woff') format('woff'),
138
- url('//at.alicdn.com/t/font_' + $iconfont + '.ttf') format('truetype'),
139
- url('//at.alicdn.com/t/font_' + $iconfont + '.svg#ic') format('svg');
140
- }
132
+ //@font-face {
133
+ // font-family: 'ic';
134
+ // src: url('//at.alicdn.com/t/font_' + $iconfont + '.eot');
135
+ // src: url('//at.alicdn.com/t/font_' + $iconfont + '.eot?#iefix') format('embedded-opentype'),
136
+ // url('//at.alicdn.com/t/font_' + $iconfont + '.woff2') format('woff2'),
137
+ // url('//at.alicdn.com/t/font_' + $iconfont + '.woff') format('woff'),
138
+ // url('//at.alicdn.com/t/font_' + $iconfont + '.ttf') format('truetype'),
139
+ // url('//at.alicdn.com/t/font_' + $iconfont + '.svg#ic') format('svg');
140
+ //}
141
141
 
142
142
  @font-face {
143
143
  font-family: 'jetbrains-mono';
@@ -146,19 +146,6 @@ input, textarea {
146
146
  }
147
147
 
148
148
  // TODO
149
- .ic {
150
- font-family: "ic" !important;
151
- -webkit-font-smoothing: antialiased;
152
- -moz-osx-font-smoothing: grayscale;
153
- text-align: center;
154
- width: 1.25em;
155
- display: inline-block;
156
- font-style: normal;
157
- font-variant: normal;
158
- text-rendering: auto;
159
- line-height: 1;
160
- }
161
-
162
149
  .fa {
163
150
  -webkit-font-smoothing: antialiased;
164
151
  -moz-osx-font-smoothing: grayscale;
@@ -172,20 +159,12 @@ input, textarea {
172
159
  }
173
160
 
174
161
  // TODO
175
- .ic em {
176
- font-size: 0;
177
- }
178
162
 
179
163
  .fa em {
180
164
  font-size: 0;
181
165
  }
182
166
 
183
167
  // TODO
184
- .ic-lg {
185
- font-size: 1.33333em;
186
- line-height: .75em;
187
- vertical-align: -.0667em;
188
- }
189
168
 
190
169
  .fa-lg {
191
170
  font-size: 1.33333em;
@@ -41,7 +41,7 @@
41
41
  cursor: not-allowed
42
42
  }
43
43
 
44
- .ic {
44
+ .fa {
45
45
  text-align: left;
46
46
  width: (18em / 14);
47
47
  }
@@ -13,10 +13,10 @@ if $colors = hexo-config('style.colors')
13
13
  else
14
14
  @import "_colors";
15
15
 
16
- if $_iconfont = hexo-config('style.iconfont')
17
- @import $_iconfont;
18
- else
19
- @import "_iconfont";
16
+ //if $_iconfont = hexo-config('style.iconfont')
17
+ // @import $_iconfont;
18
+ //else
19
+ // @import "_iconfont";
20
20
 
21
21
  // Scaffolding
22
22
  @import "_common/scaffolding";
@@ -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>'