hexo-theme-particlex 2.6.5 → 2.6.7

Sign up to get free protection for your applications and to get access to all the features.
package/layout/import.ejs CHANGED
@@ -7,6 +7,7 @@
7
7
  <% } %>
8
8
  <% if (theme.highlight.enable) { %>
9
9
  <script src="https://cdn.staticfile.org/highlight.js/11.7.0/highlight.min.js"></script>
10
+ <script src="https://cdn.staticfile.org/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
10
11
  <link
11
12
  rel="stylesheet"
12
13
  href="https://cdn.staticfile.org/highlight.js/11.7.0/styles/<%- theme.highlight.style %>.min.css"
package/layout/index.ejs CHANGED
@@ -14,7 +14,7 @@
14
14
  </span>
15
15
  </div>
16
16
  </div>
17
- <div id="home-posts-wrap" <%- theme.card.enable ? "" : 'class="home-posts-wrap-no-card"' %> ref="homePostsWrap">
17
+ <div id="home-posts-wrap" <%- theme.card.enable || 'class="home-posts-wrap-no-card"' %> ref="homePostsWrap">
18
18
  <div id="home-posts">
19
19
  <%- partial("posts") %>
20
20
  <%- partial("current") %>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-particlex",
3
- "version": "2.6.5",
3
+ "version": "2.6.7",
4
4
  "description": "A concise Hexo theme, based on Particle.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -396,15 +396,6 @@
396
396
  min-height: 50px;
397
397
  text-align: center;
398
398
  }
399
- #menu-curtain {
400
- background: #0003;
401
- height: 100%;
402
- left: 0;
403
- position: fixed;
404
- top: 0;
405
- width: 100%;
406
- z-index: 1001;
407
- }
408
399
  #menu #mobile-menu .items {
409
400
  padding: 10px 0 20px;
410
401
  z-index: 1002;
@@ -424,6 +415,15 @@
424
415
  cursor: pointer;
425
416
  z-index: 1003;
426
417
  }
418
+ #menu-curtain {
419
+ background: #0003;
420
+ height: 100%;
421
+ left: 0;
422
+ position: fixed;
423
+ top: 0;
424
+ width: 100%;
425
+ z-index: 1001;
426
+ }
427
427
  #menu.hidden {
428
428
  top: -50px;
429
429
  }
@@ -485,7 +485,6 @@
485
485
  margin-right: 10px;
486
486
  }
