q78kgblog 0.0.0-1720441708496 → 0.0.0-1720859005089
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/404.html +3 -3
- package/about/index.html +5 -5
- package/archives/2023/02/index.html +4 -4
- package/archives/2023/04/index.html +4 -4
- package/archives/2023/05/index.html +4 -4
- package/archives/2023/08/index.html +4 -4
- package/archives/2023/09/index.html +4 -4
- package/archives/2023/index.html +4 -4
- package/archives/2024/01/index.html +4 -4
- package/archives/2024/02/index.html +4 -4
- package/archives/2024/index.html +4 -4
- package/archives/index.html +4 -4
- package/atom.xml +9 -9
- package/baidusitemap.xml +8 -8
- package/bangumis/index.html +4 -4
- package/bigpie/index.html +3 -3
- package/categories/Hexo/index.html +4 -4
- package/categories/index.html +3 -3
- package/categories//345/271/264/347/273/210/346/200/273/347/273/223/index.html +4 -4
- package/categories//347/264/240/346/235/220/index.html +4 -4
- package/categories//351/227/262/350/201/212/346/235/202/350/260/210/index.html +4 -4
- package/content.json +1 -1
- package/css/404page.css +1 -65
- package/css/ariasakablog.css +1 -6669
- package/css/commentBarrage.css +1 -118
- package/css/danmaku.css +1 -106
- package/css/essay.css +1 -306
- package/css/iconfont.css +1 -55
- package/css/index.css +1 -7006
- package/css/people.css +1 -18
- package/css/stylessimple.css +1 -40
- package/css/swiperstyle.css +1 -567
- package/fcircle/index.html +3 -3
- package/fontawesome/index.html +3 -3
- package/index.html +11 -11
- package/js/aplayersave.js +1 -268
- package/js/baiduhistory.js +1 -76
- package/js/browser.js +1 -35
- package/js/calendar.js +1 -380
- package/js/cate.js +1 -22
- package/js/commentBarrage.js +17 -232
- package/js/commentsCount.js +1 -43
- package/js/copy.js +1 -23
- package/js/countup.js +1 -209
- package/js/cursor.js +1 -82
- package/js/danmaku.js +0 -106
- package/js/day.js +13 -195
- package/js/dianzan.js +1 -249
- package/js/dis.js +4 -252
- package/js/dist/baiduhistory.dev.js +1 -102
- package/js/dist/bbtalk.dev.js +159 -12872
- package/js/dist/bbtalklunbo.dev.js +1 -45
- package/js/dist/calendar.dev.js +1 -395
- package/js/dist/fixbugpjax.dev.js +1 -8
- package/js/dist/gongnong.dev.js +1 -565
- package/js/dist/heimu.dev.js +1 -19
- package/js/dist/links.dev.js +1 -13
- package/js/dist/main.dev.js +5 -843
- package/js/dist/resizeTop.dev.js +1 -50
- package/js/dist/seo.dev.js +1 -33
- package/js/dist/twikoo.all.min.dev.js +946 -1
- package/js/fixbugpjax.js +1 -7
- package/js/fixed_card_widget.js +1 -46
- package/js/fps.js +1 -58
- package/js/gitalker.js +1 -11
- package/js/heimu.js +1 -16
- package/js/hide.show.js +1 -17
- package/js/languages.js +1 -511
- package/js/latest.js +1 -49
- package/js/local-search.js +2 -476
- package/js/lunar.js +1 -1071
- package/js/lyxTalk.js +1 -12
- package/js/main.js +5 -781
- package/js/nav.js +1 -30
- package/js/noie.js +1 -3
- package/js/owo.js +1 -52
- package/js/people.js +2 -175
- package/js/randomFriend.js +1 -95
- package/js/resizeTop.js +1 -43
- package/js/rightmenu.js +3 -333
- package/js/sakura.js +1 -164
- package/js/search/algolia.js +4 -154
- package/js/search/local-search.js +1 -188
- package/js/settings.js +3 -343
- package/js/sitetime.js +1 -25
- package/js/smooth-scrolling.js +1 -546
- package/js/sw-toolbox.js +1 -16
- package/js/swiperinit.js +1 -23
- package/js/tw_cn.js +1 -100
- package/js/utils.js +1 -278
- package/js/welcome.js +1 -107
- package/js/welcomeconsole.js +1 -23
- package/links/index.html +3 -3
- package/othersite/index.html +3 -3
- package/package.json +1 -1
- package/posts/164ef646/index.html +6 -6
- package/posts/228c2ef8/index.html +6 -6
- package/posts/a9a6c1fb/index.html +6 -6
- package/posts/c262e439/index.html +6 -6
- package/posts/c81531cf/index.html +6 -6
- package/posts/ccdf7cfc/index.html +6 -6
- package/posts/de1f83f4/index.html +6 -6
- package/posts/e54f7476/index.html +6 -6
- package/sitemap.xml +49 -49
- package/sw.js +2 -193
- package/swReg.js +1 -29
- package/tags/AI/index.html +5 -5
- package/tags/Butterfly/index.html +5 -5
- package/tags/Cloudflare/index.html +5 -5
- package/tags/DiffSinger/index.html +5 -5
- package/tags/Hexo/index.html +5 -5
- package/tags/Next/index.html +5 -5
- package/tags/RAID/index.html +5 -5
- package/tags/Vercel/index.html +5 -5
- package/tags/Workers/index.html +5 -5
- package/tags/index.html +3 -3
- package/tags//344/270/273/351/242/230/index.html +5 -5
- package/tags//345/206/231/344/275/234/index.html +5 -5
- package/tags//345/245/263/346/200/247/346/204/217/350/257/206/index.html +5 -5
- package/tags//345/255/246/344/271/240/index.html +5 -5
- package/tags//345/256/266/351/207/214/344/272/221/index.html +5 -5
- package/tags//345/271/264/347/273/210/346/200/273/347/273/223/index.html +5 -5
- package/tags//346/212/230/350/205/276/index.html +5 -5
- package/tags//346/227/245/345/270/270/index.html +5 -5
- package/tags//346/234/215/345/212/241/345/231/250/index.html +5 -5
- package/tags//346/265/252/346/275/256/index.html +5 -5
- package/tags//347/256/200/347/210/261/index.html +5 -5
- package/tags//350/207/252/345/212/250/346/240/207/346/263/250/index.html +5 -5
- package/tags//350/256/272/346/226/207/index.html +5 -5
- package/tags//350/260/267/346/255/214/347/277/273/350/257/221/index.html +5 -5
- package/tags//350/264/237/350/275/275/345/235/207/350/241/241/index.html +5 -5
- package/tags//351/207/221/345/217/245/index.html +5 -5
- package/tags//351/255/224/346/224/271/index.html +5 -5
package/js/calendar.js
CHANGED
@@ -1,380 +1 @@
|
|
1
|
-
|
2
|
-
* Calendar - displays a calendar of the current month. Dates appear links if there are posts for that day.
|
3
|
-
*/
|
4
|
-
(function($) {
|
5
|
-
var aCalendar = function(language, options, object) {
|
6
|
-
var now = new Date();
|
7
|
-
var nDay = now.getDate();
|
8
|
-
var nMonth = now.getMonth();
|
9
|
-
var nYear = now.getFullYear();
|
10
|
-
var dDay = nDay;
|
11
|
-
var dMonth = nMonth;
|
12
|
-
var dYear = nYear;
|
13
|
-
var instance = object;
|
14
|
-
var allPosts = null;
|
15
|
-
var months = null;
|
16
|
-
/* Current month's posts */
|
17
|
-
var current = {
|
18
|
-
posts: [],
|
19
|
-
prev: null,
|
20
|
-
next: null
|
21
|
-
};
|
22
|
-
var currentLanguage = 'en';
|
23
|
-
|
24
|
-
initLanguage(language);
|
25
|
-
|
26
|
-
var settings = $.extend({}, $.fn.aCalendar.defaults, typeof calLanguages === 'undefined' ? {} : calLanguages[currentLanguage], options);
|
27
|
-
|
28
|
-
if (settings.root[0] !== '/') {
|
29
|
-
settings.root = '/' + settings.root;
|
30
|
-
}
|
31
|
-
|
32
|
-
if (settings.root[settings.root.length - 1] !== '/') {
|
33
|
-
settings.root += '/';
|
34
|
-
}
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Initial language.
|
38
|
-
*/
|
39
|
-
function initLanguage(key) {
|
40
|
-
if (key && typeof calLanguages !== 'undefined' && calLanguages[key]) {
|
41
|
-
currentLanguage = key;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
/**
|
46
|
-
* Click handler for next month arrow button.
|
47
|
-
*/
|
48
|
-
function nextMonth() {
|
49
|
-
if (dMonth < 11) {
|
50
|
-
dMonth++;
|
51
|
-
} else {
|
52
|
-
dMonth = 0;
|
53
|
-
dYear++;
|
54
|
-
}
|
55
|
-
|
56
|
-
draw();
|
57
|
-
};
|
58
|
-
|
59
|
-
/**
|
60
|
-
* Click handler for previous month arrow button.
|
61
|
-
*/
|
62
|
-
function previousMonth() {
|
63
|
-
if (dMonth > 0) {
|
64
|
-
dMonth--;
|
65
|
-
} else {
|
66
|
-
dMonth = 11;
|
67
|
-
dYear--;
|
68
|
-
}
|
69
|
-
|
70
|
-
draw();
|
71
|
-
};
|
72
|
-
|
73
|
-
/**
|
74
|
-
* Click handler for navigating to a month if there are posts.
|
75
|
-
*/
|
76
|
-
function toPostsMonth(date) {
|
77
|
-
if (date) {
|
78
|
-
dYear = date.getFullYear();
|
79
|
-
dMonth = date.getMonth();
|
80
|
-
draw();
|
81
|
-
}
|
82
|
-
}
|
83
|
-
|
84
|
-
/**
|
85
|
-
* Load current month's posts.
|
86
|
-
*/
|
87
|
-
function loadPosts() {
|
88
|
-
if (settings.single) {
|
89
|
-
loadAllPosts();
|
90
|
-
} else {
|
91
|
-
loadPostsByMonth();
|
92
|
-
}
|
93
|
-
}
|
94
|
-
|
95
|
-
/**
|
96
|
-
* Load all month's posts.
|
97
|
-
*/
|
98
|
-
function loadAllPosts() {
|
99
|
-
if (settings.url != null && settings.url != '') {
|
100
|
-
if (allPosts === null) {
|
101
|
-
$.ajax({
|
102
|
-
url: settings.url,
|
103
|
-
async: false,
|
104
|
-
success: function(data) {
|
105
|
-
allPosts = data;
|
106
|
-
initMonths(Object.keys(allPosts));
|
107
|
-
}
|
108
|
-
});
|
109
|
-
}
|
110
|
-
|
111
|
-
if (allPosts !== null) {
|
112
|
-
if (parse()) {
|
113
|
-
current.posts = allPosts[dYear + '-' + (dMonth + 1)];
|
114
|
-
}
|
115
|
-
}
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
/**
|
120
|
-
* Load posts by the month.
|
121
|
-
*/
|
122
|
-
function loadPostsByMonth() {
|
123
|
-
if (months === null) {
|
124
|
-
$.ajax({
|
125
|
-
url: settings.root + 'list.json',
|
126
|
-
async: false,
|
127
|
-
success: function(data) {
|
128
|
-
initMonths(data);
|
129
|
-
}
|
130
|
-
});
|
131
|
-
}
|
132
|
-
|
133
|
-
if (parse()) {
|
134
|
-
$.ajax({
|
135
|
-
url: settings.root + dYear + '-' + (dMonth + 1) + '.json',
|
136
|
-
async: false,
|
137
|
-
success: function(data) {
|
138
|
-
current.posts = data;
|
139
|
-
}
|
140
|
-
});
|
141
|
-
}
|
142
|
-
}
|
143
|
-
|
144
|
-
/**
|
145
|
-
* Initial months array.
|
146
|
-
*/
|
147
|
-
function initMonths(array) {
|
148
|
-
months = array.map(function(item) {
|
149
|
-
var ym = item.split('-');
|
150
|
-
return new Date(Date.UTC(+ym[0], +ym[1] - 1));
|
151
|
-
});
|
152
|
-
}
|
153
|
-
|
154
|
-
/**
|
155
|
-
* Parse posts month array, and set current.next and current.prev.
|
156
|
-
*
|
157
|
-
* @return if there are posts in this month, return true. ortherwise return false.
|
158
|
-
*/
|
159
|
-
function parse() {
|
160
|
-
var time = Date.UTC(dYear, dMonth);
|
161
|
-
|
162
|
-
if (months === null || months.length === 0) {
|
163
|
-
return false;
|
164
|
-
}
|
165
|
-
|
166
|
-
//If no posts in the current month, and before (or after) the current month yet not published articles, then the response to click previous month's (or next month's) event don't need to parse months array
|
167
|
-
if (current.posts.length === 0 && (current.prev === null && current.next !== null && current.next.getTime() > time || current.next === null && current.prev !== null && current.prev.getTime() < time)) {
|
168
|
-
return false;
|
169
|
-
}
|
170
|
-
|
171
|
-
current.posts = [];
|
172
|
-
|
173
|
-
for (var i = 0; i < months.length; i++) {
|
174
|
-
var cTime = months[i].getTime();
|
175
|
-
if (time === cTime) {
|
176
|
-
current.prev = i === 0 ? null : months[i - 1];
|
177
|
-
current.next = i === months.length - 1 ? null : months[i + 1];
|
178
|
-
return true;
|
179
|
-
} else if (time < cTime) {
|
180
|
-
current.prev = i === 0 ? null : months[i - 1];
|
181
|
-
current.next = months[i];
|
182
|
-
break;
|
183
|
-
} else {
|
184
|
-
current.prev = months[i];
|
185
|
-
current.next = null;
|
186
|
-
}
|
187
|
-
}
|
188
|
-
|
189
|
-
return false;
|
190
|
-
}
|
191
|
-
|
192
|
-
/**
|
193
|
-
* Format date object.
|
194
|
-
*/
|
195
|
-
function simpleDateFormat(date, fmt) {
|
196
|
-
var o = {
|
197
|
-
'LMM+': settings.months[date.getMonth()],
|
198
|
-
'MM+': date.getMonth() + 1
|
199
|
-
};
|
200
|
-
|
201
|
-
if (/(y+)/.test(fmt)) {
|
202
|
-
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
203
|
-
}
|
204
|
-
|
205
|
-
for (var k in o) {
|
206
|
-
if (new RegExp('(' + k + ')').test(fmt)) {
|
207
|
-
fmt = fmt.replace(RegExp.$1, (k === 'LMM+') ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
|
208
|
-
}
|
209
|
-
}
|
210
|
-
|
211
|
-
return fmt;
|
212
|
-
}
|
213
|
-
|
214
|
-
/**
|
215
|
-
* Draw calendar.
|
216
|
-
*
|
217
|
-
*/
|
218
|
-
function draw() {
|
219
|
-
loadPosts();
|
220
|
-
var dWeekDayOfMonthStart = new Date(dYear, dMonth, 1).getDay() - settings.weekOffset;
|
221
|
-
if (dWeekDayOfMonthStart <= 0) {
|
222
|
-
dWeekDayOfMonthStart = 6 - ((dWeekDayOfMonthStart + 1) * -1);
|
223
|
-
}
|
224
|
-
|
225
|
-
var dLastDayOfMonth = new Date(dYear, dMonth + 1, 0).getDate();
|
226
|
-
var dLastDayOfPreviousMonth = new Date(dYear, dMonth, 0).getDate() - dWeekDayOfMonthStart + 1;
|
227
|
-
|
228
|
-
var cHead = $('<div/>').addClass('cal-head');
|
229
|
-
var cNext = $('<div/>');
|
230
|
-
var cPrevious = $('<div/>');
|
231
|
-
var cTitle = $('<div/>').addClass('cal-title');
|
232
|
-
cPrevious.html(settings.headArrows.previous);
|
233
|
-
cNext.html(settings.headArrows.next);
|
234
|
-
curDate = new Date(Date.UTC(dYear, dMonth));
|
235
|
-
if (current.posts.length === 0) {
|
236
|
-
cTitle.html(simpleDateFormat(curDate, settings.titleFormat));
|
237
|
-
} else {
|
238
|
-
cTitleLink = $('<a/>').attr('onclick', `pjax.loadUrl('${simpleDateFormat(curDate, settings.titleLinkFormat)}')`)
|
239
|
-
.attr('title', simpleDateFormat(curDate, settings.postsMonthTip))
|
240
|
-
.html(simpleDateFormat(curDate, settings.titleFormat));
|
241
|
-
cTitle.html(cTitleLink);
|
242
|
-
}
|
243
|
-
|
244
|
-
cPrevious.on('click', previousMonth);
|
245
|
-
cNext.on('click', nextMonth);
|
246
|
-
|
247
|
-
cHead.append(cPrevious);
|
248
|
-
cHead.append(cTitle);
|
249
|
-
cHead.append(cNext);
|
250
|
-
|
251
|
-
var cBody = $('<table/>').addClass('cal');
|
252
|
-
|
253
|
-
var dayOfWeek = settings.weekOffset;
|
254
|
-
var cWeekHead = $('<thead/>');
|
255
|
-
var cWeekHeadRow = $('<tr/>');
|
256
|
-
for (var i = 0; i < 7; i++) {
|
257
|
-
if (dayOfWeek > 6) {
|
258
|
-
dayOfWeek = 0;
|
259
|
-
}
|
260
|
-
|
261
|
-
var cWeekDay = $('<th/>').attr('scope', 'col').attr('title', settings.dayOfWeek[dayOfWeek]);
|
262
|
-
cWeekDay.html(settings.dayOfWeekShort[dayOfWeek]);
|
263
|
-
cWeekHeadRow.append(cWeekDay);
|
264
|
-
dayOfWeek++;
|
265
|
-
}
|
266
|
-
|
267
|
-
cWeekHead.append(cWeekHeadRow);
|
268
|
-
cBody.append(cWeekHead);
|
269
|
-
|
270
|
-
var cFoot = $('<tfoot/>');
|
271
|
-
var cFootRow = $('<tr/>');
|
272
|
-
var cPrevPosts = $('<td/>').attr('colspan', 3);
|
273
|
-
var cPad = $('<td/>').html(' ');
|
274
|
-
var cNextPosts = $('<td/>').attr('colspan', 3);
|
275
|
-
if (current.prev) {
|
276
|
-
cPrevPosts.html(settings.footArrows.previous + settings.months[current.prev.getMonth()])
|
277
|
-
.addClass('cal-foot')
|
278
|
-
.attr('title', simpleDateFormat(current.prev, settings.postsMonthTip));
|
279
|
-
}
|
280
|
-
|
281
|
-
if (current.next) {
|
282
|
-
cNextPosts.html(settings.months[current.next.getMonth()] + settings.footArrows.next)
|
283
|
-
.addClass('cal-foot')
|
284
|
-
.attr('title', simpleDateFormat(current.next, settings.postsMonthTip));
|
285
|
-
}
|
286
|
-
|
287
|
-
cPrevPosts.on('click', function() {
|
288
|
-
toPostsMonth(current.prev);
|
289
|
-
});
|
290
|
-
|
291
|
-
cNextPosts.on('click', function() {
|
292
|
-
toPostsMonth(current.next);
|
293
|
-
});
|
294
|
-
|
295
|
-
cFootRow.append(cPrevPosts);
|
296
|
-
cFootRow.append(cPad);
|
297
|
-
cFootRow.append(cNextPosts);
|
298
|
-
cFoot.append(cFootRow);
|
299
|
-
|
300
|
-
var cMainPad = $('<tbody/>');
|
301
|
-
var day = 1;
|
302
|
-
var dayOfNextMonth = 1;
|
303
|
-
for (var i = 0; i < 6; i++) {
|
304
|
-
var cWeek = $('<tr/>');
|
305
|
-
for (var j = 0; j < 7; j++) {
|
306
|
-
var cDay = $('<td/>');
|
307
|
-
if (i * 7 + j < dWeekDayOfMonthStart) {
|
308
|
-
cDay.addClass('cal-gray');
|
309
|
-
cDay.html(dLastDayOfPreviousMonth++);
|
310
|
-
} else if (day <= dLastDayOfMonth) {
|
311
|
-
if (day == dDay && nMonth == dMonth && nYear == dYear) {
|
312
|
-
cDay.addClass('cal-today');
|
313
|
-
}
|
314
|
-
|
315
|
-
var count = {
|
316
|
-
num: 0,
|
317
|
-
keys: []
|
318
|
-
};
|
319
|
-
for (var k = 0; k < current.posts.length; k++) {
|
320
|
-
var d = new Date(Date.parse(current.posts[k].date));
|
321
|
-
if (d.getDate() == day) {
|
322
|
-
count.keys[count.num++] = k;
|
323
|
-
}
|
324
|
-
}
|
325
|
-
|
326
|
-
if (count.num !== 0) {
|
327
|
-
var index = count.keys[0];
|
328
|
-
var cLink = $('<a>').attr('onclick', `pjax.loadUrl('${current.posts[index].link}')`).attr('title', current.posts[index].title).html(day++);
|
329
|
-
cDay.append(cLink);
|
330
|
-
} else {
|
331
|
-
cDay.html(day++);
|
332
|
-
}
|
333
|
-
} else {
|
334
|
-
cDay.addClass('cal-gray');
|
335
|
-
cDay.html(dayOfNextMonth++);
|
336
|
-
}
|
337
|
-
|
338
|
-
cWeek.append(cDay);
|
339
|
-
}
|
340
|
-
|
341
|
-
cMainPad.append(cWeek);
|
342
|
-
}
|
343
|
-
|
344
|
-
cBody.append(cWeekHead);
|
345
|
-
cBody.append(cFoot);
|
346
|
-
cBody.append(cMainPad);
|
347
|
-
|
348
|
-
$(instance).html(cHead);
|
349
|
-
$(instance).append(cBody);
|
350
|
-
}
|
351
|
-
|
352
|
-
return draw();
|
353
|
-
};
|
354
|
-
|
355
|
-
$.fn.aCalendar = function(Lang, oInit) {
|
356
|
-
return this.each(function() {
|
357
|
-
return aCalendar(Lang, oInit, $(this));
|
358
|
-
});
|
359
|
-
};
|
360
|
-
|
361
|
-
// plugin defaults
|
362
|
-
$.fn.aCalendar.defaults = {
|
363
|
-
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
364
|
-
dayOfWeekShort: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
|
365
|
-
dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
366
|
-
postsMonthTip: 'Posts published in LMM yyyy',
|
367
|
-
titleFormat: 'yyyy LMM',
|
368
|
-
titleLinkFormat: '/archives/yyyy/MM/',
|
369
|
-
headArrows: {previous: '<span class="cal-prev"></span>', next: '<span class="cal-next"></span>'},
|
370
|
-
footArrows: {previous: '« ', next: ' »'},
|
371
|
-
weekOffset: 0,
|
372
|
-
single: true,
|
373
|
-
root: '/calendar/',
|
374
|
-
url: '/calendar.json'
|
375
|
-
};
|
376
|
-
|
377
|
-
}(jQuery));
|
378
|
-
$(document).ready(function () {
|
379
|
-
$("#calendar").aCalendar("zh-CN");
|
380
|
-
});
|
1
|
+
(function(n){var Q=function(w,D,q){var C=new Date,G=C.getDate(),A=C.getMonth(),j=C.getFullYear(),I=G,l=A,i=j,S=q,c=null,o=null,e={posts:[],prev:null,next:null},W="en";K(w);var a=n.extend({},n.fn.aCalendar.defaults,typeof calLanguages>"u"?{}:calLanguages[W],D);a.root[0]!=="/"&&(a.root="/"+a.root),a.root[a.root.length-1]!=="/"&&(a.root+="/");function K(t){t&&typeof calLanguages<"u"&&calLanguages[t]&&(W=t)}function V(){l<11?l++:(l=0,i++),y()}function X(){l>0?l--:(l=11,i--),y()}function R(t){t&&(i=t.getFullYear(),l=t.getMonth(),y())}function Z(){a.single?_():tt()}function _(){a.url!=null&&a.url!=""&&(c===null&&n.ajax({url:a.url,async:!1,success:function(t){c=t,N(Object.keys(c))}}),c!==null&&U()&&(e.posts=c[i+"-"+(l+1)]))}function tt(){o===null&&n.ajax({url:a.root+"list.json",async:!1,success:function(t){N(t)}}),U()&&n.ajax({url:a.root+i+"-"+(l+1)+".json",async:!1,success:function(t){e.posts=t}})}function N(t){o=t.map(function(r){var s=r.split("-");return new Date(Date.UTC(+s[0],+s[1]-1))})}function U(){var t=Date.UTC(i,l);if(o===null||o.length===0||e.posts.length===0&&(e.prev===null&&e.next!==null&&e.next.getTime()>t||e.next===null&&e.prev!==null&&e.prev.getTime()<t))return!1;e.posts=[];for(var r=0;r<o.length;r++){var s=o[r].getTime();if(t===s)return e.prev=r===0?null:o[r-1],e.next=r===o.length-1?null:o[r+1],!0;if(t<s){e.prev=r===0?null:o[r-1],e.next=o[r];break}else e.prev=o[r],e.next=null}return!1}function p(t,r){var s={"LMM+":a.months[t.getMonth()],"MM+":t.getMonth()+1};/(y+)/.test(r)&&(r=r.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var u in s)new RegExp("("+u+")").test(r)&&(r=r.replace(RegExp.$1,u==="LMM+"?s[u]:("00"+s[u]).substr((""+s[u]).length)));return r}function y(){Z();var t=new Date(i,l,1).getDay()-a.weekOffset;t<=0&&(t=6-(t+1)*-1);var r=new Date(i,l+1,0).getDate(),s=new Date(i,l,0).getDate()-t+1,u=n("<div/>").addClass("cal-head"),k=n("<div/>"),L=n("<div/>"),T=n("<div/>").addClass("cal-title");L.html(a.headArrows.previous),k.html(a.headArrows.next),curDate=new Date(Date.UTC(i,l)),e.posts.length===0?T.html(p(curDate,a.titleFormat)):(cTitleLink=n("<a/>").attr("onclick",`pjax.loadUrl('${p(curDate,a.titleLinkFormat)}')`).attr("title",p(curDate,a.postsMonthTip)).html(p(curDate,a.titleFormat)),T.html(cTitleLink)),L.on("click",X),k.on("click",V),u.append(L),u.append(T),u.append(k);for(var v=n("<table/>").addClass("cal"),h=a.weekOffset,F=n("<thead/>"),Y=n("<tr/>"),f=0;f<7;f++){h>6&&(h=0);var E=n("<th/>").attr("scope","col").attr("title",a.dayOfWeek[h]);E.html(a.dayOfWeekShort[h]),Y.append(E),h++}F.append(Y),v.append(F);var H=n("<tfoot/>"),M=n("<tr/>"),O=n("<td/>").attr("colspan",3),et=n("<td/>").html(" "),b=n("<td/>").attr("colspan",3);e.prev&&O.html(a.footArrows.previous+a.months[e.prev.getMonth()]).addClass("cal-foot").attr("title",p(e.prev,a.postsMonthTip)),e.next&&b.html(a.months[e.next.getMonth()]+a.footArrows.next).addClass("cal-foot").attr("title",p(e.next,a.postsMonthTip)),O.on("click",function(){R(e.prev)}),b.on("click",function(){R(e.next)}),M.append(O),M.append(et),M.append(b),H.append(M);for(var J=n("<tbody/>"),g=1,at=1,f=0;f<6;f++){for(var B=n("<tr/>"),P=0;P<7;P++){var d=n("<td/>");if(f*7+P<t)d.addClass("cal-gray"),d.html(s++);else if(g<=r){g==I&&A==l&&j==i&&d.addClass("cal-today");for(var m={num:0,keys:[]},x=0;x<e.posts.length;x++){var nt=new Date(Date.parse(e.posts[x].date));nt.getDate()==g&&(m.keys[m.num++]=x)}if(m.num!==0){var z=m.keys[0],rt=n("<a>").attr("onclick",`pjax.loadUrl('${e.posts[z].link}')`).attr("title",e.posts[z].title).html(g++);d.append(rt)}else d.html(g++)}else d.addClass("cal-gray"),d.html(at++);B.append(d)}J.append(B)}v.append(F),v.append(H),v.append(J),n(S).html(u),n(S).append(v)}return y()};n.fn.aCalendar=function(w,D){return this.each(function(){return Q(w,D,n(this))})},n.fn.aCalendar.defaults={months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["S","M","T","W","T","F","S"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],postsMonthTip:"Posts published in LMM yyyy",titleFormat:"yyyy LMM",titleLinkFormat:"/archives/yyyy/MM/",headArrows:{previous:'<span class="cal-prev"></span>',next:'<span class="cal-next"></span>'},footArrows:{previous:"\xAB ",next:" \xBB"},weekOffset:0,single:!0,root:"/calendar/",url:"/calendar.json"}})(jQuery),$(document).ready(function(){$("#calendar").aCalendar("zh-CN")});
|
package/js/cate.js
CHANGED
@@ -1,22 +1 @@
|
|
1
|
-
var card_category_list =
|
2
|
-
"card-category-list child"
|
3
|
-
);
|
4
|
-
var item = document.getElementsByClassName("card-category-list-item");
|
5
|
-
function toggle(t) {
|
6
|
-
var display = t.parentElement.nextSibling.style.display;
|
7
|
-
if (display == "none") {
|
8
|
-
t.parentElement.nextSibling.style.display = "block";
|
9
|
-
t.parentElement.nextSibling.style.height = "100%";
|
10
|
-
t.className = t.className.replace("fa-chevron-up", "fa-chevron-down");
|
11
|
-
} else {
|
12
|
-
t.parentElement.nextSibling.style.display = "none";
|
13
|
-
t.className = t.className.replace("fa-chevron-down", "fa-chevron-up");
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
|
-
for (var i = 0; i < card_category_list.length; i++) {
|
18
|
-
card_category_list[i].style.display = "none";
|
19
|
-
card_category_list[i].style.transition = "all 1s";
|
20
|
-
card_category_list[i].previousSibling.innerHTML +=
|
21
|
-
'<i class="fa fa-chevron-up menus-expand menus-closed" aria-hidden="true" style="margin-left:20px;" οnclick="toggle(this)"></i>';
|
22
|
-
}
|
1
|
+
var card_category_list=document.getElementsByClassName("card-category-list child"),item=document.getElementsByClassName("card-category-list-item");function toggle(e){var n=e.parentElement.nextSibling.style.display;n=="none"?(e.parentElement.nextSibling.style.display="block",e.parentElement.nextSibling.style.height="100%",e.className=e.className.replace("fa-chevron-up","fa-chevron-down")):(e.parentElement.nextSibling.style.display="none",e.className=e.className.replace("fa-chevron-down","fa-chevron-up"))}for(var i=0;i<card_category_list.length;i++)card_category_list[i].style.display="none",card_category_list[i].style.transition="all 1s",card_category_list[i].previousSibling.innerHTML+='<i class="fa fa-chevron-up menus-expand menus-closed" aria-hidden="true" style="margin-left:20px;" \u03BFnclick="toggle(this)"></i>';
|
package/js/commentBarrage.js
CHANGED
@@ -1,240 +1,25 @@
|
|
1
|
-
document.addEventListener(
|
2
|
-
document.addEventListener('DOMContentLoaded', startbarrage);
|
3
|
-
|
4
|
-
function startbarrage(){
|
5
|
-
try{
|
6
|
-
clearInterval(timer);
|
7
|
-
document.querySelector('.comment-barrage').innerHTML="";
|
8
|
-
delete sw;
|
9
|
-
}catch(err){}
|
10
|
-
const commentBarrageConfig = {
|
11
|
-
//浅色模式和深色模式颜色,务必保持一致长度,前面是背景颜色,后面是字体,随机选择,默认这个颜色还好
|
12
|
-
lightColors:[
|
13
|
-
['#ffffffaa!important','var(--lyx-black)'],
|
14
|
-
],
|
15
|
-
darkColors:[
|
16
|
-
['#000a!important','var(--lyx-white)'],
|
17
|
-
],
|
18
|
-
//同时最多显示弹幕数
|
19
|
-
maxBarrage: 1,
|
20
|
-
//弹幕显示间隔时间,单位ms
|
21
|
-
barrageTime: 3000,
|
22
|
-
//twikoo部署地址(Vercel、私有部署),腾讯云的为环境ID
|
23
|
-
twikooUrl: "https://twikoo.anjiurine.top",
|
24
|
-
//token获取见前文
|
25
|
-
accessToken: "f0fac9b52af34219af509d087ea72c4a",
|
26
|
-
pageUrl: window.location.pathname,
|
27
|
-
barrageTimer: [],
|
28
|
-
barrageList: [],
|
29
|
-
barrageIndex: 0,
|
30
|
-
// 没有设置过头像时返回的默认头像,见cravatar文档 https://cravatar.cn/developers/api,可以不改以免出错
|
31
|
-
noAvatarType: "retro",
|
32
|
-
dom: document.querySelector('.comment-barrage'),
|
33
|
-
//是否默认显示留言弹幕
|
34
|
-
displayBarrage: true,
|
35
|
-
//头像cdn,默认cravatar
|
36
|
-
avatarCDN: "cravatar.cn",
|
37
|
-
}
|
38
|
-
function checkURL(URL){
|
39
|
-
var str=URL;
|
40
|
-
//判断URL地址的正则表达式为:http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
|
41
|
-
//下面的代码中应用了转义字符"\"输出一个字符"/"
|
42
|
-
var Expression=/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
|
43
|
-
var objExp=new RegExp(Expression);
|
44
|
-
if(objExp.test(str)==true){
|
45
|
-
return true;
|
46
|
-
}else{
|
47
|
-
return false;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
function isInViewPortOfOne (el) {
|
51
|
-
const viewPortHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
|
52
|
-
const offsetTop = el.offsetTop
|
53
|
-
const scrollTop = document.documentElement.scrollTop
|
54
|
-
const top = offsetTop - scrollTop
|
55
|
-
return top <= viewPortHeight
|
56
|
-
}
|
57
|
-
if(location.href.indexOf("posts")!=-1||location.href.indexOf("posts")!=-1)
|
58
|
-
document.onscroll = function() {
|
59
|
-
if(commentBarrageConfig.displayBarrage){
|
60
|
-
if(isInViewPortOfOne(document.getElementById("post-comment"))){
|
61
|
-
document.getElementsByClassName("barrageswiper")[0].style.transform="translateX(514px)";
|
62
|
-
document.getElementsByClassName("barrageswiper")[0].style.opacity="0";
|
63
|
-
}
|
64
|
-
else{
|
65
|
-
document.getElementsByClassName("barrageswiper")[0].style.transform="";
|
66
|
-
document.getElementsByClassName("barrageswiper")[0].style.opacity="1";
|
67
|
-
}
|
68
|
-
}
|
69
|
-
}
|
70
|
-
function initCommentBarrage(){
|
71
|
-
|
72
|
-
var data = JSON.stringify({
|
73
|
-
"event": "COMMENT_GET",
|
74
|
-
"commentBarrageConfig.accessToken": commentBarrageConfig.accessToken,
|
75
|
-
"url": commentBarrageConfig.pageUrl
|
76
|
-
});
|
77
|
-
var xhr = new XMLHttpRequest();
|
78
|
-
xhr.withCredentials = true;
|
79
|
-
xhr.addEventListener("readystatechange", function() {
|
80
|
-
if(this.readyState === 4) {
|
81
|
-
commentBarrageConfig.barrageList = commentLinkFilter(JSON.parse(this.responseText).data);
|
82
|
-
commentBarrageConfig.dom.innerHTML = '';
|
83
|
-
for(commentBarrageConfig.barrageIndex=0;commentBarrageConfig.barrageIndex<commentBarrageConfig.barrageList.length;commentBarrageConfig.barrageIndex++){
|
84
|
-
popCommentBarrage(commentBarrageConfig.barrageList[commentBarrageConfig.barrageIndex]);
|
85
|
-
}
|
86
|
-
kkksc03=new Swiper('.barrageswiper', {
|
87
|
-
direction: "vertical",
|
88
|
-
loop: true,
|
89
|
-
mousewheel:true,
|
90
|
-
autoplay: {
|
91
|
-
delay: 3000,
|
92
|
-
stopOnLastSlide: false,
|
93
|
-
disableOnInteraction: false,
|
94
|
-
},
|
95
|
-
})
|
96
|
-
kkksc03.el.onmouseover = function(){
|
97
|
-
kkksc03.autoplay.stop();
|
98
|
-
}
|
99
|
-
kkksc03.el.onmouseout = function(){
|
100
|
-
kkksc03.autoplay.start();
|
101
|
-
}
|
102
|
-
}
|
103
|
-
});
|
104
|
-
xhr.open("POST", commentBarrageConfig.twikooUrl);
|
105
|
-
xhr.setRequestHeader("Content-Type", "application/json");
|
106
|
-
xhr.send(data);
|
107
|
-
// timer=setInterval(()=>{
|
108
|
-
// if(commentBarrageConfig.barrageList.length){
|
109
|
-
// popCommentBarrage(commentBarrageConfig.barrageList[commentBarrageConfig.barrageIndex]);
|
110
|
-
// commentBarrageConfig.barrageIndex += 1;
|
111
|
-
// commentBarrageConfig.barrageIndex %= commentBarrageConfig.barrageList.length;
|
112
|
-
// }
|
113
|
-
// if(commentBarrageConfig.barrageTimer.length > (commentBarrageConfig.barrageList.length > commentBarrageConfig.maxBarrage?commentBarrageConfig.maxBarrage:commentBarrageConfig.barrageList.length)){
|
114
|
-
// removeCommentBarrage(commentBarrageConfig.barrageTimer.shift())
|
115
|
-
// }
|
116
|
-
// },commentBarrageConfig.barrageTime)
|
117
|
-
|
118
|
-
}
|
119
|
-
function commentLinkFilter(data){
|
120
|
-
data.sort((a,b)=>{
|
121
|
-
return a.created - b.created;
|
122
|
-
})
|
123
|
-
let newData = [];
|
124
|
-
data.forEach(item=>{
|
125
|
-
newData.push(...getCommentReplies(item));
|
126
|
-
});
|
127
|
-
return newData;
|
128
|
-
}
|
129
|
-
function getCommentReplies(item){
|
130
|
-
if(item.replies){
|
131
|
-
let replies = [item];
|
132
|
-
item.replies.forEach(item=>{
|
133
|
-
replies.push(...getCommentReplies(item));
|
134
|
-
})
|
135
|
-
return replies;
|
136
|
-
}else{
|
137
|
-
return [];
|
138
|
-
}
|
139
|
-
}
|
140
|
-
function popCommentBarrage(data){
|
141
|
-
let barrage = document.createElement('div');
|
142
|
-
let width = commentBarrageConfig.dom.clientWidth;
|
143
|
-
let height = commentBarrageConfig.dom.clientHeight;
|
144
|
-
barrage.className = 'comment-barrage-item'
|
145
|
-
let ran = Math.floor(Math.random()*commentBarrageConfig.lightColors.length)
|
146
|
-
document.getElementById("barragesColor").innerHTML=`[data-theme='light'] .comment-barrage-item { background-color:${commentBarrageConfig.lightColors[ran][0]};color:${commentBarrageConfig.lightColors[ran][1]}}[data-theme='dark'] .comment-barrage-item{ background-color:${commentBarrageConfig.darkColors[ran][0]};color:${commentBarrageConfig.darkColors[ran][1]}}`;
|
147
|
-
if(data.avatar!=undefined){
|
148
|
-
if(data.link!=undefined){
|
149
|
-
if(!checkURL(data.link)){
|
150
|
-
data.link="http://"+data.link;
|
151
|
-
}
|
152
|
-
barrage.innerHTML = `
|
1
|
+
document.addEventListener("pjax:complete",startbarrage),document.addEventListener("DOMContentLoaded",startbarrage);function startbarrage(){try{clearInterval(timer),document.querySelector(".comment-barrage").innerHTML="",delete sw}catch{}const r={lightColors:[["#ffffffaa!important","var(--lyx-black)"]],darkColors:[["#000a!important","var(--lyx-white)"]],maxBarrage:1,barrageTime:3e3,twikooUrl:"https://twikoo.anjiurine.top",accessToken:"f0fac9b52af34219af509d087ea72c4a",pageUrl:window.location.pathname,barrageTimer:[],barrageList:[],barrageIndex:0,noAvatarType:"retro",dom:document.querySelector(".comment-barrage"),displayBarrage:!0,avatarCDN:"cravatar.cn"};function i(e){var a=e,t=/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/,n=new RegExp(t);return n.test(a)==!0}function s(e){const a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,t=e.offsetTop,n=document.documentElement.scrollTop;return t-n<=a}(location.href.indexOf("posts")!=-1||location.href.indexOf("posts")!=-1)&&(document.onscroll=function(){r.displayBarrage&&(s(document.getElementById("post-comment"))?(document.getElementsByClassName("barrageswiper")[0].style.transform="translateX(514px)",document.getElementsByClassName("barrageswiper")[0].style.opacity="0"):(document.getElementsByClassName("barrageswiper")[0].style.transform="",document.getElementsByClassName("barrageswiper")[0].style.opacity="1"))});function c(){var e=JSON.stringify({event:"COMMENT_GET","commentBarrageConfig.accessToken":r.accessToken,url:r.pageUrl}),a=new XMLHttpRequest;a.withCredentials=!0,a.addEventListener("readystatechange",function(){if(this.readyState===4){for(r.barrageList=g(JSON.parse(this.responseText).data),r.dom.innerHTML="",r.barrageIndex=0;r.barrageIndex<r.barrageList.length;r.barrageIndex++)m(r.barrageList[r.barrageIndex]);kkksc03=new Swiper(".barrageswiper",{direction:"vertical",loop:!0,mousewheel:!0,autoplay:{delay:3e3,stopOnLastSlide:!1,disableOnInteraction:!1}}),kkksc03.el.onmouseover=function(){kkksc03.autoplay.stop()},kkksc03.el.onmouseout=function(){kkksc03.autoplay.start()}}}),a.open("POST",r.twikooUrl),a.setRequestHeader("Content-Type","application/json"),a.send(e)}function g(e){e.sort((t,n)=>t.created-n.created);let a=[];return e.forEach(t=>{a.push(...l(t))}),a}function l(e){if(e.replies){let a=[e];return e.replies.forEach(t=>{a.push(...l(t))}),a}else return[]}function m(e){let a=document.createElement("div"),t=r.dom.clientWidth,n=r.dom.clientHeight;a.className="comment-barrage-item";let o=Math.floor(Math.random()*r.lightColors.length);document.getElementById("barragesColor").innerHTML=`[data-theme='light'] .comment-barrage-item { background-color:${r.lightColors[o][0]};color:${r.lightColors[o][1]}}[data-theme='dark'] .comment-barrage-item{ background-color:${r.darkColors[o][0]};color:${r.darkColors[o][1]}}`,e.avatar!=null?e.link!=null?(i(e.link)||(e.link="http://"+e.link),a.innerHTML=`
|
153
2
|
<div class="barrageHead">
|
154
|
-
<img class="barrageAvatar" src="${
|
155
|
-
<a href="${
|
156
|
-
<a href="javascript:switchCommentBarrage()" style="font-size:20px"
|
3
|
+
<img class="barrageAvatar" src="${e.avatar}"/>
|
4
|
+
<a href="${e.link}" class="barrageNick" target="_blank">${e.nick}</a>
|
5
|
+
<a href="javascript:switchCommentBarrage()" style="font-size:20px">\xD7</a>
|
157
6
|
</div>
|
158
|
-
`
|
159
|
-
}
|
160
|
-
else{
|
161
|
-
barrage.innerHTML = `
|
7
|
+
`):a.innerHTML=`
|
162
8
|
<div class="barrageHead">
|
163
|
-
<img class="barrageAvatar" src="${
|
164
|
-
<div class="barrageNick">${
|
165
|
-
<a href="javascript:switchCommentBarrage()" style="font-size:20px"
|
9
|
+
<img class="barrageAvatar" src="${e.avatar}"/>
|
10
|
+
<div class="barrageNick">${e.nick}</div>
|
11
|
+
<a href="javascript:switchCommentBarrage()" style="font-size:20px">\xD7</a>
|
166
12
|
</div>
|
167
|
-
|
168
|
-
}
|
169
|
-
}
|
170
|
-
else{
|
171
|
-
if(data.link!=undefined){
|
172
|
-
if(!checkURL(data.link)){
|
173
|
-
data.link="http://"+data.link;
|
174
|
-
}
|
175
|
-
barrage.innerHTML = `
|
13
|
+
`:e.link!=null?(i(e.link)||(e.link="http://"+e.link),a.innerHTML=`
|
176
14
|
<div class="barrageHead">
|
177
|
-
<img class="barrageAvatar" src="https://${
|
178
|
-
<a href="${
|
179
|
-
<a href="javascript:switchCommentBarrage()" style="font-size:20px"
|
15
|
+
<img class="barrageAvatar" src="https://${r.avatarCDN}/avatar/${e.mailMd5}?d=${r.noAvatarType}"/>
|
16
|
+
<a href="${e.link}" class="barrageNick" target="_blank">${e.nick}</a>
|
17
|
+
<a href="javascript:switchCommentBarrage()" style="font-size:20px">\xD7</a>
|
180
18
|
</div>
|
181
|
-
`
|
182
|
-
}
|
183
|
-
else{
|
184
|
-
barrage.innerHTML = `
|
19
|
+
`):a.innerHTML=`
|
185
20
|
<div class="barrageHead">
|
186
|
-
<img class="barrageAvatar" src="https://${
|
187
|
-
<div class="barrageNick">${
|
188
|
-
<a href="javascript:switchCommentBarrage()" style="font-size:20px"
|
21
|
+
<img class="barrageAvatar" src="https://${r.avatarCDN}/avatar/${e.mailMd5}?d=${r.noAvatarType}"/>
|
22
|
+
<div class="barrageNick">${e.nick}</div>
|
23
|
+
<a href="javascript:switchCommentBarrage()" style="font-size:20px">\xD7</a>
|
189
24
|
</div>
|
190
|
-
|
191
|
-
}
|
192
|
-
}
|
193
|
-
barrageContent=document.createElement('a');
|
194
|
-
barrageContent.className="barrageContent";
|
195
|
-
barrageContent.href="#"+data.id;
|
196
|
-
barrageContent.innerHTML=data.comment;
|
197
|
-
barrage.appendChild(barrageContent);
|
198
|
-
// commentBarrageConfig.barrageTimer.push(barrage);
|
199
|
-
aswiper = document.createElement('div');
|
200
|
-
aswiper.className="swiper-slide";
|
201
|
-
// aswiper.setAttribute("data-swiper-slide-index","8")
|
202
|
-
aswiper.setAttribute("style","height: 150px;");
|
203
|
-
// aswiper.setAttribute("role","group")
|
204
|
-
// aswiper.setAttribute("aria-label","9 / 19");
|
205
|
-
aswiper.append(barrage);
|
206
|
-
commentBarrageConfig.dom.append(aswiper);
|
207
|
-
}
|
208
|
-
switchCommentBarrage = function () {
|
209
|
-
localStorage.setItem("isBarrageToggle",Number(!Number(localStorage.getItem("isBarrageToggle"))))
|
210
|
-
if(!isInViewPortOfOne(document.getElementById("post-comment"))){
|
211
|
-
commentBarrageConfig.displayBarrage=!(commentBarrageConfig.displayBarrage);
|
212
|
-
let commentBarrage = document.querySelector('.comment-barrage');
|
213
|
-
if (commentBarrage) {
|
214
|
-
$(commentBarrage).fadeToggle()
|
215
|
-
}
|
216
|
-
}
|
217
|
-
|
218
|
-
}
|
219
|
-
// $(".comment-barrage").hover(function(){
|
220
|
-
// clearInterval(timer);
|
221
|
-
// },function () {
|
222
|
-
// timer=setInterval(()=>{
|
223
|
-
// if(commentBarrageConfig.barrageList.length){
|
224
|
-
// popCommentBarrage(commentBarrageConfig.barrageList[commentBarrageConfig.barrageIndex]);
|
225
|
-
// commentBarrageConfig.barrageIndex += 1;
|
226
|
-
// commentBarrageConfig.barrageIndex %= commentBarrageConfig.barrageList.length;
|
227
|
-
// }
|
228
|
-
// if(commentBarrageConfig.barrageTimer.length > (commentBarrageConfig.barrageList.length > commentBarrageConfig.maxBarrage?commentBarrageConfig.maxBarrage:commentBarrageConfig.barrageList.length)){
|
229
|
-
// removeCommentBarrage(commentBarrageConfig.barrageTimer.shift())
|
230
|
-
// }
|
231
|
-
// },commentBarrageConfig.barrageTime)
|
232
|
-
// })
|
233
|
-
if(localStorage.getItem("isBarrageToggle")==undefined){
|
234
|
-
localStorage.setItem("isBarrageToggle","0");
|
235
|
-
}else if(localStorage.getItem("isBarrageToggle")=="1"){
|
236
|
-
localStorage.setItem("isBarrageToggle","0");
|
237
|
-
switchCommentBarrage()
|
238
|
-
}
|
239
|
-
initCommentBarrage()
|
240
|
-
}
|
25
|
+
`,barrageContent=document.createElement("a"),barrageContent.className="barrageContent",barrageContent.href="#"+e.id,barrageContent.innerHTML=e.comment,a.appendChild(barrageContent),aswiper=document.createElement("div"),aswiper.className="swiper-slide",aswiper.setAttribute("style","height: 150px;"),aswiper.append(a),r.dom.append(aswiper)}switchCommentBarrage=function(){if(localStorage.setItem("isBarrageToggle",+!Number(localStorage.getItem("isBarrageToggle"))),!s(document.getElementById("post-comment"))){r.displayBarrage=!r.displayBarrage;let e=document.querySelector(".comment-barrage");e&&$(e).fadeToggle()}},localStorage.getItem("isBarrageToggle")==null?localStorage.setItem("isBarrageToggle","0"):localStorage.getItem("isBarrageToggle")=="1"&&(localStorage.setItem("isBarrageToggle","0"),switchCommentBarrage()),c()}
|