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 +1 -1
- package/layout/_partial/widgets/search.ejs +2 -2
- package/package.json +1 -1
- package/scripts/tags/lib/audio.js +1 -1
- package/scripts/tags/lib/video.js +9 -1
- package/source/css/_common/media.styl +1 -6
- package/source/css/_layout/tag-plugins/media.styl +11 -0
- package/source/css/_layout/widgets/search.styl +17 -28
- package/source/js/main.js +1 -1
- package/source/js/search/local-search.js +4 -1
package/_config.yml
CHANGED
|
@@ -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="
|
|
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
|
@@ -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
|
|
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,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(--
|
|
82
|
+
background: var(--card)
|
|
83
|
+
border: 1px solid var(--block-border)
|
|
84
|
+
border-radius: $border-bar
|
|
99
85
|
.search-input
|
|
100
|
-
|
|
86
|
+
text-indent: 0.75rem
|
|
87
|
+
padding-right: 2rem
|
|
101
88
|
.search-icon
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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 }
|