@mlikiowa/nanaeo 1.0.1702966759079 → 1.0.1702967739786

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/2022/08/04/NewBlog/index.html +3473 -0
  2. package/2022/08/13/GaussWave/index.html +3407 -0
  3. package/about/index.html +3236 -0
  4. package/archives/2022/08/index.html +3411 -0
  5. package/archives/2022/index.html +3411 -0
  6. package/archives/index.html +3308 -0
  7. package/asset/Sotheby.ttf +0 -0
  8. package/asset/backimg.png +0 -0
  9. package/atom.xml +171 -0
  10. package/categories/DevLog/index.html +3351 -0
  11. package/categories/SiteLog/index.html +3351 -0
  12. package/categories/index.html +3174 -0
  13. package/category/devlog/atom.xml +58 -0
  14. package/category/devlog/feed.json +19 -0
  15. package/category/devlog/rss.xml +62 -0
  16. package/category/sitelog/atom.xml +125 -0
  17. package/category/sitelog/feed.json +20 -0
  18. package/category/sitelog/rss.xml +129 -0
  19. package/content.json +1 -0
  20. package/css/Readme.html +9 -0
  21. package/css/first.css +1504 -0
  22. package/css/style.css +7106 -0
  23. package/favicon.ico +0 -0
  24. package/feed.json +31 -0
  25. package/friends/index.html +3661 -0
  26. package/index.html +3421 -0
  27. package/js/app.js +1223 -0
  28. package/js/plugins/aplayer.js +186 -0
  29. package/js/plugins/parallax.js +191 -0
  30. package/js/plugins/rightMenu.js +577 -0
  31. package/js/plugins/rightMenus.js +618 -0
  32. package/js/plugins/tags/contributors.js +92 -0
  33. package/js/plugins/tags/friends.js +93 -0
  34. package/js/plugins/tags/sites.js +96 -0
  35. package/js/search/hexo.js +192 -0
  36. package/package.json +1 -1
  37. package/rss.xml +175 -0
  38. package/tag/devlog/atom.xml +58 -0
  39. package/tag/devlog/feed.json +19 -0
  40. package/tag/devlog/rss.xml +62 -0
  41. package/tag/gauss/atom.xml +58 -0
  42. package/tag/gauss/feed.json +19 -0
  43. package/tag/gauss/rss.xml +62 -0
  44. package/tag/hexo/atom.xml +125 -0
  45. package/tag/hexo/feed.json +20 -0
  46. package/tag/hexo/rss.xml +129 -0
  47. package/tag/hexothemes/atom.xml +125 -0
  48. package/tag/hexothemes/feed.json +20 -0
  49. package/tag/hexothemes/rss.xml +129 -0
  50. package/tag/sitelog/atom.xml +125 -0
  51. package/tag/sitelog/feed.json +20 -0
  52. package/tag/sitelog/rss.xml +129 -0
  53. package/tags/DevLog/index.html +3351 -0
  54. package/tags/Gauss/index.html +3351 -0
  55. package/tags/Hexo/index.html +3351 -0
  56. package/tags/HexoThemes/index.html +3351 -0
  57. package/tags/SiteLog/index.html +3351 -0
  58. package/tags/index.html +3159 -0
  59. package/volantis-sw.js +797 -0
