hexo-theme-particlex 2.5.14 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,12 +14,12 @@
14
14
  <span class="page-omit">...</span>
15
15
  <% } %>
16
16
  <% if (page.current - 2 >= 1) { %>
17
- <% if (page.current - 2 === 1) { %>
18
- <a class="page-num" href="<%- config.root %>">1</a>
19
- <% } %>
20
- <% if (page.current - 2 !== 1) { %>
21
- <a class="page-num" href="<%- url_for("page/" + (page.current - 2)) %>"><%= page.current - 2 %></a>
22
- <% } %>
17
+ <% if (page.current - 2 === 1) { %>
18
+ <a class="page-num" href="<%- config.root %>">1</a>
19
+ <% } %>
20
+ <% if (page.current - 2 !== 1) { %>
21
+ <a class="page-num" href="<%- url_for("page/" + (page.current - 2)) %>"><%= page.current - 2 %></a>
22
+ <% } %>
23
23
  <% } %>
24
24
  <a class="page-num" href="<%- url_for(page.prev_link) %>"><%= page.prev %></a>
25
25
  </span>
package/layout/index.ejs CHANGED
@@ -1,9 +1,5 @@
1
1
  <div id="home-head">
2
- <div
3
- id="home-background"
4
- ref="homeBackground"
5
- data-images="<%- theme.background.map(i => url_for(i)) %>"
6
- ></div>
2
+ <div id="home-background" ref="homeBackground" data-images="<%- theme.background.map(i => url_for(i)) %>"></div>
7
3
  <div id="home-info" @click="homeClick">
8
4
  <span class="loop"></span>
9
5
  <span class="loop"></span>
package/layout/layout.ejs CHANGED
@@ -27,26 +27,26 @@
27
27
  <body>
28
28
  <div id="layout">
29
29
  <transition name="fade">
30
- <div id="loading" v-show="loading">
31
- <div id="loading-circle">
32
- <h2>LOADING</h2>
33
- <p>加载过慢请开启缓存 浏览器默认开启</p>
34
- <img src="<%- url_for("/images/loading.gif") %>" />
30
+ <div id="loading" v-show="loading">
31
+ <div id="loading-circle">
32
+ <h2>LOADING</h2>
33
+ <p>加载过慢请开启缓存 浏览器默认开启</p>
34
+ <img src="<%- url_for("/images/loading.gif") %>" />
35
+ </div>
35
36
  </div>
36
- </div>
37
37
  </transition>
38
38
  <%- partial("menu") %>
39
39
  <transition name="into">
40
- <div id="main" v-show="!loading">
41
- <%- partial(type) %>
42
- <%- partial("footer") %>
43
- </div>
40
+ <div id="main" v-show="!loading">
41
+ <%- partial(type) %>
42
+ <%- partial("footer") %>
43
+ </div>
44
44
  </transition>
45
45
  <% if (theme.preview.enable) { %>
46
46
  <transition name="fade">
47
- <div id="preview" ref="preview" v-show="previewShow">
48
- <img id="preview-content" ref="previewContent" />
49
- </div>
47
+ <div id="preview" ref="preview" v-show="previewShow">
48
+ <img id="preview-content" ref="previewContent" />
49
+ </div>
50
50
  </transition>
51
51
  <% } %>
52
52
  </div>
package/layout/menu.ejs CHANGED
@@ -1,5 +1,5 @@
1
1
  <nav id="menu" :class="{ hidden: hiddenMenu, 'menu-color': menuColor}">
2
- <div class="desktop-menu">
2
+ <div id="desktop-menu">
3
3
  <a class="title" href="<%- config.root %>">
4
4
  <span><%= config.title.toUpperCase() %></span>
5
5
  </a>
@@ -11,24 +11,26 @@
11
11
  <% }); %>
12
12
  </div>
13
13
  <div id="mobile-menu">
14
- <div class="curtain" @click="shouMenuItems = !shouMenuItems" v-show="shouMenuItems"></div>
15
- <div class="title" @click="shouMenuItems = !shouMenuItems">
14
+ <div class="title" @click="showMenuItems = !showMenuItems">
16
15
  <i class="fa-solid fa-bars fa-fw"></i>
17
16
  <span>&emsp;<%= config.title.toUpperCase() %></span>
18
17
  </div>
19
18
  <transition name="slide">