487
487
  .code-content {
488
- background: none;
489
488
  font-size: 13px;
490
489
  line-height: 2;
491
490
  overflow: auto;
@@ -535,6 +534,16 @@ body::-webkit-scrollbar-track {
535
534
  .fade-leave-to {
536
535
  opacity: 0;
537
536
  }
537
+ .hljs-ln-code {
538
+ padding-left: 20px !important;
539
+ }
540
+ .hljs-ln-numbers {
541
+ border-right: 1px solid #ccc;
542
+ color: #ccc;
543
+ padding-right: 10px !important;
544
+ text-align: right;
545
+ vertical-align: top;
546
+ }
538
547
  .icon {
539
548
  color: #5c6b72;
540
549
  margin-right: 5px;
@@ -664,6 +673,24 @@ a:hover,
664
673
  .content .copycode:hover {
665
674
  opacity: 0.8;
666
675
  }
676
+ audio,
677
+ button,
678
+ iframe,
679
+ img,
680
+ video,
681
+ #home-head,
682
+ #menu,
683
+ .categories-tags a,
684
+ .copycode,
685
+ .friend-link a,
686
+ .go-post,
687
+ .hljs-ln-numbers,
688
+ .icon-link a,
689
+ .katex,
690
+ .language,
691
+ .page-current {
692
+ user-select: none;
693
+ }
667
694
  b,
668
695
  strong {
669
696
  font-weight: bold;
@@ -684,23 +711,6 @@ body {
684
711
  overflow-x: hidden;
685
712
  width: 100%;
686
713
  }
687
- button,
688
- img,
689
- video,
690
- audio,
691
- iframe,
692
- #home-head,
693
- #menu,
694
- .katex,
695
- .go-post,
696
- .page-current,
697
- .categories-tags a,
698
- .friend-link a,
699
- .icon-link a,
700
- .language,
701
- .copycode {
702
- user-select: none;
703
- }
704
714
  code {
705
715
  background: #bddcf76b;
706
716
  border-radius: 4px;
@@ -763,33 +773,32 @@ pre {
763
773
  border-radius: 15px;
764
774
  box-shadow: 0 2px 12px 0 #0000001a;
765
775
  margin: 25px 0;
776
+ overflow: hidden;
766
777
  white-space: normal;
767
778
  }
768
779
  pre,
769
780
  code,
770
781
  .hljs,
771
- .highlight,
772
- .commit-tease-sha,
773
782
  .input,
774
783
  .language {
775
784
  font-family: "Fira Code", "Noto Sans SC", monospace;
776
785
  }
777
- table {
786
+ table:not(.hljs-ln) {
778
787
  margin: 15px 0;
779
788
  }
780
- table td:nth-child(even) {
789
+ table:not(.hljs-ln) td:nth-child(even) {
781
790
  background: #c7e0fb4d;
782
791
  }
783
- table td:nth-child(odd) {
792
+ table:not(.hljs-ln) td:nth-child(odd) {
784
793
  background: #d9e8ff4d;
785
794
  }
786
- table th {
795
+ table:not(.hljs-ln) th {
787
796
  background: #a3ddfb;
788
797
  }
789
- table tr th,
790
- table tr td {
791
- padding: 10px 20px;
798
+ table:not(.hljs-ln) tr th,
799
+ table:not(.hljs-ln) tr td {
792
800
  border-radius: 3px;
801
+ padding: 10px 20px;
793
802
  }
794
803
  ul li,
795
804
  ol li {
@@ -7,8 +7,8 @@ mixins.highlight = {
7
7
  this.renderers.push(this.highlight);
8
8
  },
9
9
  methods: {
10
- sleep(time) {
11
- return new Promise(resolve => setTimeout(resolve, time));
10
+ sleep(delay) {
11
+ return new Promise(resolve => setTimeout(resolve, delay));
12
12
  },
13
13
  highlight() {
14
14
  let codes = document.querySelectorAll("pre");
@@ -22,13 +22,15 @@ mixins.highlight = {
22
22
  highlighted = code;
23
23
  }
24
24
  i.innerHTML = `
25
- <div class="code-content">${highlighted}</div>
25
+ <div class="code-content hljs">${highlighted}</div>
26
26
  <div class="language">${language}</div>
27
27
  <div class="copycode">
28
28
  <i class="fa-solid fa-copy fa-fw"></i>
29
29
  <i class="fa-solid fa-clone fa-fw"></i>
30
30
  </div>
31
31
  `;
32
+ let content = i.querySelector(".code-content");
33
+ hljs.lineNumbersBlock(content, { singleLine: true });
32
34
  let copycode = i.querySelector(".copycode");
33
35
  copycode.addEventListener("click", async () => {
34
36
  if (this.copying) return;
package/source/js/main.js CHANGED
@@ -32,10 +32,9 @@ const app = Vue.createApp({
32
32
  this.showMenuItems = false;
33
33
  } else this.hiddenMenu = false;
34
34
  if (wrap) {
35
+ wrap.style.top = -Math.min(newScrollTop / 5, 80) + "px";
35
36
  if (newScrollTop <= window.innerHeight - 100) this.menuColor = true;
36
37
  else this.menuColor = false;
37
- if (newScrollTop <= 400) wrap.style.marginTop = -newScrollTop / 5 + "px";
38
- else wrap.style.marginTop = "-80px";
39
38
  }
40
39
  this.scrollTop = newScrollTop;
41
40
  },