@@ -0,0 +1,92 @@
1
+ const ContributorsJS = {
2
+ requestAPI: (url, callback, timeout) => {
3
+ let retryTimes = 5;
4
+
5
+ function request() {
6
+ return new Promise((resolve, reject) => {
7
+ let status = 0; // 0 等待 1 完成 2 超时
8
+ let timer = setTimeout(() => {
9
+ if (status === 0) {
10
+ status = 2;
11
+ timer = null;
12
+ reject('请求超时');
13
+ if (retryTimes == 0) {
14
+ timeout();
15
+ }
16
+ }
17
+ }, 5000);
18
+ fetch(url).then(function (response) {
19
+ if (status !== 2) {
20
+ clearTimeout(timer);
21
+ resolve(response);
22
+ timer = null;
23
+ status = 1;
24
+ }
25
+ if (response.ok) {
26
+ return response.json();
27
+ }
28
+ throw new Error('Network response was not ok.');
29
+ }).then(function (data) {
30
+ retryTimes = 0;
31
+ callback(data);
32
+ }).catch(function (error) {
33
+ if (retryTimes > 0) {
34
+ retryTimes -= 1;
35
+ setTimeout(() => {
36
+ request();
37
+ }, 5000);
38
+ } else {
39
+ timeout();
40
+ }
41
+ });
42
+ });
43
+ }
44
+ request();
45
+ },
46
+ layout: (cfg) => {
47
+ const el = cfg.el;
48
+ ContributorsJS.requestAPI(cfg.api, function (data) {
49
+ el.querySelector('.loading-wrap').remove();
50
+ var cellALL = "";
51
+ (data || []).forEach((item, i) => {
52
+ var user = '<div class="user-card">';
53
+ user += '<a class="card-link" target="_blank" rel="external noopener noreferrer"';
54
+ user += ' href="' + item.html_url + '">';
55
+ user += '<img alt="' + item.login + '" src="' + (item.avatar_url || cfg.avatar) + '" onerror="errorImgAvatar(this)">';
56
+ user += '<div class="name"><span>' + item.login + '</span></div>';
57
+ user += '</a>';
58
+ user += '</div>';
59
+ cellALL += user;
60
+ });
61
+ el.querySelector('.group-body').innerHTML = cellALL;
62
+ }, function () {
63
+ try {
64
+ el.querySelector('.loading-wrap svg').remove();
65
+ el.querySelector('.loading-wrap p').innerText('加载失败,请稍后重试。');
66
+ } catch (e) { }
67
+ });
68
+ },
69
+ start: () => {
70
+ const els = document.getElementsByClassName('contributorsjs-wrap');
71
+ for (var i = 0; i < els.length; i++) {
72
+ const el = els[i];
73
+ const api = el.getAttribute('api');
74
+ if (api == null) {
75
+ continue;
76
+ }
77
+ var cfg = new Object();
78
+ cfg.el = el;
79
+ cfg.api = api;
80
+ cfg.class = el.getAttribute('class');
81
+ cfg.avatar = volantis.GLOBAL_CONFIG.default.avatar;
82
+ ContributorsJS.layout(cfg);
83
+ }
84
+ }
85
+ }
86
+
87
+
88
+
89
+ ContributorsJS.start();
90
+ document.addEventListener('pjax:complete', function () {
91
+ ContributorsJS.start();
92
+ });
@@ -0,0 +1,93 @@
1
+ const FriendsJS = {
2
+ requestAPI: (url, callback, timeout) => {
3
+ let retryTimes = 5;
4
+
5
+ function request() {
6
+ return new Promise((resolve, reject) => {
7
+ let status = 0; // 0 等待 1 完成 2 超时
8
+ let timer = setTimeout(() => {
9
+ if (status === 0) {
10
+ status = 2;
11
+ timer = null;
12
+ reject('请求超时');
13
+ if (retryTimes == 0) {
14
+ timeout();
15
+ }
16
+ }
17
+ }, 5000);
18
+ fetch(url).then(function (response) {
19
+ if (status !== 2) {
20
+ clearTimeout(timer);
21
+ resolve(response);
22
+ timer = null;
23
+ status = 1;
24
+ }
25
+ if (response.ok) {
26
+ return response.json();
27
+ }
28
+ throw new Error('Network response was not ok.');
29
+ }).then(function (data) {
30
+ retryTimes = 0;
31
+ callback(data);
32
+ }).catch(function (error) {
33
+ if (retryTimes > 0) {
34
+ retryTimes -= 1;
35
+ setTimeout(() => {
36
+ request();
37
+ }, 5000);
38
+ } else {
39
+ timeout();
40
+ }
41
+ });
42
+ });
43
+ }
44
+ request();
45
+ },
46
+ layout: (cfg) => {
47
+ const el = cfg.el;
48
+ FriendsJS.requestAPI(cfg.api, function (data) {
49
+ el.querySelector('.loading-wrap').remove();
50
+ const arr = data.content;
51
+ var cellALL = "";
52
+ arr.forEach((item, i) => {
53
+ var user = '<div class="user-card">';
54
+ user += '<a class="card-link" target="_blank" rel="external noopener noreferrer"';
55
+ user += ' href="' + item.url + '">';
56
+ user += '<img alt="' + item.title + '" src="' + (item.avatar || cfg.avatar) + '" onerror="errorImgAvatar(this)">';
57
+ user += '<div class="name"><span>' + item.title + '</span></div>';
58
+ user += '</a>';
59
+ user += '</div>';
60
+ cellALL += user;
61
+ });
62
+ el.querySelector('.group-body').innerHTML = cellALL;
63
+ }, function () {
64
+ try {
65
+ el.querySelector('.loading-wrap svg').remove();
66
+ el.querySelector('.loading-wrap p').innerText('加载失败,请稍后重试。');
67
+ } catch (e) { }
68
+ });
69
+ },
70
+ start: () => {
71
+ const els = document.getElementsByClassName('friendsjs-wrap');
72
+ for (var i = 0; i < els.length; i++) {
73
+ const el = els[i];
74
+ const api = el.getAttribute('api');
75
+ if (api == null) {
76
+ continue;
77
+ }
78
+ var cfg = new Object();
79
+ cfg.el = el;
80
+ cfg.api = api;
81
+ cfg.class = el.getAttribute('class');
82
+ cfg.avatar = volantis.GLOBAL_CONFIG.default.avatar;
83
+ FriendsJS.layout(cfg);
84
+ }
85
+ }
86
+ }
87
+
88
+
89
+
90
+ FriendsJS.start();
91
+ document.addEventListener('pjax:complete', function () {
92
+ FriendsJS.start();
93
+ });
@@ -0,0 +1,96 @@
1
+ const SitesJS = {
2
+ requestAPI: (url, callback, timeout) => {
3
+ let retryTimes = 5;
4
+
5
+ function request() {
6
+ return new Promise((resolve, reject) => {
7
+ let status = 0; // 0 等待 1 完成 2 超时
8
+ let timer = setTimeout(() => {
9
+ if (status === 0) {
10
+ status = 2;
11
+ timer = null;
12
+ reject('请求超时');
13
+ if (retryTimes == 0) {
14
+ timeout();
15
+ }
16
+ }
17
+ }, 5000);
18
+ fetch(url).then(function (response) {
19
+ if (status !== 2) {
20
+ clearTimeout(timer);
21
+ resolve(response);
22
+ timer = null;
23
+ status = 1;
24
+ }
25
+ if (response.ok) {
26
+ return response.json();
27
+ }
28
+ throw new Error('Network response was not ok.');
29
+ }).then(function (data) {
30
+ retryTimes = 0;
31
+ callback(data);
32
+ }).catch(function (error) {
33
+ if (retryTimes > 0) {
34
+ retryTimes -= 1;
35
+ setTimeout(() => {
36
+ request();
37
+ }, 5000);
38
+ } else {
39
+ timeout();
40
+ }
41
+ });
42
+ });
43
+ }
44
+ request();
45
+ },
46
+ layout: (cfg) => {
47
+ const el = cfg.el;
48
+ SitesJS.requestAPI(cfg.api, function (data) {
49
+ el.querySelector('.loading-wrap').remove();
50
+ const arr = data.content;
51
+ var cellALL = "";
52
+ arr.forEach((item, i) => {
53
+ var cell = '<div class="site-card">';
54
+ cell += '<a class="card-link" target="_blank" rel="external noopener noreferrer" href="' + item.url + '">';
55
+ cell += '<img alt="' + item.title + '" src="' + (item.screenshot || ('https://image.thum.io/get/width/1024/crop/768/' + item.url)) + '" onerror="errorImgCover(this)"/>';
56
+ cell += '<div class="info">';
57
+ cell += '<img alt="' + item.title + '" src="' + (item.avatar || cfg.avatar) + '" onerror="errorImgAvatar(this)"/>';
58
+ cell += '<span class="title">' + item.title + '</span>';
59
+ cell += '<span class="desc">' + (item.description || item.url) + '</span>';
60
+ cell += '</div>';
61
+ cell += '</a>';
62
+ cell += '</div>';
63
+ cellALL += cell;
64
+ });
65
+ el.querySelector('.group-body').innerHTML = cellALL;
66
+ }, function () {
67
+ try {
68
+ el.querySelector('.loading-wrap svg').remove();
69
+ el.querySelector('.loading-wrap p').innerText('加载失败,请稍后重试。');
70
+ } catch (e) { }
71
+ });
72
+ },
73
+ start: (cfg) => {
74
+ const els = document.getElementsByClassName('sitesjs-wrap');
75
+ for (var i = 0; i < els.length; i++) {
76
+ const el = els[i];
77
+ const api = el.getAttribute('api');
78
+ if (api == null) {
79
+ continue;
80
+ }
81
+ var cfg = new Object();
82
+ cfg.class = el.getAttribute('class');
83
+ cfg.el = el;
84
+ cfg.api = api;
85
+ cfg.avatar = volantis.GLOBAL_CONFIG.default.link;
86
+ cfg.screenshot = volantis.GLOBAL_CONFIG.default.cover;
87
+ SitesJS.layout(cfg);
88
+ }
89
+ }
90
+ }
91
+
92
+
93
+ SitesJS.start();
94
+ document.addEventListener('pjax:complete', function () {
95
+ SitesJS.start();
96
+ });
@@ -0,0 +1,192 @@
1
+ let SearchService = (() => {
2
+ const fn = {};
3
+ fn.queryText = null;
4
+ fn.data = null;
5
+ fn.template = `<div id="u-search">
6
+ <div class="modal">
7
+ <header class="modal-header" class="clearfix">
8
+ <form id="u-search-modal-form" class="u-search-form" name="uSearchModalForm">
9
+ <input type="text" id="u-search-modal-input" class="u-search-input" />
10
+ <button type="submit" id="u-search-modal-btn-submit" class="u-search-btn-submit">
11
+ <span class="fa-solid fa-search"></span>
12
+ </button>
13
+ </form>
14
+ <a id="u-search-btn-close" class="btn-close"> <span class="fa-solid fa-times"></span> </a>
15
+ </header>
16
+ <main class="modal-body">
17
+ <ul class="modal-results"></ul>
18
+ </main>
19
+ </div>
20
+ <div id="modal-overlay" class="modal-overlay"></div>
21
+ </div>
22
+ `;
23
+ fn.init = () => {
24
+ let div = document.createElement("div");
25
+ div.innerHTML += fn.template;
26
+ document.body.append(div);
27
+ document.querySelectorAll(".u-search-form").forEach((e) => {
28
+ e.addEventListener("submit", fn.onSubmit, false);
29
+ });
30
+ let uSearchModalInput = document.querySelector("#u-search-modal-input");
31
+ uSearchModalInput.addEventListener("input", fn.onSubmit);
32
+ document
33
+ .querySelector("#u-search-btn-close")
34
+ .addEventListener("click", fn.close, false);
35
+ document
36
+ .querySelector("#modal-overlay")
37
+ .addEventListener("click", fn.close, false);
38
+ };
39
+ fn.onSubmit = (event) => {
40
+ event.preventDefault();
41
+ let input = event.target.querySelector(".u-search-input");
42
+ if (input) {
43
+ fn.queryText = input.value;
44
+ } else {
45
+ fn.queryText = event.target.value;
46
+ }
47
+
48
+ if (fn.queryText) {
49
+ fn.search();
50
+ }
51
+ };
52
+ fn.search = async () => {
53
+ document.querySelectorAll(".u-search-input").forEach((e) => {
54
+ e.value = fn.queryText;
55
+ });
56
+ document.querySelector("#u-search").style.display = "block";
57
+ if (!fn.data) {
58
+ fn.data = await fn.fetchData();
59
+ }
60
+ let results = "";
61
+ results += fn.buildResultList(fn.data.pages);
62
+ results += fn.buildResultList(fn.data.posts);
63
+ document.querySelector("#u-search .modal-results").innerHTML = results;
64
+ window.pjax && pjax.refresh(document.querySelector("#u-search"));
65
+ document.addEventListener("keydown", function f(event) {
66
+ if (event.code === "Escape") {
67
+ fn.close();
68
+ document.removeEventListener("keydown", f);
69
+ }
70
+ });
71
+ };
72
+ fn.close = () => {
73
+ document.querySelector("#u-search").style.display = "none";
74
+ };
75
+ fn.fetchData = () => {
76
+ return fetch(SearchServiceDataPath)
77
+ .then((response) => response.text())
78
+ .then((res) => {
79
+ const data = JSON.parse(res);
80
+ // console.log(data);
81
+ return data;
82
+ });
83
+ };
84
+ fn.buildResultList = (data) => {
85
+ let html = "";
86
+ data.forEach((post) => {
87
+ if (post.text) {
88
+ post.text = post.text.replace(/12345\d*/g, "") // 简易移除代码行号
89
+ }
90
+ if (!post.title && post.text) {
91
+ post.title = post.text.trim().slice(0, 15)
92
+ }
93
+ if (fn.contentSearch(post)) {
94
+ html += fn.buildResult(post.permalink, post.title, post.digest);
95
+ }
96
+ });
97
+ return html;
98
+ };
99
+ fn.contentSearch = (post) => {
100
+ let post_title = post.title.trim().toLowerCase();
101
+ let post_content = post.text.trim().toLowerCase();
102
+ let keywords = fn.queryText
103
+ .trim()
104
+ .toLowerCase()
105
+ .split(/[-\s]+/);
106
+ let foundMatch = false;
107
+ let index_title = -1;
108
+ let index_content = -1;
109
+ let first_occur = -1;
110
+ if (post_title && post_content) {
111
+ keywords.forEach((word, index) => {
112
+ index_title = post_title.indexOf(word);
113
+ index_content = post_content.indexOf(word);
114
+ if (index_title < 0 && index_content < 0) {
115
+ foundMatch = false;
116
+ } else {
117
+ foundMatch = true;
118
+ if (index_content < 0) {
119
+ index_content = 0;
120
+ }
121
+ if (index === 0) {
122
+ first_occur = index_content;
123
+ }
124
+ }
125
+ if (foundMatch) {
126
+ post_content = post.text.trim();
127
+ let start = 0;
128
+ let end = 0;
129
+ if (first_occur >= 0) {
130
+ start = Math.max(first_occur - 40, 0);
131
+ end =
132
+ start === 0
133
+ ? Math.min(200, post_content.length)
134
+ : Math.min(first_occur + 120, post_content.length);
135
+ let match_content = post_content.substring(start, end);
136
+ keywords.forEach(function (keyword) {
137
+ let regS = new RegExp(keyword, "gi");
138
+ match_content = match_content.replace(
139
+ regS,
140
+ "<b mark>" + keyword + "</b>"
141
+ );
142
+ });
143
+ post.digest = match_content + "......";
144
+ } else {
145
+ end = Math.min(200, post_content.length);
146
+ post.digest = post_content.trim().substring(0, end);
147
+ }
148
+ }
149
+ });
150
+ }
151
+ return foundMatch;
152
+ };
153
+ fn.buildResult = (url, title, digest) => {
154
+ let result = fn.getUrlRelativePath(url);
155
+ let html = "";
156
+ html += "<li>";
157
+ html +=
158
+ "<a class='result' href='" + result + "?keyword=" + fn.queryText + "'>";
159
+ html += "<span class='title'>" + title + "</span>";
160
+ if (digest !== "") html += "<span class='digest'>" + digest + "</span>";
161
+ html += "</a>";
162
+ html += "</li>";
163
+ return html;
164
+ };
165
+ fn.getUrlRelativePath = function (url) {
166
+ let arrUrl = url.split("//");
167
+ let start = arrUrl[1].indexOf("/");
168
+ let relUrl = arrUrl[1].substring(start);
169
+ if (relUrl.indexOf("?") != -1) {
170
+ relUrl = relUrl.split("?")[0];
171
+ }
172
+ return relUrl;
173
+ };
174
+ return {
175
+ init: () => {
176
+ fn.init();
177
+ },
178
+ setQueryText: (queryText) => {
179
+ fn.queryText = queryText;
180
+ },
181
+ search: () => {
182
+ fn.search();
183
+ },
184
+ };
185
+ })();
186
+ Object.freeze(SearchService);
187
+
188
+ SearchService.init();
189
+ document.addEventListener("pjax:success", SearchService.init);
190
+ document.addEventListener("pjax:send", function () {
191
+ document.querySelector("#u-search").style.display = "none";
192
+ });
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@mlikiowa/nanaeo","description":"Volantis nanaeo","version":"1.0.1702966759079","license":"MIT","repository":{"type":"git","url":"git+https://github.com/MliKiowa/nanaeo.git"},"author":"Volantis Community","keywords":["Volantis","Community","static"],"main":"LICENSE"}
1
+ {"name":"@mlikiowa/nanaeo","description":"Volantis nanaeo","version":"1.0.1702967739786","license":"MIT","repository":{"type":"git","url":"git+https://github.com/MliKiowa/nanaeo.git"},"author":"Volantis Community","keywords":["Volantis","Community","static"],"main":"LICENSE"}