hexo-theme-gnix 5.0.2 → 5.0.4
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/layout/common/article.jsx +1 -1
- package/layout/common/navbar.jsx +2 -17
- package/layout/layout.jsx +1 -1
- package/layout/plugin/swup.jsx +13 -3
- package/layout/tag.jsx +32 -4
- package/package.json +1 -1
- package/source/css/default.css +40 -74
- package/source/css/responsive/desktop.css +7 -7
- package/source/css/responsive/mobile.css +1 -0
- package/source/css/responsive/touch.css +2 -1
- package/source/css/shiki/shiki.css +40 -44
- package/source/css/twikoo.css +54 -108
- package/source/js/host/swup/head-plugin.umd.min.js +2 -0
- package/source/js/insight.js +14 -11
package/layout/common/navbar.jsx
CHANGED
|
@@ -38,23 +38,8 @@ class Navbar extends Component {
|
|
|
38
38
|
return (
|
|
39
39
|
<nav class="navbar navbar-main" onclick="handleNavbarClick(event);">
|
|
40
40
|
<div class="navbar-container">
|
|
41
|
-
<a href={siteUrl}>
|
|
42
|
-
|
|
43
|
-
fill="var(--flamingo)"
|
|
44
|
-
viewBox="0 0 1182.000000 750.000000"
|
|
45
|
-
width="5em"
|
|
46
|
-
height="100%"
|
|
47
|
-
role="img"
|
|
48
|
-
aria-label="Blog Logo"
|
|
49
|
-
>
|
|
50
|
-
<g
|
|
51
|
-
transform="translate(0.000000,930.000000) scale(0.100000,-0.100000)"
|
|
52
|
-
stroke="none"
|
|
53
|
-
>
|
|
54
|
-
<path d="M4915 7175 c-238 -39 -533 -139 -794 -270 -549 -275 -1067 -758 -1291 -1205 -73 -145 -95 -225 -94 -345 0 -120 23 -188 86 -260 203 -231 774 -132 1521 262 185 97 298 161 372 209 l30 19 -19 -30 c-11 -16 -50 -74 -88 -130 l-69 -100 -102 -46 c-564 -253 -1269 -905 -1508 -1394 -118 -241 -121 -414 -9 -525 149 -150 390 -86 629 165 150 158 405 524 664 951 80 132 212 348 294 480 l148 239 70 24 c84 28 203 38 262 22 57 -16 100 -54 115 -102 20 -69 78 -90 123 -45 l24 24 15 -22 c9 -15 11 -28 5 -37 -16 -26 -9 -34 10 -11 12 13 31 22 48 22 39 0 46 6 88 78 73 125 268 348 406 464 115 98 227 147 230 101 3 -48 -7 -88 -58 -232 -91 -257 -76 -348 63 -374 88 -17 295 69 544 226 l135 85 5 -92 c10 -163 74 -226 232 -226 155 0 283 58 523 235 61 45 141 107 179 138 38 32 72 57 76 57 4 0 18 -31 30 -69 l22 -70 -79 -93 c-139 -162 -240 -309 -300 -433 -48 -101 -43 -157 17 -170 44 -10 77 15 91 67 18 70 161 276 292 423 l44 50 41 -37 c102 -92 323 -101 573 -22 97 30 292 121 394 184 98 60 293 207 306 231 17 33 7 80 -22 102 -35 25 -52 19 -136 -50 -232 -191 -517 -330 -761 -370 -130 -21 -200 -13 -248 29 -18 16 -34 36 -34 44 0 7 55 63 123 125 304 277 553 444 736 495 61 17 62 17 77 -4 10 -14 26 -22 45 -22 45 0 67 16 75 56 5 29 2 40 -17 61 -41 43 -92 63 -162 63 -174 0 -434 -158 -805 -491 -68 -61 -125 -109 -126 -107 -1 1 -17 34 -35 71 -34 70 -76 108 -133 122 -22 6 -36 -3 -99 -60 -97 -89 -338 -270 -433 -324 -144 -82 -255 -110 -304 -75 -44 30 -24 141 53 294 24 47 52 94 64 104 29 26 26 52 -8 87 -22 21 -39 29 -66 29 -49 0 -69 -12 -104 -63 -33 -48 -307 -240 -486 -340 -108 -60 -241 -117 -274 -117 -27 0 -26 12 5 85 99 233 127 382 85 462 -33 66 -73 88 -156 88 -106 -1 -183 -45 -337 -194 -43 -41 -78 -71 -78 -68 0 10 60 118 82 146 63 82 -57 168 -131 94 -33 -34 -137 -260 -241 -522 l-77 -194 -17 49 c-22 68 -63 115 -134 152 -70 37 -173 54 -266 45 l-60 -6 79 114 c143 210 249 343 339 429 229 217 236 225 242 257 5 26 1 37 -19 57 -16 16 -37 26 -54 26 -39 0 -142 -80 -250 -193 -99 -104 -201 -187 -378 -305 -429 -286 -1057 -565 -1435 -636 -95 -18 -257 -21 -315 -5 -51 14 -110 73 -124 124 -47 168 80 462 316 736 425 490 995 840 1638 1004 235 60 436 71 493 27 23 -17 27 -26 24 -61 -3 -52 9 -76 47 -89 60 -21 101 26 101 116 0 85 -34 132 -125 174 -45 20 -68 23 -215 25 -107 1 -197 -3 -255 -12z m-536 -2152 c-13 -21 -54 -87 -93 -148 -38 -60 -130 -211 -204 -335 -156 -261 -360 -571 -492 -750 -203 -275 -393 -411 -497 -356 -117 60 -104 230 34 458 176 292 619 737 985 990 88 61 271 177 281 177 5 1 -2 -16 -14 -36z" />{" "}
|
|
55
|
-
<path d="M7073 6016 c-60 -27 -83 -120 -42 -165 49 -53 119 -51 168 5 82 93 -11 212 -126 160z" />{" "}
|
|
56
|
-
</g>
|
|
57
|
-
</svg>
|
|
41
|
+
<a href={siteUrl} style={"font-family: homemade-apple; color: var(--text); display: flex; align-items: center; padding: 0 1em;"}>
|
|
42
|
+
GnixAij
|
|
58
43
|
</a>
|
|
59
44
|
<div class="navbar-menu">
|
|
60
45
|
{Object.keys(menu).length ? (
|
package/layout/layout.jsx
CHANGED
|
@@ -19,7 +19,7 @@ module.exports = class extends Component {
|
|
|
19
19
|
<Navbar config={config} helper={helper} page={page} />
|
|
20
20
|
<ThemeSelector />
|
|
21
21
|
<section class="section">
|
|
22
|
-
<div class="main-content" dangerouslySetInnerHTML={{ __html: body }} ></div>
|
|
22
|
+
<div class="main-content" id="swup" dangerouslySetInnerHTML={{ __html: body }} ></div>
|
|
23
23
|
</section>
|
|
24
24
|
<Footer site={site} config={config} helper={helper} />
|
|
25
25
|
<Scripts site={site} config={config} helper={helper} page={page} />
|
package/layout/plugin/swup.jsx
CHANGED
|
@@ -6,12 +6,22 @@ class Swup extends Component {
|
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const swupScript =
|
|
10
|
-
|
|
9
|
+
const swupScript = `
|
|
10
|
+
const swup = new Swup({
|
|
11
|
+
containers: ["#swup"],
|
|
12
|
+
cache: true,
|
|
13
|
+
plugins: [
|
|
14
|
+
new SwupHeadPlugin({
|
|
15
|
+
persistTags: true
|
|
16
|
+
})
|
|
17
|
+
]
|
|
18
|
+
});
|
|
19
|
+
`;
|
|
11
20
|
return (
|
|
12
21
|
<Fragment>
|
|
13
22
|
<script src="/js/host/swup/Swup.umd.min.js"></script>
|
|
14
|
-
<script
|
|
23
|
+
<script src="/js/host/swup/head-plugin.umd.min.js"></script>
|
|
24
|
+
<script dangerouslySetInnerHTML={{ __html: swupScript }}></script>
|
|
15
25
|
</Fragment>
|
|
16
26
|
);
|
|
17
27
|
}
|
package/layout/tag.jsx
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
const { Component, Fragment } = require("../include/util/common");
|
|
2
2
|
const Index = require("./index");
|
|
3
|
+
const breadcrumb_css = `
|
|
4
|
+
.breadcrumb {
|
|
5
|
+
color: var(--blue);
|
|
6
|
+
white-space: nowrap;
|
|
7
|
+
font-family: Monaspace Radon, var(--font-mono);
|
|
8
|
+
|
|
9
|
+
a {
|
|
10
|
+
align-items: center;
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
padding: 0 0.1em;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
ul {
|
|
17
|
+
align-items: flex-start;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
justify-content: flex-start;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
li {
|
|
24
|
+
align-items: center;
|
|
25
|
+
display: flex;
|
|
26
|
+
a {
|
|
27
|
+
color: var(--yellow);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}`;
|
|
3
31
|
|
|
4
32
|
module.exports = class extends Component {
|
|
5
33
|
render() {
|
|
@@ -8,15 +36,15 @@ module.exports = class extends Component {
|
|
|
8
36
|
|
|
9
37
|
return (
|
|
10
38
|
<Fragment>
|
|
39
|
+
<style>{breadcrumb_css}</style>
|
|
11
40
|
<nav class="breadcrumb" aria-label="breadcrumbs">
|
|
12
41
|
<ul>
|
|
13
42
|
<li>
|
|
14
|
-
{" "}
|
|
15
43
|
<font style="color: var(--green)">$</font> ls
|
|
16
|
-
<a href={url_for("/tags/")}>{_p("common.tag", Infinity)}
|
|
44
|
+
<a href={url_for("/tags/")}>{_p("common.tag", Infinity)}/</a>
|
|
17
45
|
</li>
|
|
18
|
-
<li
|
|
19
|
-
<a href="#" aria-current="page">
|
|
46
|
+
<li>
|
|
47
|
+
<a href="#" aria-current="page" style="cursor: default; pointer-events: none; color: var(--mauve);">
|
|
20
48
|
{page.tag}
|
|
21
49
|
</a>
|
|
22
50
|
</li>
|
package/package.json
CHANGED
package/source/css/default.css
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
|
|
15
15
|
"Source Han Sans CN", sans-serif;
|
|
16
16
|
--font-handwriting: "Bradley Hand", "homemade-apple", cursive;
|
|
17
|
+
--radius: 12px;
|
|
18
|
+
--spaceing: 0.25rem;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
/* #region Color */
|
|
@@ -225,7 +227,7 @@ mark {
|
|
|
225
227
|
.navbar-main,
|
|
226
228
|
.navbar-menu {
|
|
227
229
|
user-select: none;
|
|
228
|
-
background:
|
|
230
|
+
background: var(--mantle);
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
body {
|
|
@@ -233,19 +235,11 @@ body {
|
|
|
233
235
|
color: var(--text);
|
|
234
236
|
}
|
|
235
237
|
|
|
236
|
-
.card {
|
|
237
|
-
border: 0.5px dashed var(--surface0);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
238
|
input.task-list-item-checkbox:checked {
|
|
241
239
|
background-color: var(--green);
|
|
242
240
|
border-color: var(--green);
|
|
243
241
|
}
|
|
244
242
|
|
|
245
|
-
.navbar-item {
|
|
246
|
-
color: var(--text);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
243
|
hr {
|
|
250
244
|
background-color: var(--surface0);
|
|
251
245
|
}
|
|
@@ -324,10 +318,10 @@ input:-webkit-autofill {
|
|
|
324
318
|
|
|
325
319
|
@font-face {
|
|
326
320
|
font-family: homemade-apple;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
321
|
+
src:
|
|
322
|
+
local("Homemade Apple"),
|
|
323
|
+
local("HomemadeApple-Regular"),
|
|
324
|
+
url(/css/font/woff2/HomemadeApple.woff2) format("woff2");
|
|
331
325
|
}
|
|
332
326
|
|
|
333
327
|
/* #endregion */
|
|
@@ -385,7 +379,6 @@ body {
|
|
|
385
379
|
flex-direction: column;
|
|
386
380
|
}
|
|
387
381
|
|
|
388
|
-
.breadcrumb,
|
|
389
382
|
.pagination-ellipsis,
|
|
390
383
|
.pagination-link,
|
|
391
384
|
.pagination-next,
|
|
@@ -397,49 +390,10 @@ body {
|
|
|
397
390
|
user-select: none;
|
|
398
391
|
}
|
|
399
392
|
|
|
400
|
-
.breadcrumb:not(:last-child),
|
|
401
393
|
.pagination:not(:last-child) {
|
|
402
394
|
margin-bottom: 0.5rem;
|
|
403
395
|
}
|
|
404
396
|
|
|
405
|
-
.breadcrumb {
|
|
406
|
-
white-space: nowrap;
|
|
407
|
-
font-family: "Monaspace Radon", var(--font-mono);
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
.breadcrumb a {
|
|
411
|
-
align-items: center;
|
|
412
|
-
display: flex;
|
|
413
|
-
justify-content: center;
|
|
414
|
-
padding: 0 0.1em;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
.breadcrumb li {
|
|
418
|
-
align-items: center;
|
|
419
|
-
display: flex;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
.breadcrumb li:first-child a {
|
|
423
|
-
padding-left: 0;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
.breadcrumb li.is-active a {
|
|
427
|
-
cursor: default;
|
|
428
|
-
pointer-events: none;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.breadcrumb li + li::before {
|
|
432
|
-
content: "\0002f";
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.breadcrumb ol,
|
|
436
|
-
.breadcrumb ul {
|
|
437
|
-
align-items: flex-start;
|
|
438
|
-
display: flex;
|
|
439
|
-
flex-wrap: wrap;
|
|
440
|
-
justify-content: flex-start;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
397
|
.toc-text,
|
|
444
398
|
.footer,
|
|
445
399
|
.widget {
|
|
@@ -449,8 +403,9 @@ body {
|
|
|
449
403
|
.card {
|
|
450
404
|
max-width: 100%;
|
|
451
405
|
position: relative;
|
|
452
|
-
border-radius: 24px;
|
|
453
406
|
overflow: visible;
|
|
407
|
+
border-radius: var(--radius);
|
|
408
|
+
border: 0.5px dashed var(--surface0);
|
|
454
409
|
}
|
|
455
410
|
|
|
456
411
|
.card + .card {
|
|
@@ -473,6 +428,7 @@ body {
|
|
|
473
428
|
transition: transform 0.3s ease-in-out;
|
|
474
429
|
z-index: 100;
|
|
475
430
|
font-family: var(--font-sans-serif);
|
|
431
|
+
border-bottom: 0.5px solid var(--surface0);
|
|
476
432
|
}
|
|
477
433
|
|
|
478
434
|
.navbar-container {
|
|
@@ -493,27 +449,18 @@ body {
|
|
|
493
449
|
transform: translateY(-100%);
|
|
494
450
|
}
|
|
495
451
|
|
|
496
|
-
.navbar-menu {
|
|
497
|
-
display: none;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
452
|
.navbar-item {
|
|
453
|
+
color: var(--subtext1);
|
|
501
454
|
align-items: center;
|
|
502
455
|
display: flex;
|
|
503
456
|
font-size: 1.1rem;
|
|
504
|
-
padding: 0 0.
|
|
457
|
+
padding: 0 0.5rem;
|
|
505
458
|
position: relative;
|
|
506
459
|
flex-grow: 0;
|
|
507
460
|
flex-shrink: 0;
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
width: 15px;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
.navbar-menu {
|
|
515
|
-
flex-grow: 1;
|
|
516
|
-
flex-shrink: 0;
|
|
461
|
+
svg {
|
|
462
|
+
width: 15px;
|
|
463
|
+
}
|
|
517
464
|
}
|
|
518
465
|
|
|
519
466
|
/* #endregion Navbar */
|
|
@@ -757,7 +704,7 @@ body {
|
|
|
757
704
|
flex-grow: 1;
|
|
758
705
|
margin: 0 auto;
|
|
759
706
|
position: relative;
|
|
760
|
-
max-width:
|
|
707
|
+
max-width: 1080px;
|
|
761
708
|
}
|
|
762
709
|
|
|
763
710
|
/* #region Footer */
|
|
@@ -846,6 +793,7 @@ body {
|
|
|
846
793
|
|
|
847
794
|
a.header-anchor {
|
|
848
795
|
color: var(--text);
|
|
796
|
+
|
|
849
797
|
&:hover::after {
|
|
850
798
|
margin-left: 0.2em;
|
|
851
799
|
color: var(--surface0);
|
|
@@ -873,6 +821,7 @@ body {
|
|
|
873
821
|
line-height: 1.25;
|
|
874
822
|
letter-spacing: -0.015em;
|
|
875
823
|
margin: 1.2rem 0 1rem;
|
|
824
|
+
|
|
876
825
|
> a.header-anchor {
|
|
877
826
|
&:hover::after {
|
|
878
827
|
content: "###";
|
|
@@ -886,6 +835,7 @@ body {
|
|
|
886
835
|
line-height: 1.25;
|
|
887
836
|
letter-spacing: -0.01em;
|
|
888
837
|
margin: 1.2rem 0 1rem;
|
|
838
|
+
|
|
889
839
|
> a.header-anchor {
|
|
890
840
|
&:hover::after {
|
|
891
841
|
content: "####";
|
|
@@ -899,6 +849,7 @@ body {
|
|
|
899
849
|
line-height: 1.25;
|
|
900
850
|
letter-spacing: -0.005em;
|
|
901
851
|
margin: 1.2rem 0 1rem;
|
|
852
|
+
|
|
902
853
|
> a.header-anchor {
|
|
903
854
|
&:hover::after {
|
|
904
855
|
content: "#####";
|
|
@@ -911,6 +862,7 @@ body {
|
|
|
911
862
|
font-weight: 600;
|
|
912
863
|
line-height: 1.25;
|
|
913
864
|
margin: 1.2rem 0 1rem;
|
|
865
|
+
|
|
914
866
|
> a.header-anchor {
|
|
915
867
|
&:hover::after {
|
|
916
868
|
content: "######";
|
|
@@ -939,13 +891,18 @@ body {
|
|
|
939
891
|
video {
|
|
940
892
|
display: block;
|
|
941
893
|
max-width: 100%;
|
|
942
|
-
margin:
|
|
894
|
+
margin: 0 auto;
|
|
943
895
|
|
|
944
896
|
&:hover {
|
|
945
897
|
cursor: pointer;
|
|
946
898
|
}
|
|
947
899
|
}
|
|
948
900
|
|
|
901
|
+
video,
|
|
902
|
+
.pic {
|
|
903
|
+
margin: 1em auto;
|
|
904
|
+
}
|
|
905
|
+
|
|
949
906
|
ol {
|
|
950
907
|
list-style-position: outside;
|
|
951
908
|
padding-left: 2em;
|
|
@@ -1111,6 +1068,7 @@ blockquote {
|
|
|
1111
1068
|
border-left: 2px solid var(--red);
|
|
1112
1069
|
border-radius: 0 8px 8px 0;
|
|
1113
1070
|
font-family: var(--font-serif);
|
|
1071
|
+
|
|
1114
1072
|
&:before {
|
|
1115
1073
|
content: "”";
|
|
1116
1074
|
color: var(--red);
|
|
@@ -1240,7 +1198,7 @@ section {
|
|
|
1240
1198
|
letter-spacing: -0.02em;
|
|
1241
1199
|
margin-bottom: 0.3em;
|
|
1242
1200
|
color: var(--text);
|
|
1243
|
-
|
|
1201
|
+
|
|
1244
1202
|
> a {
|
|
1245
1203
|
color: inherit;
|
|
1246
1204
|
}
|
|
@@ -1357,7 +1315,6 @@ section {
|
|
|
1357
1315
|
opacity: 1;
|
|
1358
1316
|
visibility: visible;
|
|
1359
1317
|
backdrop-filter: blur(5px);
|
|
1360
|
-
-webkit-backdrop-filter: blur(5px);
|
|
1361
1318
|
}
|
|
1362
1319
|
|
|
1363
1320
|
input.searchbox-input {
|
|
@@ -1401,10 +1358,19 @@ input.searchbox-input {
|
|
|
1401
1358
|
.searchbox-body {
|
|
1402
1359
|
flex-grow: 1;
|
|
1403
1360
|
width: 100%;
|
|
1404
|
-
overflow-y: auto;
|
|
1405
1361
|
border-top: 1px solid var(--base);
|
|
1406
1362
|
}
|
|
1407
1363
|
|
|
1364
|
+
.searchbox-result-section--posts {
|
|
1365
|
+
max-height: 450px;
|
|
1366
|
+
overflow-y: auto;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
.searchbox-result-section--tags {
|
|
1370
|
+
max-height: 250px;
|
|
1371
|
+
overflow-y: auto;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1408
1374
|
.searchbox-result-item,
|
|
1409
1375
|
.searchbox-result-section header {
|
|
1410
1376
|
padding: 0.75em 1em;
|
|
@@ -1447,7 +1413,7 @@ input.searchbox-input {
|
|
|
1447
1413
|
position: relative;
|
|
1448
1414
|
display: block;
|
|
1449
1415
|
overflow: hidden;
|
|
1450
|
-
border-radius:
|
|
1416
|
+
border-radius: var(--radius) var(--radius) 0 0;
|
|
1451
1417
|
height: 380px;
|
|
1452
1418
|
|
|
1453
1419
|
.cover-image-placeholder {
|
|
@@ -12,28 +12,28 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/* navbar */
|
|
15
|
-
.navbar-
|
|
16
|
-
.navbar-
|
|
17
|
-
.navbar-
|
|
15
|
+
.navbar-menu,
|
|
16
|
+
.navbar-start,
|
|
17
|
+
.navbar-end {
|
|
18
18
|
align-items: stretch;
|
|
19
19
|
display: flex;
|
|
20
20
|
padding: 0;
|
|
21
21
|
flex-shrink: 0;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.navbar-
|
|
24
|
+
.navbar-menu {
|
|
25
25
|
flex-grow: 1;
|
|
26
26
|
flex-shrink: 0;
|
|
27
27
|
overflow-x: auto;
|
|
28
28
|
background-color: transparent;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.navbar-
|
|
31
|
+
.navbar-start {
|
|
32
32
|
justify-content: flex-start;
|
|
33
33
|
margin-right: auto;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.navbar-
|
|
36
|
+
.navbar-end {
|
|
37
37
|
justify-content: flex-end;
|
|
38
38
|
margin-left: auto;
|
|
39
39
|
}
|
|
@@ -161,4 +161,4 @@
|
|
|
161
161
|
padding: 0;
|
|
162
162
|
margin: 0;
|
|
163
163
|
display: contents;
|
|
164
|
-
}
|
|
164
|
+
}
|
|
@@ -39,6 +39,25 @@ figure.shiki {
|
|
|
39
39
|
overflow: auto;
|
|
40
40
|
background: var(--mantle);
|
|
41
41
|
color: var(--text);
|
|
42
|
+
|
|
43
|
+
iconify-icon {
|
|
44
|
+
color: transparent;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
transition:
|
|
47
|
+
color 0.3s,
|
|
48
|
+
transform 0.3s ease;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
iconify-icon {
|
|
53
|
+
color: var(--text);
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
color: var(--blue);
|
|
57
|
+
transform: scale(1.2);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
42
61
|
}
|
|
43
62
|
|
|
44
63
|
.shiki-tools {
|
|
@@ -46,7 +65,7 @@ figure.shiki {
|
|
|
46
65
|
min-height: 1.5em;
|
|
47
66
|
justify-content: space-between;
|
|
48
67
|
font-family: var(--font-mono);
|
|
49
|
-
padding: 0
|
|
68
|
+
padding: 0.3em 1em;
|
|
50
69
|
user-select: none;
|
|
51
70
|
overflow: hidden;
|
|
52
71
|
position: relative;
|
|
@@ -66,18 +85,6 @@ figure.shiki {
|
|
|
66
85
|
min-width: 0;
|
|
67
86
|
}
|
|
68
87
|
|
|
69
|
-
iconify-icon {
|
|
70
|
-
cursor: pointer;
|
|
71
|
-
transition:
|
|
72
|
-
color 0.3s,
|
|
73
|
-
transform 0.3s ease;
|
|
74
|
-
|
|
75
|
-
&:hover {
|
|
76
|
-
transform: scale(1.1);
|
|
77
|
-
color: var(--blue);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
88
|
> .right {
|
|
82
89
|
gap: 10px;
|
|
83
90
|
display: flex;
|
|
@@ -85,15 +92,6 @@ figure.shiki {
|
|
|
85
92
|
}
|
|
86
93
|
}
|
|
87
94
|
|
|
88
|
-
.shiki-tools .expand {
|
|
89
|
-
font-size: 1.2em;
|
|
90
|
-
margin-left: -2px;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.shiki-tools .expand.closed {
|
|
94
|
-
transform: rotate(90deg);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
95
|
.shiki-tools > .right > .copy-notice {
|
|
98
96
|
position: absolute;
|
|
99
97
|
white-space: nowrap;
|
|
@@ -115,15 +113,14 @@ figure.shiki {
|
|
|
115
113
|
.traffic-lights {
|
|
116
114
|
display: flex;
|
|
117
115
|
align-items: center;
|
|
118
|
-
|
|
119
|
-
margin-left: -7px;
|
|
116
|
+
margin-left: -0.5em;
|
|
120
117
|
}
|
|
121
118
|
|
|
122
119
|
.traffic-light {
|
|
123
|
-
width:
|
|
124
|
-
height:
|
|
120
|
+
width: 0.8em;
|
|
121
|
+
height: 0.8em;
|
|
125
122
|
border-radius: 50%;
|
|
126
|
-
margin-left:
|
|
123
|
+
margin-left: 0.5em;
|
|
127
124
|
position: relative;
|
|
128
125
|
|
|
129
126
|
&.red {
|
|
@@ -186,22 +183,6 @@ pre.shiki {
|
|
|
186
183
|
width: 100%;
|
|
187
184
|
margin: 0;
|
|
188
185
|
font-family: var(--font-mono);
|
|
189
|
-
|
|
190
|
-
> span.line {
|
|
191
|
-
display: block;
|
|
192
|
-
width: fit-content;
|
|
193
|
-
min-width: 100%;
|
|
194
|
-
|
|
195
|
-
&:before {
|
|
196
|
-
content: counter(step);
|
|
197
|
-
counter-increment: step;
|
|
198
|
-
width: 1.2rem;
|
|
199
|
-
margin-right: 1.2rem;
|
|
200
|
-
display: inline-block;
|
|
201
|
-
text-align: right;
|
|
202
|
-
color: #738a9466;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
186
|
}
|
|
206
187
|
}
|
|
207
188
|
|
|
@@ -237,6 +218,22 @@ figure.shiki[data-collapsible="true"].expanded > .code-expand-btn {
|
|
|
237
218
|
transform: translateY(0);
|
|
238
219
|
}
|
|
239
220
|
|
|
221
|
+
span.line {
|
|
222
|
+
display: block;
|
|
223
|
+
width: fit-content;
|
|
224
|
+
min-width: 100%;
|
|
225
|
+
|
|
226
|
+
&:before {
|
|
227
|
+
content: counter(step);
|
|
228
|
+
counter-increment: step;
|
|
229
|
+
width: 1.2rem;
|
|
230
|
+
margin-right: 1.2rem;
|
|
231
|
+
display: inline-block;
|
|
232
|
+
text-align: right;
|
|
233
|
+
color: var(--subtext0);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
240
237
|
span.line.diff {
|
|
241
238
|
&.remove {
|
|
242
239
|
background-color: hsl(from var(--red) h s l / 0.2);
|
|
@@ -1657,4 +1654,3 @@ pre.shiki.has-focused > code {
|
|
|
1657
1654
|
--shiki-tokyo: #89ddff;
|
|
1658
1655
|
--shiki-tokyo-font-weight: bold;
|
|
1659
1656
|
}
|
|
1660
|
-
|
package/source/css/twikoo.css
CHANGED
|
@@ -126,6 +126,33 @@
|
|
|
126
126
|
flex-shrink: 1;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
.el-textarea__inner {
|
|
130
|
+
display: block;
|
|
131
|
+
resize: vertical;
|
|
132
|
+
padding: 5px 15px;
|
|
133
|
+
line-height: 1.5;
|
|
134
|
+
box-sizing: border-box;
|
|
135
|
+
width: 100%;
|
|
136
|
+
font-size: inherit;
|
|
137
|
+
color: #606266;
|
|
138
|
+
background-color: var(--base);
|
|
139
|
+
border: 1px solid #dcdfe6;
|
|
140
|
+
border-radius: 4px;
|
|
141
|
+
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
142
|
+
&::placeholder {
|
|
143
|
+
color: var(--subtext0);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&:hover {
|
|
147
|
+
border-color: var(--subtext0);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&:focus {
|
|
151
|
+
outline: 0;
|
|
152
|
+
border-color: var(--blue);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
129
156
|
.tk-input-image {
|
|
130
157
|
display: none;
|
|
131
158
|
}
|
|
@@ -187,6 +214,14 @@
|
|
|
187
214
|
align-items: center;
|
|
188
215
|
}
|
|
189
216
|
|
|
217
|
+
.tk-action-icon {
|
|
218
|
+
display: inline-block;
|
|
219
|
+
height: 1em;
|
|
220
|
+
width: 1em;
|
|
221
|
+
line-height: 0;
|
|
222
|
+
color: var(--blue);
|
|
223
|
+
}
|
|
224
|
+
|
|
190
225
|
.tk-action-link .tk-action-icon-solid {
|
|
191
226
|
display: none;
|
|
192
227
|
}
|
|
@@ -208,14 +243,6 @@
|
|
|
208
243
|
line-height: 1.5rem;
|
|
209
244
|
}
|
|
210
245
|
|
|
211
|
-
.tk-action-icon {
|
|
212
|
-
display: inline-block;
|
|
213
|
-
height: 1em;
|
|
214
|
-
width: 1em;
|
|
215
|
-
line-height: 0;
|
|
216
|
-
color: var(--blue);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
246
|
.tk-main {
|
|
220
247
|
flex: 1;
|
|
221
248
|
width: 0;
|
|
@@ -506,13 +533,11 @@
|
|
|
506
533
|
padding: 0;
|
|
507
534
|
height: 28px;
|
|
508
535
|
text-align: center;
|
|
509
|
-
-moz-appearance: textfield;
|
|
510
536
|
appearance: textfield;
|
|
511
537
|
}
|
|
512
538
|
|
|
513
539
|
.tk-pagination .el-input .el-input__inner::-webkit-inner-spin-button,
|
|
514
540
|
.tk-pagination .el-input .el-input__inner::-webkit-outer-spin-button {
|
|
515
|
-
-webkit-appearance: none;
|
|
516
541
|
appearance: none;
|
|
517
542
|
margin: 0;
|
|
518
543
|
}
|
|
@@ -594,17 +619,17 @@
|
|
|
594
619
|
padding-right: 0.5em;
|
|
595
620
|
}
|
|
596
621
|
|
|
597
|
-
.tk-admin-config-groups .tk-admin-config-group,
|
|
598
|
-
.tk-admin-config-groups .tk-admin-config-group-title {
|
|
599
|
-
background: transparent;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
622
|
.tk-admin-config-group-title {
|
|
603
623
|
margin-top: 1em;
|
|
604
624
|
font-size: 1.25rem;
|
|
605
625
|
font-weight: bold;
|
|
606
626
|
}
|
|
607
627
|
|
|
628
|
+
.tk-admin-config-groups .tk-admin-config-group,
|
|
629
|
+
.tk-admin-config-groups .tk-admin-config-group-title {
|
|
630
|
+
background: transparent;
|
|
631
|
+
}
|
|
632
|
+
|
|
608
633
|
.tk-admin-config-item {
|
|
609
634
|
display: grid;
|
|
610
635
|
align-items: center;
|
|
@@ -827,16 +852,13 @@
|
|
|
827
852
|
color: currentColor;
|
|
828
853
|
background-color: transparent;
|
|
829
854
|
border-color: hsl(from var(--surface1) h s l / 0.31);
|
|
830
|
-
}
|
|
831
855
|
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
.twikoo .el-textarea__inner:focus {
|
|
839
|
-
border-color: var(--blue);
|
|
856
|
+
&:hover {
|
|
857
|
+
border-color: hsl(from var(--surface1) h s l / 0.5);
|
|
858
|
+
}
|
|
859
|
+
&:focus {
|
|
860
|
+
border-color: var(--blue);
|
|
861
|
+
}
|
|
840
862
|
}
|
|
841
863
|
|
|
842
864
|
.twikoo .el-button:not(.el-button--primary):not(.el-button--text) {
|
|
@@ -889,16 +911,9 @@
|
|
|
889
911
|
*/
|
|
890
912
|
|
|
891
913
|
.OwO {
|
|
892
|
-
-webkit-user-select: none;
|
|
893
|
-
-moz-user-select: none;
|
|
894
|
-
-ms-user-select: none;
|
|
895
914
|
user-select: none;
|
|
896
915
|
}
|
|
897
916
|
|
|
898
|
-
.OwO.OwO-open .OwO-body {
|
|
899
|
-
display: block;
|
|
900
|
-
}
|
|
901
|
-
|
|
902
917
|
.OwO .OwO-logo {
|
|
903
918
|
width: 1.125em;
|
|
904
919
|
display: flex;
|
|
@@ -918,6 +933,10 @@
|
|
|
918
933
|
z-index: 1000;
|
|
919
934
|
}
|
|
920
935
|
|
|
936
|
+
.OwO.OwO-open .OwO-body {
|
|
937
|
+
display: block;
|
|
938
|
+
}
|
|
939
|
+
|
|
921
940
|
.night .OwO .OwO-body,
|
|
922
941
|
.darkmode .OwO .OwO-body,
|
|
923
942
|
.DarkMode .OwO .OwO-body,
|
|
@@ -928,9 +947,6 @@
|
|
|
928
947
|
}
|
|
929
948
|
|
|
930
949
|
.OwO .OwO-body .OwO-items {
|
|
931
|
-
-webkit-user-select: none;
|
|
932
|
-
-moz-user-select: none;
|
|
933
|
-
-ms-user-select: none;
|
|
934
950
|
user-select: none;
|
|
935
951
|
display: none;
|
|
936
952
|
padding: 10px;
|
|
@@ -948,7 +964,6 @@
|
|
|
948
964
|
font-size: 12px;
|
|
949
965
|
line-height: 14px;
|
|
950
966
|
cursor: pointer;
|
|
951
|
-
-webkit-transition: 0.3s;
|
|
952
967
|
transition: 0.3s;
|
|
953
968
|
text-align: center;
|
|
954
969
|
}
|
|
@@ -1035,7 +1050,6 @@
|
|
|
1035
1050
|
|
|
1036
1051
|
.OwO .OwO-body .OwO-bar .OwO-packages .OwO-package-active {
|
|
1037
1052
|
background-color: rgba(144, 147, 153, 0.13);
|
|
1038
|
-
-webkit-transition: 0.3s;
|
|
1039
1053
|
transition: 0.3s;
|
|
1040
1054
|
}
|
|
1041
1055
|
|
|
@@ -1045,20 +1059,16 @@
|
|
|
1045
1059
|
white-space: nowrap;
|
|
1046
1060
|
cursor: pointer;
|
|
1047
1061
|
background: var(--base);
|
|
1048
|
-
border: 1px solid
|
|
1049
|
-
color:
|
|
1050
|
-
|
|
1062
|
+
border: 1px solid var(--surface0);
|
|
1063
|
+
color: var(--subtext1);
|
|
1064
|
+
|
|
1051
1065
|
text-align: center;
|
|
1052
|
-
-webkit-box-sizing: border-box;
|
|
1053
1066
|
box-sizing: border-box;
|
|
1054
1067
|
outline: 0;
|
|
1055
1068
|
margin: 0;
|
|
1056
|
-
-webkit-transition: 0.1s;
|
|
1057
1069
|
transition: 0.1s;
|
|
1058
1070
|
font-weight: 500;
|
|
1059
|
-
|
|
1060
|
-
-webkit-user-select: none;
|
|
1061
|
-
-ms-user-select: none;
|
|
1071
|
+
user-select: none;
|
|
1062
1072
|
padding: 12px 20px;
|
|
1063
1073
|
font-size: 14px;
|
|
1064
1074
|
border-radius: 4px;
|
|
@@ -1624,8 +1634,6 @@
|
|
|
1624
1634
|
.el-input__inner,
|
|
1625
1635
|
.el-textarea__inner {
|
|
1626
1636
|
background-image: none;
|
|
1627
|
-
-webkit-box-sizing: border-box;
|
|
1628
|
-
-webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
1629
1637
|
}
|
|
1630
1638
|
|
|
1631
1639
|
.el-textarea {
|
|
@@ -1636,46 +1644,6 @@
|
|
|
1636
1644
|
font-size: 14px;
|
|
1637
1645
|
}
|
|
1638
1646
|
|
|
1639
|
-
.el-textarea__inner {
|
|
1640
|
-
display: block;
|
|
1641
|
-
resize: vertical;
|
|
1642
|
-
padding: 5px 15px;
|
|
1643
|
-
line-height: 1.5;
|
|
1644
|
-
box-sizing: border-box;
|
|
1645
|
-
width: 100%;
|
|
1646
|
-
font-size: inherit;
|
|
1647
|
-
color: #606266;
|
|
1648
|
-
background-color: var(--base);
|
|
1649
|
-
border: 1px solid #dcdfe6;
|
|
1650
|
-
border-radius: 4px;
|
|
1651
|
-
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
1652
|
-
}
|
|
1653
|
-
|
|
1654
|
-
.el-textarea__inner::-webkit-input-placeholder {
|
|
1655
|
-
color: var(--subtext0);
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
.el-textarea__inner:-ms-input-placeholder {
|
|
1659
|
-
color: var(--subtext0);
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1662
|
-
.el-textarea__inner::-ms-input-placeholder {
|
|
1663
|
-
color: var(--subtext0);
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
.el-textarea__inner::placeholder {
|
|
1667
|
-
color: var(--subtext0);
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
.el-textarea__inner:hover {
|
|
1671
|
-
border-color: var(--subtext0);
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
.el-textarea__inner:focus {
|
|
1675
|
-
outline: 0;
|
|
1676
|
-
border-color: var(--blue);
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
1647
|
.el-textarea .el-input__count {
|
|
1680
1648
|
color: #909399;
|
|
1681
1649
|
background: var(--base);
|
|
@@ -1755,7 +1723,6 @@
|
|
|
1755
1723
|
color: var(--subtext0);
|
|
1756
1724
|
font-size: 14px;
|
|
1757
1725
|
cursor: pointer;
|
|
1758
|
-
-webkit-transition: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
1759
1726
|
transition: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
1760
1727
|
}
|
|
1761
1728
|
|
|
@@ -1766,7 +1733,6 @@
|
|
|
1766
1733
|
.el-input .el-input__count {
|
|
1767
1734
|
height: 100%;
|
|
1768
1735
|
display: inline-flex;
|
|
1769
|
-
-webkit-box-align: center;
|
|
1770
1736
|
-ms-flex-align: center;
|
|
1771
1737
|
align-items: center;
|
|
1772
1738
|
color: #909399;
|
|
@@ -1789,7 +1755,6 @@
|
|
|
1789
1755
|
}
|
|
1790
1756
|
|
|
1791
1757
|
.el-input__inner {
|
|
1792
|
-
-webkit-appearance: none;
|
|
1793
1758
|
background-color: var(--base);
|
|
1794
1759
|
border-radius: 4px;
|
|
1795
1760
|
border: 1px solid #dcdfe6;
|
|
@@ -1818,18 +1783,6 @@
|
|
|
1818
1783
|
display: none;
|
|
1819
1784
|
}
|
|
1820
1785
|
|
|
1821
|
-
.el-input__inner::-webkit-input-placeholder {
|
|
1822
|
-
color: var(--subtext0);
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
.el-input__inner:-ms-input-placeholder {
|
|
1826
|
-
color: var(--subtext0);
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
.el-input__inner::-ms-input-placeholder {
|
|
1830
|
-
color: var(--subtext0);
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
1786
|
.el-input__inner::placeholder {
|
|
1834
1787
|
color: var(--subtext0);
|
|
1835
1788
|
}
|
|
@@ -1858,7 +1811,6 @@
|
|
|
1858
1811
|
height: 100%;
|
|
1859
1812
|
width: 25px;
|
|
1860
1813
|
text-align: center;
|
|
1861
|
-
-webkit-transition: all 0.3s;
|
|
1862
1814
|
transition: all 0.3s;
|
|
1863
1815
|
line-height: 40px;
|
|
1864
1816
|
}
|
|
@@ -1882,9 +1834,6 @@
|
|
|
1882
1834
|
cursor: not-allowed;
|
|
1883
1835
|
}
|
|
1884
1836
|
|
|
1885
|
-
.el-input.is-disabled .el-input__inner::-webkit-input-placeholder,
|
|
1886
|
-
.el-input.is-disabled .el-input__inner:-ms-input-placeholder,
|
|
1887
|
-
.el-input.is-disabled .el-input__inner::-ms-input-placeholder,
|
|
1888
1837
|
.el-input.is-disabled .el-input__inner::placeholder {
|
|
1889
1838
|
color: var(--subtext1);
|
|
1890
1839
|
}
|
|
@@ -2079,12 +2028,10 @@
|
|
|
2079
2028
|
.el-loading-spinner .circular {
|
|
2080
2029
|
height: 42px;
|
|
2081
2030
|
width: 42px;
|
|
2082
|
-
-webkit-animation: loading-rotate 2s linear infinite;
|
|
2083
2031
|
animation: loading-rotate 2s linear infinite;
|
|
2084
2032
|
}
|
|
2085
2033
|
|
|
2086
2034
|
.el-loading-spinner .path {
|
|
2087
|
-
-webkit-animation: loading-dash 1.5s ease-in-out infinite;
|
|
2088
2035
|
animation: loading-dash 1.5s ease-in-out infinite;
|
|
2089
2036
|
stroke-dasharray: 90, 150;
|
|
2090
2037
|
stroke-dashoffset: 0;
|
|
@@ -2104,7 +2051,6 @@
|
|
|
2104
2051
|
|
|
2105
2052
|
@keyframes loading-rotate {
|
|
2106
2053
|
100% {
|
|
2107
|
-
-webkit-transform: rotate(360deg);
|
|
2108
2054
|
transform: rotate(360deg);
|
|
2109
2055
|
}
|
|
2110
2056
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).SwupHeadPlugin=t()}(this,function(){function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}const t=e=>String(e).split(".").map(e=>String(parseInt(e||"0",10))).concat(["0","0"]).slice(0,3).join(".");class n{constructor(){this.isSwupPlugin=!0,this.swup=void 0,this.version=void 0,this.requires={},this.handlersToUnregister=[]}mount(){}unmount(){this.handlersToUnregister.forEach(e=>e()),this.handlersToUnregister=[]}_beforeMount(){if(!this.name)throw new Error("You must define a name of plugin when creating a class.")}_afterUnmount(){}_checkRequirements(){return"object"!=typeof this.requires||Object.entries(this.requires).forEach(([e,n])=>{if(!function(e,n,r){const s=function(e,t){var n;if("swup"===e)return null!=(n=t.version)?n:"";{var r;const n=t.findPlugin(e);return null!=(r=null==n?void 0:n.version)?r:""}}(e,r);return!!s&&((e,n)=>n.every(n=>{const[,r,s]=n.match(/^([\D]+)?(.*)$/)||[];var o,i;return((e,t)=>{const n={"":e=>0===e,">":e=>e>0,">=":e=>e>=0,"<":e=>e<0,"<=":e=>e<=0};return(n[t]||n[""])(e)})((i=s,o=t(o=e),i=t(i),o.localeCompare(i,void 0,{numeric:!0})),r||">=")}))(s,n)}(e,n=Array.isArray(n)?n:[n],this.swup)){const t=`${e} ${n.join(", ")}`;throw new Error(`Plugin version mismatch: ${this.name} requires ${t}`)}}),!0}on(e,t,n={}){var r;t=!(r=t).name.startsWith("bound ")||r.hasOwnProperty("prototype")?t.bind(this):t;const s=this.swup.hooks.on(e,t,n);return this.handlersToUnregister.push(s),s}once(t,n,r={}){return this.on(t,n,e({},r,{once:!0}))}before(t,n,r={}){return this.on(t,n,e({},r,{before:!0}))}replace(t,n,r={}){return this.on(t,n,e({},r,{replace:!0}))}off(e,t){return this.swup.hooks.off(e,t)}}function r(e){return"title"!==e.localName&&!e.matches("[data-swup-theme]")}function s(e,t){return e.outerHTML===t.outerHTML}function o(e,t){void 0===t&&(t=[]);const n=Array.from(e.attributes);return t.length?n.filter(e=>{let{name:n}=e;return t.some(e=>e instanceof RegExp?e.test(n):n===e)}):n}function i(e){return e.matches("link[rel=stylesheet][href]")}return class extends n{constructor(e){void 0===e&&(e={}),super();const t=this;this.name="SwupHeadPlugin",this.requires={swup:">=4.6"},this.defaults={persistTags:!1,persistAssets:!1,awaitAssets:!1,attributes:["lang","dir"],timeout:3e3},this.options=void 0,this.updateHead=function(e,n){try{const{awaitAssets:n,attributes:u,timeout:a}=t.options,l=e.to.document,{removed:c,added:h}=function(e,t,n){let{shouldPersist:o=()=>!1}=void 0===n?{}:n;const i=Array.from(e.children),u=Array.from(t.children),a=(l=i,u.reduce((e,t,n)=>(l.some(e=>s(t,e))||e.push({el:t,index:n}),e),[]));var l;const c=function(e,t){return e.reduce((e,n)=>(t.some(e=>s(n,e))||e.push({el:n}),e),[])}(i,u);c.reverse().filter(e=>{let{el:t}=e;return r(t)}).filter(e=>{let{el:t}=e;return!o(t)}).forEach(t=>{let{el:n}=t;return e.removeChild(n)});const h=a.filter(e=>{let{el:t}=e;return r(t)}).map(t=>{let n=t.el.cloneNode(!0);return e.insertBefore(n,e.children[(t.index||0)+1]||null),{...t,el:n}});return{removed:c.map(e=>{let{el:t}=e;return t}),added:h.map(e=>{let{el:t}=e;return t})}}(document.head,l.head,{shouldPersist:e=>t.isPersistentTag(e)});t.swup.log(`Removed ${c.length} / added ${h.length} tags in head`),u?.length&&function(e,t,n){void 0===n&&(n=[]);const r=new Set;for(const{name:s,value:i}of o(t,n))e.setAttribute(s,i),r.add(s);for(const{name:t}of o(e,n))r.has(t)||e.removeAttribute(t)}(document.documentElement,l.documentElement,u);const d=function(){if(n){const n=(void 0===(e=a)&&(e=0),h.filter(i).map(t=>function(e,t){let n;void 0===t&&(t=0);const r=t=>{e.sheet?t():n=setTimeout(()=>r(t),10)};return new Promise(s=>{r(()=>s(e)),t>0&&setTimeout(()=>{n&&clearTimeout(n),s(e)},t)})}(t,e))),r=function(){if(n.length)return t.swup.log(`Waiting for ${n.length} assets to load`),Promise.resolve(Promise.all(n)).then(function(){})}();if(r&&r.then)return r.then(function(){})}var e}();return Promise.resolve(d&&d.then?d.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},this.options={...this.defaults,...e},this.options.persistAssets&&!this.options.persistTags&&(this.options.persistTags="link[rel=stylesheet], script[src], style")}mount(){this.before("content:replace",this.updateHead)}isPersistentTag(e){const{persistTags:t}=this.options;return"function"==typeof t?t(e):"string"==typeof t&&t.length>0?e.matches(t):Boolean(t)}}});
|
|
2
|
+
//# sourceMappingURL=index.umd.js.map
|
package/source/js/insight.js
CHANGED
|
@@ -143,6 +143,7 @@ function loadInsight(config, translation) {
|
|
|
143
143
|
.join("");
|
|
144
144
|
|
|
145
145
|
const sectionEl = section(sectionTitle);
|
|
146
|
+
sectionEl.classList.add(`searchbox-result-section--${type.toLowerCase()}`);
|
|
146
147
|
sectionEl.insertAdjacentHTML("beforeend", itemsHTML);
|
|
147
148
|
return sectionEl;
|
|
148
149
|
}
|
|
@@ -210,11 +211,8 @@ function loadInsight(config, translation) {
|
|
|
210
211
|
results.push({ item, weight: w });
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
|
-
//
|
|
214
|
-
return results
|
|
215
|
-
.sort((a, b) => b.weight - a.weight)
|
|
216
|
-
.map((r) => r.item)
|
|
217
|
-
.slice(0, 5);
|
|
214
|
+
// 排序返回全部结果(由 CSS 控制显示高度和滚动)
|
|
215
|
+
return results.sort((a, b) => b.weight - a.weight).map((r) => r.item);
|
|
218
216
|
};
|
|
219
217
|
|
|
220
218
|
return {
|
|
@@ -242,15 +240,20 @@ function loadInsight(config, translation) {
|
|
|
242
240
|
|
|
243
241
|
function scrollTo(item) {
|
|
244
242
|
if (!item) return;
|
|
245
|
-
|
|
246
|
-
const
|
|
243
|
+
// 找到item所在的可滚动section
|
|
244
|
+
const section = item.closest(".searchbox-result-section");
|
|
245
|
+
if (!section) return;
|
|
246
|
+
|
|
247
|
+
const sectionHeight = section.clientHeight;
|
|
248
|
+
const itemTop = item.offsetTop - section.offsetTop;
|
|
247
249
|
const itemHeight = item.clientHeight;
|
|
248
|
-
const scrollTop =
|
|
249
|
-
|
|
250
|
-
|
|
250
|
+
const scrollTop = section.scrollTop;
|
|
251
|
+
|
|
252
|
+
if (itemTop + itemHeight > scrollTop + sectionHeight) {
|
|
253
|
+
section.scrollTop = itemTop + itemHeight - sectionHeight;
|
|
251
254
|
}
|
|
252
255
|
if (itemTop < scrollTop) {
|
|
253
|
-
|
|
256
|
+
section.scrollTop = itemTop;
|
|
254
257
|
}
|
|
255
258
|
}
|
|
256
259
|
|