20
- <div class="items" v-show="shouMenuItems">
21
- <% Object.keys(theme.menu).forEach(key => { %>
22
- <a href="<%- url_for(theme.menu[key].link) %>">
23
- <div class="item">
24
- <div style="min-width: 20px; max-width: 50px; width: 10%">
25
- <i class="fa-<%- theme.menu[key].theme %> fa-<%- theme.menu[key].name %> fa-fw"></i>
19
+ <div class="items" v-show="showMenuItems">
20
+ <% Object.keys(theme.menu).forEach(key => { %>
21
+ <a href="<%- url_for(theme.menu[key].link) %>">
22
+ <div class="item">
23
+ <div style="min-width: 20px; max-width: 50px; width: 10%">
24
+ <i class="fa-<%- theme.menu[key].theme %> fa-<%- theme.menu[key].name %> fa-fw"></i>
25
+ </div>
26
+ <div style="min-width: 100px; max-width: 150%; width: 20%"><%= key %></div>
26
27
  </div>
27
- <div style="min-width: 100px; max-width: 150%; width: 20%"><%= key %></div>
28
- </div>
29
- </a>
30
- <% }); %>
31
- </div>
28
+ </a>
29
+ <% }); %>
30
+ </div>
32
31
  </transition>
33
32
  </div>
34
33
  </nav>
34
+ <transition name="fade">
35
+ <div id="menu-curtain" @click="showMenuItems = !showMenuItems" v-show="showMenuItems"></div>
36
+ </transition>
package/layout/post.ejs CHANGED
@@ -47,7 +47,7 @@
47
47
  <input
48
48
  id="crypto"
49
49
  :class="['input', cryptoClass]"
50
- :disabled="check"
50
+ :disabled="cryptoStatus"
51
51
  ref="crypto"
52
52
  placeholder="文章被加密,请输入密码"
53
53
  data-encrypted="<%- CryptoJS.AES.encrypt(page.content, page.secret).toString() %>"
@@ -55,7 +55,7 @@
55
55
  v-model="crypto"
56
56
  />
57
57
  <transition name="fade">
58
- <div class="content" ref="content" v-html="decrypted" v-show="check"></div>
58
+ <div class="content" ref="content" v-show="cryptoStatus"></div>
59
59
  </transition>
60
60
  <% } else { %>
61
61
  <div class="content" v-pre>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-particlex",
3
- "version": "2.5.14",
3
+ "version": "2.6.0",
4
4
  "description": "A concise Hexo theme, based on Particle.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -271,7 +271,7 @@
271
271
  }
272
272
  #home-posts .post .category-and-date .date,
273
273
  #archives .tags,
274
- #menu .desktop-menu a span {
274
+ #menu #desktop-menu a span {
275
275
  display: inline-block;
276
276
  }
277
277
  #home-posts .post .category-and-date .special {
@@ -376,18 +376,18 @@
376
376
  top: 0;
377
377
  transition: background 0.25s ease-out, top 0.25s ease-out;
378
378
  width: 100vw;
379
- z-index: 10004;
379
+ z-index: 1004;
380
380
  }
381
- #menu .desktop-menu {
381
+ #menu #desktop-menu {
382
382
  height: 50px;
383
383
  }
384
- #menu .desktop-menu .title {
384
+ #menu #desktop-menu .title {
385
385
  color: #555;
386
386
  display: inline-block;
387
387
  margin-left: 60px;
388
388
  margin-right: 5px;
389
389
  }
390
- #menu .desktop-menu a {
390
+ #menu #desktop-menu a {
391
391
  color: #555;
392
392
  display: inline-block;
393
393
  margin-left: 30px;
@@ -396,17 +396,18 @@
396
396
  min-height: 50px;
397
397
  text-align: center;
398
398
  }
399
- #menu #mobile-menu .curtain {
399
+ #menu-curtain {
400
+ background: #0003;
400
401
  height: 100%;
401
402
  left: 0;
402
403
  position: fixed;
403
404
  top: 0;
404
405
  width: 100%;
405
- z-index: -1;
406
+ z-index: 1001;
406
407
  }
407
408
  #menu #mobile-menu .items {
408
409
  padding: 10px 0 20px;
409
- z-index: 10002;
410
+ z-index: 1002;
410
411
  }
411
412
  #menu #mobile-menu .items .item {
412
413
  display: flex;
@@ -421,10 +422,10 @@
421
422
  #menu #mobile-menu .title {
422
423
  color: #555;
423
424
  cursor: pointer;
424
- z-index: 10003;
425
+ z-index: 1003;
425
426
  }
426
427
  #menu.hidden {
427
- top: -70px !important;
428
+ top: -50px !important;
428
429
  }
429
430
  #menu.menu-color {
430
431
  background: #0003 !important;
@@ -444,7 +445,7 @@
444
445
  position: fixed;
445
446
  top: 0;
446
447
  width: 100vw;
447
- z-index: 10005;
448
+ z-index: 1005;
448
449
  }
449
450
  #preview-content {
450
451
  box-shadow: 0 0 50px 10px #d9d9d980;
@@ -454,7 +455,7 @@
454
455
  }
455
456
  #search-bar {
456
457
  margin-bottom: 50px;
457
- z-index: 10001;
458
+ z-index: 1000;
458
459
  }
459
460
  #timeline-wrap {
460
461
  display: flex;
