hexo-theme-stellar 1.24.0 → 1.24.1

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/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.24.0'
3
+ version: '1.24.1'
4
4
  homepage: 'https://xaoxuu.com/wiki/stellar/'
5
5
  repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
6
6
  cdn_css: # Use cdn links instead of /css/main.css
@@ -2,7 +2,7 @@
2
2
  function layoutDiv() {
3
3
  var el = '<widget class="widget-wrapper search">'
4
4
  el += '<div class="widget-body">'
5
- el += '<div class="search-wrapper" id="search">'
5
+ el += '<div class="search-wrapper" id="search-wrapper">'
6
6
  el += '<form class="search-form">'
7
7
  var filter = ''
8
8
  if (item.filter == 'auto') {
@@ -27,7 +27,7 @@ function layoutDiv() {
27
27
  } else {
28
28
  el += ' placeholder="' + (item.placeholder || __('search.search')) + '">'
29
29
  }
30
- el += '<svg t="1670596976048" class="icon search-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2676" width="200" height="200"><path d="M938.2 832.6L723.8 618.1c-2.5-2.5-5.3-4.4-7.9-6.4 36.2-55.6 57.3-121.8 57.3-193.1C773.3 222.8 614.6 64 418.7 64S64 222.8 64 418.6c0 195.9 158.8 354.6 354.6 354.6 71.3 0 137.5-21.2 193.2-57.4 2 2.7 3.9 5.4 6.3 7.8L832.5 938c14.6 14.6 33.7 21.9 52.8 21.9 19.1 0 38.2-7.3 52.8-21.8 29.2-29.1 29.2-76.4 0.1-105.5M418.7 661.3C284.9 661.3 176 552.4 176 418.6 176 284.9 284.9 176 418.7 176c133.8 0 242.6 108.9 242.6 242.7 0 133.7-108.9 242.6-242.6 242.6" p-id="2677"></path></svg>'
30
+ el += '<svg t="1705074644177" class="icon search-icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1560" width="200" height="200"><path d="M1008.839137 935.96571L792.364903 719.491476a56.783488 56.783488 0 0 0-80.152866 0 358.53545 358.53545 0 1 1 100.857314-335.166073 362.840335 362.840335 0 0 1-3.689902 170.145468 51.248635 51.248635 0 1 0 99.217358 26.444296 462.057693 462.057693 0 1 0-158.255785 242.303546l185.930047 185.725053a51.248635 51.248635 0 0 0 72.568068 0 51.248635 51.248635 0 0 0 0-72.978056z" fill="#111111" p-id="1561"></path><path d="M616.479587 615.969233a50.428657 50.428657 0 0 0-61.498362-5.534852 174.655348 174.655348 0 0 1-177.525271 3.484907 49.403684 49.403684 0 0 0-58.833433 6.76482l-3.074918 2.869923a49.403684 49.403684 0 0 0 8.609771 78.10292 277.767601 277.767601 0 0 0 286.992355-5.739847 49.403684 49.403684 0 0 0 8.404776-76.667958z" fill="#00C569" p-id="1562"></path></svg>'
31
31
  el += '</form>'
32
32
  el += '<div id="search-result"></div>'
33
33
  el += '<div class="search-no-result">' + __('search.no_results') + '</div>'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-stellar",
3
- "version": "1.24.0",
3
+ "version": "1.24.1",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -14,7 +14,7 @@ module.exports = ctx => function(args) {
14
14
  args.type = 'audio/mp3'
15
15
  }
16
16
  return `
17
- <div class="tag-plugin video">
17
+ <div class="tag-plugin audio">
18
18
  <audio controls preload>
19
19
  <source src="${args.src}" type="${args.type}">Your browser does not support the audio tag.
20
20
  </audio>
@@ -9,7 +9,15 @@
9
9
  'use strict';
10
10
 
11
11
  module.exports = ctx => function(args) {
12
- args = ctx.args.map(args, ['type'], ['src'])
12
+ args = ctx.args.map(args, ['type', 'bilibili', 'ratio'], ['src'])
13
+ if (args.bilibili) {
14
+ return `
15
+ <div class="tag-plugin video" style="aspect-ratio:${args.ratio || 16/9}">
16
+ <iframe src="https://player.bilibili.com/player.html?bvid=${args.bilibili}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true">
17
+ </iframe>
18
+ </div>
19
+ `
20
+ }
13
21
  if (args.type == null) {
14
22
  args.type = 'video/mp4'
15
23
  }
@@ -1,9 +1,4 @@
1
1
  audio,video
2
- border-radius: $border-block
3
2
  max-width: 100%
4
3
  video
5
- z-index: 1
6
- box-shadow: $boxshadow-card-float
7
- .video
8
- line-height: 0
9
- text-align: center
4
+ z-index: 1
@@ -0,0 +1,11 @@
1
+ .tag-plugin.video
2
+ line-height: 0
3
+ text-align: center
4
+ video, iframe
5
+ border-radius: $border-card
6
+ box-shadow: $boxshadow-card-float
7
+ z-index 1
8
+ background: var(--block)
9
+ width: 100%
10
+ height: 100%
11
+ margin: 0
@@ -1,5 +1,4 @@
1
1
  .widgets .widget-wrapper.search
2
- margin-top: 1rem
3
2
  margin-bottom: 0
4
3
 
5
4
  .search-wrapper
@@ -12,36 +11,21 @@
12
11
  align-items: center
13
12
  transition: 0.38s ease-out
14
13
  z-index: 0
15
- &:after
16
- content: ''
17
- position absolute
18
- left: 0
19
- right: 0
20
- bottom: 0
21
- height: 2px
22
- border-radius: 4px
23
- background: convert(hexo-config('style.gradient.search'))
24
- background-size: 200%
25
- animation: glow 10s linear infinite
26
- @keyframes glow {
27
- from {
28
- background-position: 0%
29
- }
30
- to {
31
- background-position: 200%
32
- }
33
- }
34
14
  .search-input
35
15
  width: 100%
36
16
  padding: 0.5rem 0
37
- line-height: 1
17
+ line-height: 1.5
38
18
  box-sizing: border-box
39
19
  font-family: $ff-body
20
+ font-size: $fs-13
40
21
  color: var(--text-p0)
22
+
41
23
 
42
- &.noresult
24
+ &.noresult[searching='true']
43
25
  .search-icon
44
26
  color: $c-red
27
+ .search-form
28
+ border: 1px solid $c-red
45
29
 
46
30
  .search-no-result
47
31
  display: none
@@ -88,22 +72,27 @@
88
72
 
89
73
 
90
74
 
91
- .search-wrapper.noresult
75
+ .search-wrapper.noresult[searching='true']
92
76
  .search-no-result
93
77
  display: block
94
78
 
95
79
  .widget-wrapper
96
80
  .search-form
97
81
  top: 0
98
- background: var(--site-bg)
82
+ background: var(--card)
83
+ border: 1px solid var(--block-border)
84
+ border-radius: $border-bar
99
85
  .search-input
100
- padding-left: 1.5rem
86
+ text-indent: 0.75rem
87
+ padding-right: 2rem
101
88
  .search-icon
102
- position: absolute
103
- margin-left: 0.25rem
104
- left: 0
89
+ margin: 2px
90
+ position absolute
91
+ right: 0
105
92
  pointer-events: none
106
93
  color: var(--text-p2)
94
+ padding: 0.5rem
95
+ border-radius: 'calc(%s - 2px)' % $border-bar
107
96
 
108
97
  #search-result,.search-no-result
109
98
  margin-top: 1rem
package/source/js/main.js CHANGED
@@ -362,7 +362,7 @@ if (stellar.search.service) {
362
362
  }
363
363
  path = stellar.config.root + path;
364
364
  const filter = $inputArea.attr('data-filter') || '';
365
- searchFunc(path, filter, 'search-input', 'search-result');
365
+ searchFunc(path, filter, 'search-wrapper', 'search-input', 'search-result');
366
366
  });
367
367
  $inputArea.keydown(function(e) {
368
368
  if (e.which == 13) {
@@ -22,7 +22,7 @@
22
22
  // Pieter Robberechts <http://github.com/probberechts>
23
23
 
24
24
  /*exported searchFunc*/
25
- var searchFunc = function(path, filter, searchId, contentId) {
25
+ var searchFunc = function(path, filter, wrapperId, searchId, contentId) {
26
26
 
27
27
  function getAllCombinations(keywords) {
28
28
  var i, j, result = [];
@@ -43,6 +43,7 @@ var searchFunc = function(path, filter, searchId, contentId) {
43
43
  var $input = document.getElementById(searchId);
44
44
  if (!$input) { return; }
45
45
  var $resultContent = document.getElementById(contentId);
46
+ var $wrapper = document.getElementById(wrapperId);
46
47
 
47
48
  $input.addEventListener("input", function(){
48
49
  var resultList = [];
@@ -50,8 +51,10 @@ var searchFunc = function(path, filter, searchId, contentId) {
50
51
  .sort(function(a,b) { return b.split(" ").length - a.split(" ").length; });
51
52
  $resultContent.innerHTML = "";
52
53
  if (this.value.trim().length <= 0) {
54
+ $wrapper.setAttribute('searching', 'false');
53
55
  return;
54
56
  }
57
+ $wrapper.setAttribute('searching', 'true');
55
58
  // perform local searching
56
59
  datas.forEach(function(data) {
57
60
  if (!data.content?.trim().length) { return }