hexo-theme-gnix 5.0.3 → 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/package.json +1 -1
- package/source/css/default.css +10 -2
- package/source/css/twikoo.css +54 -108
- package/source/js/insight.js +14 -11
package/package.json
CHANGED
package/source/css/default.css
CHANGED
|
@@ -1315,7 +1315,6 @@ section {
|
|
|
1315
1315
|
opacity: 1;
|
|
1316
1316
|
visibility: visible;
|
|
1317
1317
|
backdrop-filter: blur(5px);
|
|
1318
|
-
-webkit-backdrop-filter: blur(5px);
|
|
1319
1318
|
}
|
|
1320
1319
|
|
|
1321
1320
|
input.searchbox-input {
|
|
@@ -1359,10 +1358,19 @@ input.searchbox-input {
|
|
|
1359
1358
|
.searchbox-body {
|
|
1360
1359
|
flex-grow: 1;
|
|
1361
1360
|
width: 100%;
|
|
1362
|
-
overflow-y: auto;
|
|
1363
1361
|
border-top: 1px solid var(--base);
|
|
1364
1362
|
}
|
|
1365
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
|
+
|
|
1366
1374
|
.searchbox-result-item,
|
|
1367
1375
|
.searchbox-result-section header {
|
|
1368
1376
|
padding: 0.75em 1em;
|
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
|
}
|
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
|
|