hexo-theme-particlex 2.5.15 → 2.6.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/README.md CHANGED
@@ -121,8 +121,6 @@ menu:
121
121
 
122
122
  图标链接配置和导航栏配置相同
123
123
 
124
- **如果图标链接或友链为空,请在 `iconLinks:` 或 `friendLinks:` 后添加一个 `{}`**
125
-
126
124
  ```yaml
127
125
  # Side info card
128
126
  card:
@@ -131,7 +129,6 @@ card:
131
129
  Description
132
130
  ...
133
131
  iconLinks:
134
- {}
135
132
  friendLinks:
136
133
  Argvchs: https://argvchs.github.io
137
134
  ```
@@ -274,11 +271,7 @@ giscus:
274
271
 
275
272
  Gitalk 是一个基于 GitHub Issue 和 Preact 的评论系统
276
273
 
277
- 考虑到博客可能部署到多个网站同步评论,但 OAuth APP 只能有一个回调 URL,所以添加了 `sites` 参数用于多个网站的评论
278
-
279
- **同样如果没有其他网站,请在 `sites:` 后添加一个 `{}`**
280
-
281
- 由于 Gitalk 官方 CORS 代理用的是 Cloudflare,速度过慢,添加了 `proxy` 参数,搭建 CORS 代理可以看[这篇文章](https://argvchs.github.io/2022/07/04/build-cors-anywhere)
274
+ 由于 Gitalk 官方 CORS 代理用的是 Cloudflare,速度过慢,搭建 CORS 代理可以看[这篇文章](https://argvchs.github.io/2022/07/04/build-cors-anywhere)
282
275
 
283
276
  ```yaml
284
277
  # Gitalk
@@ -292,11 +285,6 @@ gitalk:
292
285
  admin: # GitHub repo owner and collaborators, only these guys can initialize github issues
293
286
  language: zh-CN # en, zh-CN, zh-TW, es-ES, fr, ru, de, pl and ko are currently available
294
287
  proxy: # CORS proxy
295
- sites: # Sites
296
- {}
297
- # www.example.com:
298
- # clientID:
299
- # clientSecret:
300
288
  ```
301
289
 
302
290
  ### 3.4.3. Waline
@@ -305,8 +293,6 @@ Waline 是一个简单、安全的评论系统
305
293
 
306
294
  详见:[在 ParticleX 上使用 Waline | Yuzi's Blog](https://blog.yuzi.dev/posts/bcb4ff00.html)
307
295
 
308
- **注意如果不需要 `locale` 参数,请在 `locale:` 后添加一个 `{}`**
309
-
310
296
  ```yaml
311
297
  # Waline
312
298
  # https://github.com/walinejs/waline
@@ -314,7 +300,6 @@ waline:
314
300
  enable: false
315
301
  serverURL: # Waline server address url, you should set this to your own link
316
302
  locale: # Locale: https://waline.js.org/guide/client/i18n.html#locale-option
317
- {}
318
303
  commentCount: true # If false, comment count will only be displayed in post page, not in home page
319
304
  pageview: false # Pageviews count, Note: You should not enable both `waline.pageview` and `leancloud_visitors`
320
305
  emoji: # Custom emoji
package/_config.yml CHANGED
@@ -44,7 +44,6 @@ card:
44
44
  Description
45
45
  ...
46
46
  iconLinks:
47
- {}
48
47
  friendLinks:
49
48
  Argvchs: https://argvchs.github.io
50
49
 
@@ -114,11 +113,6 @@ gitalk:
114
113
  admin: # GitHub repo owner and collaborators, only these guys can initialize github issues
115
114
  language: zh-CN # en, zh-CN, zh-TW, es-ES, fr, ru, de, pl and ko are currently available
116
115
  proxy: # CORS proxy
117
- sites: # Sites
118
- {}
119
- # www.example.com:
120
- # clientID:
121
- # clientSecret:
122
116
 
123
117
  # Waline
124
118
  # https://github.com/walinejs/waline
@@ -126,7 +120,6 @@ waline:
126
120
  enable: false
127
121
  serverURL: # Waline server address url, you should set this to your own link
128
122
  locale: # Locale: https://waline.js.org/guide/client/i18n.html#locale-option
129
- {}
130
123
  commentCount: true # If false, comment count will only be displayed in post page, not in home page
131
124
  pageview: false # Pageviews count, Note: You should not enable both `waline.pageview` and `leancloud_visitors`
132
125
  emoji: # Custom emoji
@@ -31,7 +31,7 @@
31
31
  <span class="icon">
32
32
  <i class="fa-solid fa-tags fa-fw"></i>
33
33
  </span>
34
- <% post.tags.data.forEach(data => { %>
34
+ <% post.tags.data.forEach(tag => { %>
35
35
  <span class="tag">
36
36
  <%
37
37
  const color = [
@@ -43,7 +43,7 @@
43
43
  ];
44
44
  let id = Math.floor(Math.random() * color.length);
45
45
  %>
46
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
46
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
47
47
  </span>
48
48
  <% }); %>
49
49
  </span>
package/layout/card.ejs CHANGED
@@ -7,24 +7,24 @@
7
7
  <div class="description">
8
8
  <%- markdown(theme.card.description) %>
9
9
  </div>
10
- <% if (Object.keys(theme.card.iconLinks).length) { %>
10
+ <% if (theme.card.iconLinks) { %>
11
11
  <div class="icon-links">
12
- <% Object.keys(theme.card.iconLinks).forEach(key => { %>
12
+ <% Object.entries(theme.card.iconLinks).forEach(([key, value]) => { %>
13
13
  <span class="icon-link">
14
- <a href="<%- url_for(theme.card.iconLinks[key].link) %>">
14
+ <a href="<%- url_for(value.link) %>">
15
15
  <i
16
- class="fa-<%- theme.card.iconLinks[key].theme %> fa-<%- theme.card.iconLinks[key].name %> fa-fw"
16
+ class="fa-<%- value.theme %> fa-<%- value.name %> fa-fw"
17
17
  ></i>
18
18
  </a>
19
19
  </span>
20
20
  <% }); %>
21
21
  </div>
22
22
  <% } %>
23
- <% if (Object.keys(theme.card.friendLinks).length) { %>
23
+ <% if (theme.card.friendLinks) { %>
24
24
  <div class="friend-links">
25
- <% Object.keys(theme.card.friendLinks).forEach(key => { %>
25
+ <% Object.entries(theme.card.friendLinks).forEach(([key, value]) => { %>
26
26
  <div class="friend-link">
27
- <a href="<%- url_for(theme.card.friendLinks[key]) %>"><%= key %></a>
27
+ <a href="<%- url_for(value) %>"><%= key %></a>
28
28
  </div>
29
29
  <% }); %>
30
30
  </div>
@@ -48,7 +48,7 @@
48
48
  <span class="icon">
49
49
  <i class="fa-solid fa-tags fa-fw"></i>
50
50
  </span>
51
- <% post.tags.data.forEach(data => { %>
51
+ <% post.tags.data.forEach(tag => { %>
52
52
  <span class="tag">
53
53
  <%
54
54
  const color = [
@@ -60,7 +60,7 @@
60
60
  ];
61
61
  let id = Math.floor(Math.random() * color.length);
62
62
  %>
63
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
63
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
64
64
  </span>
65
65
  <% }); %>
66
66
  </span>
@@ -18,30 +18,19 @@
18
18
  <% } %>
19
19
  <% if (theme.gitalk.enable) { %>
20
20
  <script>
21
- (() => {
22
- let clientID = "<%- theme.gitalk.clientID %>",
23
- clientSecret = "<%- theme.gitalk.clientSecret %>";
24
- <% Object.keys(theme.gitalk.sites).forEach(key => { %>
25
- if (window.location.host === "<%- key %>") {
26
- clientID = "<%- theme.gitalk.sites[key].clientID %>";
27
- clientSecret = "<%- theme.gitalk.sites[key].clientSecret %>";
28
- }
29
- <% }); %>
30
- const gitalk = new Gitalk({
31
- clientID: clientID,
32
- clientSecret: clientSecret,
33
- repo: "<%- theme.gitalk.repo %>",
34
- owner: "<%- theme.gitalk.owner %>",
35
- admin: ["<%- theme.gitalk.admin %>"],
36
- language: "<%- theme.gitalk.language %>",
37
- id: location.pathname,
38
- distractionFreeMode: false,
39
- <% if (theme.gitalk.proxy) { %>
40
- proxy: "<%- theme.gitalk.proxy %>",
41
- <% } %>
42
- })
43
- gitalk.render("gitalk-container");
44
- })();
21
+ const gitalk = new Gitalk({
22
+ clientID: "<%- theme.gitalk.clientID %>",
23
+ clientSecret: "<%- theme.gitalk.clientSecret %>",
24
+ repo: "<%- theme.gitalk.repo %>",
25
+ owner: "<%- theme.gitalk.owner %>",
26
+ admin: "<%- theme.gitalk.admin %>".split(","),
27
+ language: "<%- theme.gitalk.language %>",
28
+ id: location.pathname,
29
+ <% if (theme.gitalk.proxy) { %>
30
+ proxy: "<%- theme.gitalk.proxy %>",
31
+ <% } %>
32
+ })
33
+ gitalk.render("gitalk-container");
45
34
  </script>
46
35
  <% } %>
47
36
  <% if (theme.waline.enable) { %>
@@ -51,14 +40,16 @@
51
40
  serverURL: "<%- theme.waline.serverURL %>",
52
41
  commentCount: <%- theme.waline.commentCount %>,
53
42
  pageview: <%- theme.waline.pageview %>,
54
- emoji: <%- JSON.stringify(theme.waline.emoji) %>,
55
- meta: <%- JSON.stringify(theme.waline.meta) %>,
56
- requiredMeta: <%- JSON.stringify(theme.waline.requiredMeta) %>,
43
+ emoji: "<%- (theme.waline.emoji) %>".split(","),
44
+ meta: "<%- (theme.waline.meta) %>".split(","),
45
+ requiredMeta: "<%- theme.waline.requiredMeta %>".split(","),
57
46
  lang: "<%- theme.waline.lang %>",
58
47
  wordLimit: <%- theme.waline.wordLimit %>,
59
48
  pageSize: "<%- theme.waline.pageSize %>",
60
49
  login: "<%- theme.waline.login %>",
50
+ <% if (theme.waline.locale) { %>
61
51
  locale: <%- JSON.stringify(theme.waline.locale) %>,
52
+ <% } %>
62
53
  });
63
54
  </script>
64
55
  <% } %>
@@ -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(url_for) %>"></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,34 +1,36 @@
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>
6
- <% Object.keys(theme.menu).forEach(key => { %>
7
- <a href="<%- url_for(theme.menu[key].link) %>">
8
- <i class="fa-<%- theme.menu[key].theme %> fa-<%- theme.menu[key].name %> fa-fw"></i>
6
+ <% Object.entries(theme.menu).forEach(([key, value]) => { %>
7
+ <a href="<%- url_for(value.link) %>">
8
+ <i class="fa-<%- value.theme %> fa-<%- value.name %> fa-fw"></i>
9
9
  <span>&ensp;<%= key %></span>
10
10
  </a>
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.entries(theme.menu).forEach(([key, value]) => { %>
21
+ <a href="<%- url_for(value.link) %>">
22
+ <div class="item">
23
+ <div style="min-width: 20px; max-width: 50px; width: 10%">
24
+ <i class="fa-<%- value.theme %> fa-<%- value.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
@@ -24,7 +24,7 @@
24
24
  <span class="icon">
25
25
  <i class="fa-solid fa-tags fa-fw"></i>
26
26
  </span>
27
- <% page.tags.data.forEach(data => { %>
27
+ <% page.tags.data.forEach(tag => { %>
28
28
  <span class="tag">
29
29
  <%
30
30
  const color = [
@@ -36,7 +36,7 @@
36
36
  ];
37
37
  let id = Math.floor(Math.random() * color.length);
38
38
  %>
39
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
39
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
40
40
  </span>
41
41
  <% }); %>
42
42
  </span>
@@ -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/layout/posts.ejs CHANGED
@@ -58,7 +58,7 @@
58
58
  <i class="fa-solid fa-tags fa-fw"></i>
59
59
  </span>
60
60
  <% } %>
61
- <% post.tags.data.forEach(data => { %>
61
+ <% post.tags.data.forEach(tag => { %>
62
62
  <span class="tag">
63
63
  <%
64
64
  const color = [
@@ -70,7 +70,7 @@
70
70
  ];
71
71
  let id = Math.floor(Math.random() * color.length);
72
72
  %>
73
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
73
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
74
74
  </span>
75
75
  <% }); %>
76
76
  </div>
package/layout/tags.ejs CHANGED
@@ -33,7 +33,7 @@
33
33
  <h3><%= post.title %></h3>
34
34
  </a>
35
35
  <div class="info">
36
- <% if (post.categories && post.categories.data.length !== 0){ %>
36
+ <% if (post.categories && post.categories.data.length){ %>
37
37
  <span class="category">
38
38
  <a href="<%- url_for(post.categories.data[0].path) %>">
39
39
  <span class="icon">
@@ -48,7 +48,7 @@
48
48
  <span class="icon">
49
49
  <i class="fa-solid fa-tags fa-fw"></i>
50
50
  </span>
51
- <% post.tags.data.forEach(data => { %>
51
+ <% post.tags.data.forEach(tag => { %>
52
52
  <span class="tag">
53
53
  <%
54
54
  const color = [
@@ -60,7 +60,7 @@
60
60
  ];
61
61
  let id = Math.floor(Math.random() * color.length);
62
62
  %>
63
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
63
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
64
64
  </span>
65
65
  <% }); %>
66
66
  </span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-particlex",
3
- "version": "2.5.15",
3
+ "version": "2.6.1",
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;
@@ -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;