@@ -633,7 +634,7 @@ body::-webkit-scrollbar-track {
633
634
  width: 12px;
634
635
  }
635
636
  ::-webkit-scrollbar-thumb {
636
- background-image: #8ab5ff
637
+ background: #8ab5ff
637
638
  linear-gradient(
638
639
  45deg,
639
640
  #fff6 25%,
@@ -872,7 +873,7 @@ ol li {
872
873
  #home-posts-wrap {
873
874
  max-width: 1200px;
874
875
  }
875
- #menu .desktop-menu {
876
+ #menu #desktop-menu {
876
877
  display: block;
877
878
  }
878
879
  #menu #mobile-menu {
@@ -958,7 +959,7 @@ ol li {
958
959
  #footer #footer-wrap {
959
960
  width: 100%;
960
961
  }
961
- #menu .desktop-menu,
962
+ #menu #desktop-menu,
962
963
  #home-card {
963
964
  display: none;
964
965
  }
@@ -1,29 +1,29 @@
1
1
  mixins.crypto = {
2
2
  data() {
3
- return { crypto: "", check: null };
3
+ return { crypto: "", cryptoStatus: null };
4
4
  },
5
5
  watch: {
6
6
  crypto(value) {
7
7
  let input = this.$refs.crypto,
8
- content = this.$refs.content;
9
- let { encrypted, shasum } = input.dataset;
8
+ content = this.$refs.content,
9
+ { encrypted, shasum } = input.dataset;
10
10
  try {
11
11
  let decrypted = CryptoJS.AES.decrypt(encrypted, value).toString(CryptoJS.enc.Utf8);
12
12
  if (CryptoJS.SHA256(decrypted).toString() === shasum) {
13
- this.check = true;
13
+ this.cryptoStatus = true;
14
14
  content.innerHTML = decrypted;
15
15
  this.render();
16
- } else this.check = false;
16
+ } else this.cryptoStatus = false;
17
17
  } catch {
18
- this.check = false;
18
+ this.cryptoStatus = false;
19
19
  }
20
20
  },
21
21
  },
22
22
  computed: {
23
23
  cryptoClass() {
24
- if (this.check === null) return "";
25
- if (this.check === true) return "success";
26
- if (this.check === false) return "fail";
24
+ if (this.cryptoStatus === null) return "";
25
+ if (this.cryptoStatus === true) return "success";
26
+ if (this.cryptoStatus === false) return "fail";
27
27
  },
28
28
  },
29
29
  };
@@ -10,9 +10,14 @@ mixins.highlight = {
10
10
  highlight() {
11
11
  let codes = document.querySelectorAll("pre");
12
12
  for (let i of codes) {
13
- let code = i.innerText;
14
- let language = [...i.classList, ...i.firstChild.classList][0] || "plaintext";
15
- let highlighted = hljs.highlight(code, { language }).value;
13
+ let code = i.innerText,
14
+ language = [...i.classList, ...i.firstChild.classList][0] || "plaintext",
15
+ highlighted;
16
+ try {
17
+ highlighted = hljs.highlight(code, { language }).value;
18
+ } catch {
19
+ highlighted = code;
20
+ }
16
21
  i.innerHTML = `
17
22
  <div class="code-content">${highlighted}</div>
18
23
  <div class="language">${language}</div>
@@ -1,8 +1,8 @@
1
1
  mixins.home = {
2
2
  mounted() {
3
- let background = this.$refs.homeBackground;
4
- let images = background.dataset.images.split(",");
5
- let id = Math.floor(Math.random() * images.length);
3
+ let background = this.$refs.homeBackground,
4
+ images = background.dataset.images.split(","),
5
+ id = Math.floor(Math.random() * images.length);
6
6
  background.style.backgroundImage = `url('${images[id]}')`;
7
7
  this.menuColor = true;
8
8
  },
@@ -8,8 +8,8 @@ mixins.preview = {
8
8
  methods: {
9
9
  preview() {
10
10
  let preview = this.$refs.preview,
11
- content = this.$refs.previewContent;
12
- let images = document.querySelectorAll("img");
11
+ content = this.$refs.previewContent,
12
+ images = document.querySelectorAll("img");
13
13
  for (let i of images)
14
14
  i.addEventListener("click", () => {
15
15
  content.alt = i.alt;
package/source/js/main.js CHANGED
@@ -25,8 +25,8 @@ const app = Vue.createApp({
25
25
  for (let i of this.renderers) i();
26
26
  },
27
27
  handleScroll() {
28
- let wrap = this.$refs.homePostsWrap;
29
- let newScrollTop = document.documentElement.scrollTop;
28
+ let wrap = this.$refs.homePostsWrap,
29
+ newScrollTop = document.documentElement.scrollTop;
30
30
  if (this.scrollTop < newScrollTop) {
31
31
  this.hiddenMenu = true;
32
32
  this.showMenuItems = false;