jekyll-theme-h2o-ac 1.1.15 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -20
- data/_config.yml +9 -5
- data/_data/locales/en.yml +76 -0
- data/_data/locales/ja.yml +76 -0
- data/_data/locales/zh-Hans.yml +76 -0
- data/_data/locales/zh-Hant.yml +76 -0
- data/_includes/footer.html +73 -54
- data/_includes/head.html +2 -1
- data/_includes/header.html +1 -1
- data/_includes/post-head.html +2 -1
- data/_includes/sidebar.html +9 -6
- data/_includes/toc.html +2 -2
- data/_layouts/archives.html +19 -3
- data/_layouts/categories.html +15 -3
- data/_layouts/default.html +5 -5
- data/_layouts/manifest.html +35 -0
- data/_layouts/page.html +35 -11
- data/_layouts/post.html +128 -73
- data/_layouts/search.html +7 -0
- data/_layouts/sw.js +4 -4
- data/_layouts/tags.html +2 -2
- data/assets/css/app.min.css +2593 -1
- data/assets/css/app.min.css.map +1 -0
- data/assets/css/cv.min.css +281 -1
- data/assets/css/cv.min.css.map +1 -0
- data/assets/icons/notbyAI-white.png +0 -0
- data/assets/js/app.min.js +686 -0
- data/assets/js/app.min.js.map +1 -0
- metadata +17 -18
- data/_layouts/manifest.json +0 -35
- data/assets/css/plugins.min.css +0 -1
- data/assets/fonts/iconfont.eot +0 -0
- data/assets/fonts/iconfont.svg +0 -88
- data/assets/fonts/iconfont.ttf +0 -0
- data/assets/fonts/iconfont.woff +0 -0
- data/assets/js/index.min.js +0 -1
- data/assets/js/prism.js +0 -279
- data/assets/js/social-share.min.js +0 -1
- data/assets/js/util.js +0 -16
- data/assets/search.json +0 -13
- data/blog/index.html +0 -7
@@ -0,0 +1,686 @@
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
2
|
+
/******/ var __webpack_modules__ = ({
|
3
|
+
|
4
|
+
/***/ "./dev/js/index.js":
|
5
|
+
/*!*************************!*\
|
6
|
+
!*** ./dev/js/index.js ***!
|
7
|
+
\*************************/
|
8
|
+
/***/ (() => {
|
9
|
+
|
10
|
+
$(document).ready(function () {
|
11
|
+
document.body.addEventListener('touchstart', function () {}, { passive: true });
|
12
|
+
|
13
|
+
var nav = $('.g-nav');
|
14
|
+
var baseurl = $("meta[property='og:baseurl']").attr('content');
|
15
|
+
var logo = $('.g-logo');
|
16
|
+
var themeStyle = $('.g-banner').attr('data-theme');
|
17
|
+
logo.css({
|
18
|
+
'background': 'url(' + baseurl + '/assets/icons/' + themeStyle + '.svg) no-repeat center',
|
19
|
+
'background-size': '100% 100%'
|
20
|
+
});
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Cookie Tips
|
24
|
+
*/
|
25
|
+
var cookieconsent_status = getCookie("cookieconsent_status");
|
26
|
+
if (cookieconsent_status) {
|
27
|
+
$('.cookie-tip').removeClass('active');
|
28
|
+
} else {
|
29
|
+
$('.cookie-tip').addClass('active');
|
30
|
+
}
|
31
|
+
$('#accept-tos').on('click', function () {
|
32
|
+
setCookie("cookieconsent_status", "allow", 365);
|
33
|
+
$('.cookie-tip').removeClass('active');
|
34
|
+
});
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Fix table for small screens
|
38
|
+
*/
|
39
|
+
$("table").wrap("<div class='table-area'></div>");
|
40
|
+
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Responsive Navigation
|
44
|
+
*/
|
45
|
+
$('#menu-toggle').on('click', function (e) {
|
46
|
+
var duration = 200;
|
47
|
+
nav.slideToggle(duration);
|
48
|
+
$(document).on('click', function () {
|
49
|
+
nav.slideUp(duration);
|
50
|
+
});
|
51
|
+
e.stopPropagation();
|
52
|
+
});
|
53
|
+
|
54
|
+
nav.on('click', function (e) {
|
55
|
+
e.stopPropagation();
|
56
|
+
});
|
57
|
+
|
58
|
+
$(".g-nav li.dropdown").on("click", function () {
|
59
|
+
$(".g-nav li.dropdown").not($(this)).children("ul.dropdown-menu").removeClass("show");
|
60
|
+
$(".g-nav li.dropdown").not($(this)).children("a.dropdown-toggle").removeClass("show");
|
61
|
+
$(this).children("a.dropdown-toggle").toggleClass("show");
|
62
|
+
$(this).children("ul.dropdown-menu").toggleClass("show");
|
63
|
+
});
|
64
|
+
$(document).on("click", function () {
|
65
|
+
$(".g-nav li.dropdown").children("a.dropdown-toggle").removeClass("show");
|
66
|
+
$(".g-nav li.dropdown").children("ul.dropdown-menu").removeClass("show");
|
67
|
+
});
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Header Bar
|
71
|
+
*/
|
72
|
+
if ($(window).width() > 695) {
|
73
|
+
var header = $('.g-header');
|
74
|
+
var headerHeight = header.outerHeight();
|
75
|
+
var navText = nav.find('a');
|
76
|
+
var scFlag = $(document).scrollTop();
|
77
|
+
var logo = $('.g-logo');
|
78
|
+
var themeStyle = $('.g-banner').attr('data-theme');
|
79
|
+
|
80
|
+
$(document).scroll(function () {
|
81
|
+
var scrollTop = $(this).scrollTop();
|
82
|
+
var navClassName = 'nav-' + themeStyle;
|
83
|
+
if (scrollTop > headerHeight) {
|
84
|
+
if (scrollTop > 3 * headerHeight) {
|
85
|
+
header.addClass('headerUp');
|
86
|
+
}
|
87
|
+
header.css({
|
88
|
+
'background-color': 'rgba(255, 255, 255, .98)',
|
89
|
+
'box-shadow': '0 1px 12px rgba(0, 0, 0, .08)'
|
90
|
+
});
|
91
|
+
logo.css({
|
92
|
+
'background': 'url(' + baseurl + '/assets/icons/' + themeStyle + '.svg) no-repeat center',
|
93
|
+
'background-size': '100% 100%'
|
94
|
+
});
|
95
|
+
navText.addClass('color-f-gray');
|
96
|
+
nav.addClass(navClassName);
|
97
|
+
} else {
|
98
|
+
header.removeClass('headerUp');
|
99
|
+
// console.log("rm up");
|
100
|
+
$('#bttb').removeClass("active");
|
101
|
+
header.css({
|
102
|
+
'background-color': 'transparent',
|
103
|
+
'box-shadow': 'none'
|
104
|
+
});
|
105
|
+
logo.css({
|
106
|
+
'background': 'url(' + baseurl + '/assets/icons/' + themeStyle + '.svg) no-repeat center',
|
107
|
+
'background-size': '100% 100%'
|
108
|
+
});
|
109
|
+
navText.removeClass('color-f-gray');
|
110
|
+
nav.removeClass(navClassName);
|
111
|
+
}
|
112
|
+
|
113
|
+
// scroll action
|
114
|
+
if (scFlag > scrollTop) {
|
115
|
+
header.addClass('headerDown');
|
116
|
+
if (header.hasClass('headerUp')) {
|
117
|
+
$('#bttb').addClass("active");
|
118
|
+
}
|
119
|
+
} else {
|
120
|
+
header.removeClass('headerDown');
|
121
|
+
$('#bttb').removeClass("active");
|
122
|
+
}
|
123
|
+
scFlag = scrollTop;
|
124
|
+
});
|
125
|
+
} else {
|
126
|
+
var header = $('.g-header');
|
127
|
+
var headerHeight = header.outerHeight();
|
128
|
+
var scFlag = $(document).scrollTop();
|
129
|
+
$(document).scroll(function () {
|
130
|
+
var scrollTop = $(this).scrollTop();
|
131
|
+
|
132
|
+
if (scrollTop < 100) {
|
133
|
+
$('#bttb').removeClass("active");
|
134
|
+
}
|
135
|
+
|
136
|
+
// scroll action
|
137
|
+
if (scFlag > scrollTop && scFlag > 5) {
|
138
|
+
$('#bttb').addClass("active");
|
139
|
+
} else {
|
140
|
+
$('#bttb').removeClass("active");
|
141
|
+
}
|
142
|
+
scFlag = scrollTop;
|
143
|
+
});
|
144
|
+
}
|
145
|
+
|
146
|
+
/**
|
147
|
+
* List for contents
|
148
|
+
*/
|
149
|
+
|
150
|
+
function clickMobileList() {
|
151
|
+
$('.table-of-contents').toggleClass("active");
|
152
|
+
var mode = getCookie("mode");
|
153
|
+
if (mode == "night") {
|
154
|
+
$('.mobile-list .icon.list.night').toggleClass('active');
|
155
|
+
$('.mobile-list .icon.exit.night').toggleClass('active');
|
156
|
+
} else {
|
157
|
+
$('.mobile-list .icon.list.day').toggleClass('active');
|
158
|
+
$('.mobile-list .icon.exit.day').toggleClass('active');
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
$('.mobile-list').bind('click', function () {
|
163
|
+
clickMobileList();
|
164
|
+
});
|
165
|
+
|
166
|
+
$(".table-of-contents").on('click', function () {
|
167
|
+
clickMobileList();
|
168
|
+
});
|
169
|
+
|
170
|
+
|
171
|
+
/**
|
172
|
+
* Back To Top Button
|
173
|
+
*/
|
174
|
+
$('.bttb').bind('click', function () {
|
175
|
+
$('html,body').animate({ scrollTop: 0 }, function () {
|
176
|
+
$('#bttb').removeClass("active");
|
177
|
+
});
|
178
|
+
});
|
179
|
+
|
180
|
+
/**
|
181
|
+
* Post Cover Resize
|
182
|
+
*/
|
183
|
+
function postCover(img, container) {
|
184
|
+
var imgWidth = img.width();
|
185
|
+
var containerWidth = container.width();
|
186
|
+
var imgHeight = img.height();
|
187
|
+
var containerHeight = container.height();
|
188
|
+
|
189
|
+
if (imgHeight < containerHeight) {
|
190
|
+
img.css({
|
191
|
+
'width': 'auto',
|
192
|
+
'height': '100%'
|
193
|
+
});
|
194
|
+
imgWidth = img.width();
|
195
|
+
containerWidth = container.width();
|
196
|
+
var marginLeft = (imgWidth - containerWidth) / 2;
|
197
|
+
img.css('margin-left', '-' + marginLeft + 'px');
|
198
|
+
} else {
|
199
|
+
var marginTop = (containerHeight - imgHeight) / 2;
|
200
|
+
img.css('margin-top', marginTop + 'px');
|
201
|
+
}
|
202
|
+
|
203
|
+
img.fadeIn();
|
204
|
+
}
|
205
|
+
|
206
|
+
/**
|
207
|
+
* The Post Navigator
|
208
|
+
*/
|
209
|
+
$('.read-next-item section').each(function () {
|
210
|
+
var n = $(this).height();
|
211
|
+
var rn = $('.read-next-item').height();
|
212
|
+
$(this).css('margin-top', (rn - n) / 2 + 'px');
|
213
|
+
$(this).fadeIn();
|
214
|
+
});
|
215
|
+
|
216
|
+
$('.read-next-item img').each(function () {
|
217
|
+
postCover($(this), $('.read-next-item'));
|
218
|
+
// $(this).addClass("lazyload");
|
219
|
+
$(this).attr('data-src', $(this).attr('src')).removeAttr('src').addClass("lazyload");
|
220
|
+
});
|
221
|
+
|
222
|
+
/**
|
223
|
+
* Pagination
|
224
|
+
*/
|
225
|
+
function pagination() {
|
226
|
+
var total = parseInt($('#total_pages').val());
|
227
|
+
var current = parseInt($('#current_pages').val());
|
228
|
+
var baseUrl = $('#base_url').val();
|
229
|
+
var limit = 3;
|
230
|
+
|
231
|
+
var link_html = '';
|
232
|
+
|
233
|
+
for (var i = current - limit; i < current; i++) {
|
234
|
+
if (i > 0 && i !== 1) {
|
235
|
+
link_html += '<a href="' + baseUrl + 'page' + i + '/index.html" class="page-link page-num">' + i + '</a>';
|
236
|
+
} else if (i === 1) {
|
237
|
+
link_html += '<a href="' + baseUrl + '" class="page-link page-num">' + i + '</a>';
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
241
|
+
link_html += '<span class="page-link page-num active">' + current + '</span>';
|
242
|
+
|
243
|
+
for (var j = current + 1; j <= current + limit; j++) {
|
244
|
+
if (j <= total) {
|
245
|
+
link_html += '<a href="' + baseUrl + 'page' + j + '/index.html" class="page-link page-num">' + j + '</a>';
|
246
|
+
}
|
247
|
+
}
|
248
|
+
|
249
|
+
$('#page-link-container').html(link_html);
|
250
|
+
}
|
251
|
+
pagination();
|
252
|
+
|
253
|
+
/**
|
254
|
+
* Search
|
255
|
+
*/
|
256
|
+
function Search() {
|
257
|
+
var self = this;
|
258
|
+
var input = $('#search_input');
|
259
|
+
var result = $('.search_result');
|
260
|
+
|
261
|
+
input.focus(function () {
|
262
|
+
$('.icon-search').css('color', '#3199DB');
|
263
|
+
result.show();
|
264
|
+
});
|
265
|
+
|
266
|
+
input.keyup(debounce(this.autoComplete));
|
267
|
+
|
268
|
+
$(document).click(function (e) {
|
269
|
+
if (e.target.id === 'search_input' || e.target.className === 'search_result' || e.target.className === 'search_item') {
|
270
|
+
return;
|
271
|
+
}
|
272
|
+
$('.icon-search').css('color', '#CAD3DC');
|
273
|
+
result.hide();
|
274
|
+
});
|
275
|
+
}
|
276
|
+
|
277
|
+
Search.prototype.autoComplete = function () {
|
278
|
+
var keywords = this.value.toLowerCase();
|
279
|
+
|
280
|
+
if (keywords.length) {
|
281
|
+
$('.icon-search').css('color', '#3199DB');
|
282
|
+
} else {
|
283
|
+
$('.icon-search').css('color', '#CAD3DC');
|
284
|
+
}
|
285
|
+
|
286
|
+
var jsonfile = baseurl + '/assets/search.json';
|
287
|
+
$.getJSON(jsonfile).done(function (data) {
|
288
|
+
var html = '';
|
289
|
+
for (var i in data) {
|
290
|
+
var item = data[i];
|
291
|
+
var title = item.title;
|
292
|
+
var tags = item.tags;
|
293
|
+
var url = item.url;
|
294
|
+
|
295
|
+
var k = title + tags;
|
296
|
+
if (keywords !== '' && k.toLowerCase().indexOf(keywords) >= 0) {
|
297
|
+
html += '<a class="search_item" href="' + item.url + '">' + item.title + '</a>';
|
298
|
+
}
|
299
|
+
}
|
300
|
+
$('.search_result').html(html);
|
301
|
+
});
|
302
|
+
};
|
303
|
+
|
304
|
+
function debounce(fn, delay) {
|
305
|
+
var timer;
|
306
|
+
delay = delay || 120;
|
307
|
+
|
308
|
+
return function () {
|
309
|
+
var ctx = this;
|
310
|
+
var args = arguments;
|
311
|
+
var later = function () {
|
312
|
+
fn.apply(ctx, args);
|
313
|
+
};
|
314
|
+
clearTimeout(timer);
|
315
|
+
timer = setTimeout(later, delay);
|
316
|
+
};
|
317
|
+
}
|
318
|
+
|
319
|
+
new Search();
|
320
|
+
|
321
|
+
/**
|
322
|
+
* Night mode
|
323
|
+
*/
|
324
|
+
function nightMode() {
|
325
|
+
var el = $('body');
|
326
|
+
var className = 'night-mode';
|
327
|
+
|
328
|
+
var date = new Date();
|
329
|
+
var hour = date.getHours();
|
330
|
+
|
331
|
+
var mode = getCookie("mode");
|
332
|
+
if (mode == "") {
|
333
|
+
// console.log(mode);
|
334
|
+
if (hour <= 6 || hour >= 18) {
|
335
|
+
// console.log("Start night mode");
|
336
|
+
setCookie("mode", "night", 1)
|
337
|
+
}
|
338
|
+
// el.addClass(className);
|
339
|
+
}
|
340
|
+
}
|
341
|
+
|
342
|
+
if ($('#nm-switch').val() === 'true') {
|
343
|
+
nightMode();
|
344
|
+
}
|
345
|
+
|
346
|
+
/**
|
347
|
+
* Copy and copyright
|
348
|
+
*/
|
349
|
+
function setClipboardData(str) {
|
350
|
+
str += '\n\n著作权归作者所有。\n商业转载请联系作者获得授权,非商业转载请注明出处。\n原文: ' + location.href;
|
351
|
+
$('.post-content').on('copy', function (e) {
|
352
|
+
var data = window.clipboardData || e.originalEvent.clipboardData;
|
353
|
+
data.setData('text/plain', str);
|
354
|
+
e.preventDefault();
|
355
|
+
});
|
356
|
+
}
|
357
|
+
$('.post-content').on('mouseup', function (e) {
|
358
|
+
var txt = window.getSelection();
|
359
|
+
if (txt.toString().length >= 30) {
|
360
|
+
setClipboardData(txt);
|
361
|
+
}
|
362
|
+
});
|
363
|
+
|
364
|
+
/**
|
365
|
+
* TOC highlight with the corresponding content
|
366
|
+
*/
|
367
|
+
function locateCatelogList() {
|
368
|
+
/*获取文章目录集合,可通过:header过滤器*/
|
369
|
+
var alis = $('article :header');
|
370
|
+
/*获取侧边栏目录列表集合**/
|
371
|
+
var sidebar_alis = $('.table-of-contents').find('a');
|
372
|
+
/*获取滚动条到顶部的距离*/
|
373
|
+
var scroll_height = $(window).scrollTop();
|
374
|
+
if (scroll_height > 0) {
|
375
|
+
$('.g-header').addClass('headerUp');
|
376
|
+
}
|
377
|
+
for (var i = 0; i < alis.length; i++) {
|
378
|
+
/*获取锚点集合中的元素分别到顶点的距离*/
|
379
|
+
var a_height = $(alis[i]).offset().top - 100;
|
380
|
+
if (a_height < scroll_height) {
|
381
|
+
/*高亮显示*/
|
382
|
+
$(sidebar_alis).removeClass('active');
|
383
|
+
$(sidebar_alis[i]).addClass('active');
|
384
|
+
}
|
385
|
+
}
|
386
|
+
}
|
387
|
+
|
388
|
+
locateCatelogList();
|
389
|
+
$(window).bind('scroll', locateCatelogList);
|
390
|
+
|
391
|
+
/**
|
392
|
+
* Day/Night mode switch button
|
393
|
+
*/
|
394
|
+
function getCookie(cname) {
|
395
|
+
var name = cname + "=";
|
396
|
+
var ca = document.cookie.split(';');
|
397
|
+
for (var i = 0; i < ca.length; i++) {
|
398
|
+
var c = ca[i].trim();
|
399
|
+
if (c.indexOf(name) === 0) return c.substring(name.length, c.length);
|
400
|
+
}
|
401
|
+
return "";
|
402
|
+
}
|
403
|
+
|
404
|
+
function setCookie(cname, cvalue, exdays) {
|
405
|
+
var d = new Date();
|
406
|
+
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
|
407
|
+
var expires = "expires=" + d.toGMTString();
|
408
|
+
if (!baseurl) {
|
409
|
+
document.cookie = cname + "=" + cvalue + "; path=/; " + expires;
|
410
|
+
} else {
|
411
|
+
document.cookie = cname + "=" + cvalue + "; path=" + baseurl + "; " + expires;
|
412
|
+
}
|
413
|
+
}
|
414
|
+
|
415
|
+
var mode = getCookie("mode");
|
416
|
+
// console.log(mode);
|
417
|
+
if (mode == "night") {
|
418
|
+
$(".g-nav li.mode .night").addClass("active");
|
419
|
+
$("#mode-toggle .icon-night").addClass("active");
|
420
|
+
$("body").addClass("night-mode");
|
421
|
+
$(".icon.up.night").toggleClass("active");
|
422
|
+
$(".icon.list.night").toggleClass("active");
|
423
|
+
} else {
|
424
|
+
$(".g-nav li.mode .day").addClass("active");
|
425
|
+
$("#mode-toggle .icon-day").addClass("active");
|
426
|
+
$("body").removeClass("night-mode");
|
427
|
+
$(".icon.up.day").toggleClass("active");
|
428
|
+
$(".icon.list.day").toggleClass("active");
|
429
|
+
}
|
430
|
+
|
431
|
+
function changeMode() {
|
432
|
+
var mode = getCookie("mode");
|
433
|
+
if (mode == "") {
|
434
|
+
setCookie("mode", "night", 1)
|
435
|
+
$("body").addClass("night-mode");
|
436
|
+
} else if (mode == "day") {
|
437
|
+
setCookie("mode", "night", 1)
|
438
|
+
$("body").addClass("night-mode");
|
439
|
+
} else {
|
440
|
+
setCookie("mode", "day", 1)
|
441
|
+
$("body").removeClass("night-mode");
|
442
|
+
}
|
443
|
+
// console.log(mode + "-->" + getCookie("mode"));
|
444
|
+
if ($("#disqus_thread").length > 0) {
|
445
|
+
DISQUS.reset({
|
446
|
+
reload: true
|
447
|
+
});
|
448
|
+
}
|
449
|
+
$(".g-nav li.mode .icon").toggleClass("active");
|
450
|
+
$("#mode-toggle .icon").toggleClass("active");
|
451
|
+
$(".icon.up.day").toggleClass("active");
|
452
|
+
$(".icon.up.night").toggleClass("active");
|
453
|
+
if ($('.table-of-contents').css('visibility') == "visible") {
|
454
|
+
$(".icon.exit.day").toggleClass("active");
|
455
|
+
$(".icon.exit.night").toggleClass("active");
|
456
|
+
} else {
|
457
|
+
$(".icon.list.day").toggleClass("active");
|
458
|
+
$(".icon.list.night").toggleClass("active");
|
459
|
+
}
|
460
|
+
}
|
461
|
+
|
462
|
+
$(".g-nav li.mode").click(function () {
|
463
|
+
changeMode();
|
464
|
+
});
|
465
|
+
|
466
|
+
$("#mode-toggle").click(function () {
|
467
|
+
changeMode();
|
468
|
+
});
|
469
|
+
|
470
|
+
/**
|
471
|
+
* Copy code blocks
|
472
|
+
*/
|
473
|
+
// get all <code> elements
|
474
|
+
var allCodeBlocksElements = $("pre");
|
475
|
+
allCodeBlocksElements.each(function (i) {
|
476
|
+
// add different id for each code block
|
477
|
+
// target
|
478
|
+
var currentId = "codeblock" + (i + 1);
|
479
|
+
$(this).attr('id', currentId);
|
480
|
+
var lang = $(this).attr("class").split(" ")[1].substring(9).toUpperCase();
|
481
|
+
|
482
|
+
if (lang == "ERS") {
|
483
|
+
lang = $(this).attr("class").split(" ")[0].substring(9).toUpperCase();
|
484
|
+
if (lang == "MERMAID2") {
|
485
|
+
text = $(this).text();
|
486
|
+
$(this).before('<summary class="render-expand" aria-haspopup="dialog" role="button"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="octicon" style="display:inline-block;vertical-align:text-bottom"><path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 1.06L2.56 7h10.88l-2.22-2.22a.75.75 0 011.06-1.06l3.5 3.5a.75.75 0 010 1.06l-3.5 3.5a.75.75 0 11-1.06-1.06l2.22-2.22H2.56l2.22 2.22a.75.75 0 11-1.06 1.06l-3.5-3.5a.75.75 0 010-1.06l3.5-3.5z"></path></svg></summary>');
|
487
|
+
$(this).after('<div class="mermaid2">' + text + '</div>');
|
488
|
+
} else {
|
489
|
+
$(this).wrap('<div class="highlight"></div>');
|
490
|
+
$(this).parent().wrap('<div class="' + $(this).attr("class").split(" ")[0] + ' highlighter-rouge"></div>');
|
491
|
+
$(this).addClass("highlight");
|
492
|
+
//trigger
|
493
|
+
var clipButton = '<div class="copy-container"><span class="lang">' + lang + '</span><button class="btn" data-bs-original-title="Copy" aria-label="Copy" data-clipboard-target="#' + currentId + '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-copy"></use></svg><span class="tooltip unfinish">Copy</span><span class="tooltip finish">Copied</span></button></div>';
|
494
|
+
$(this).before(clipButton);
|
495
|
+
}
|
496
|
+
} else {
|
497
|
+
//trigger
|
498
|
+
var clipButton = '<div class="copy-container"><span class="lang">' + lang + '</span><button class="btn" data-bs-original-title="Copy" aria-label="Copy" data-clipboard-target="#' + currentId + '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-copy"></use></svg><span class="tooltip unfinish">Copy</span><span class="tooltip finish">Copied</span></button></div>';
|
499
|
+
$(this).before(clipButton);
|
500
|
+
}
|
501
|
+
});
|
502
|
+
|
503
|
+
var clipboard = new ClipboardJS('.btn');
|
504
|
+
clipboard.on('success', function (e) {
|
505
|
+
e.clearSelection();
|
506
|
+
});
|
507
|
+
|
508
|
+
$(".markdown-body .btn").hover(function () {
|
509
|
+
$(this).find(".tooltip.unfinish").addClass("active");
|
510
|
+
}, function () {
|
511
|
+
$(this).find(".tooltip.unfinish").removeClass("active");
|
512
|
+
});
|
513
|
+
|
514
|
+
$(".markdown-body .btn").click(function () {
|
515
|
+
$(this).find(".tooltip.unfinish").removeClass("active");
|
516
|
+
var finish = $(this).find(".tooltip.finish")
|
517
|
+
finish.addClass("active");
|
518
|
+
setTimeout(function () {
|
519
|
+
finish.removeClass("active");
|
520
|
+
}, 500);
|
521
|
+
});
|
522
|
+
|
523
|
+
/**
|
524
|
+
* Expand the mermaid figure
|
525
|
+
*/
|
526
|
+
$("summary").click(function (event) {
|
527
|
+
var text = $(this).next().children().text();
|
528
|
+
$(".modal .modal-content .container").html('<div class="mermaid2">' + text + '</div>')
|
529
|
+
mermaid.init(undefined, $('.modal .modal-content .mermaid2'));
|
530
|
+
$('.modal').css("visibility", "visible");
|
531
|
+
$(".modal .modal-content").click(function (event) {
|
532
|
+
if (event.target.classList.contains("close")) {
|
533
|
+
$(".modal").css("visibility", "hidden");
|
534
|
+
}
|
535
|
+
event.stopPropagation();
|
536
|
+
});
|
537
|
+
event.stopPropagation();
|
538
|
+
});
|
539
|
+
|
540
|
+
$(document).click(function () {
|
541
|
+
$(".modal").css("visibility", "hidden");
|
542
|
+
});
|
543
|
+
|
544
|
+
/**
|
545
|
+
* Error image loading
|
546
|
+
*/
|
547
|
+
document.addEventListener('error', function (e) {
|
548
|
+
if (e.target.nodeName == 'IMG') { e.target.src = baseurl + '/assets/img/placeholder.webp'; }
|
549
|
+
}, true);
|
550
|
+
|
551
|
+
/**
|
552
|
+
* Alive time
|
553
|
+
*/
|
554
|
+
|
555
|
+
var alivetime_days = $(".alivetime_days")
|
556
|
+
var alivetime_hours = $(".alivetime_hours")
|
557
|
+
var alivetime_minutes = $(".alivetime_minutes")
|
558
|
+
var alivetime_seconds = $(".alivetime_seconds")
|
559
|
+
function alive_time() {
|
560
|
+
var alivestart = $("meta[name='alivestart']").attr('content');
|
561
|
+
window.setTimeout(alive_time, 1000);
|
562
|
+
// Start at
|
563
|
+
BirthDay = new Date(alivestart);
|
564
|
+
// Now at
|
565
|
+
today = new Date();
|
566
|
+
timeold = (today.getTime() - BirthDay.getTime());
|
567
|
+
secondsold = Math.floor(timeold / 1000);
|
568
|
+
e_daysold = timeold / (24 * 60 * 60 * 1000);
|
569
|
+
daysold = Math.floor(e_daysold);
|
570
|
+
e_hrsold = (e_daysold - daysold) * 24;
|
571
|
+
hrsold = Math.floor(e_hrsold);
|
572
|
+
e_minsold = (e_hrsold - hrsold) * 60;
|
573
|
+
minsold = Math.floor(e_minsold)
|
574
|
+
seconds = Math.floor((e_minsold - minsold) * 60);
|
575
|
+
alivetime_days.html(daysold)
|
576
|
+
alivetime_hours.html(hrsold)
|
577
|
+
alivetime_minutes.html(minsold)
|
578
|
+
alivetime_seconds.html(seconds)
|
579
|
+
// alivetime.html(daysold + " 天 " + hrsold + " 小时 " + minsold + " 分 " + seconds + " 秒");
|
580
|
+
}
|
581
|
+
alive_time();
|
582
|
+
|
583
|
+
});
|
584
|
+
|
585
|
+
|
586
|
+
/***/ }),
|
587
|
+
|
588
|
+
/***/ "./dev/sass/app.scss":
|
589
|
+
/*!***************************!*\
|
590
|
+
!*** ./dev/sass/app.scss ***!
|
591
|
+
\***************************/
|
592
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
593
|
+
|
594
|
+
"use strict";
|
595
|
+
__webpack_require__.r(__webpack_exports__);
|
596
|
+
// extracted by mini-css-extract-plugin
|
597
|
+
|
598
|
+
|
599
|
+
/***/ })
|
600
|
+
|
601
|
+
/******/ });
|
602
|
+
/************************************************************************/
|
603
|
+
/******/ // The module cache
|
604
|
+
/******/ var __webpack_module_cache__ = {};
|
605
|
+
/******/
|
606
|
+
/******/ // The require function
|
607
|
+
/******/ function __webpack_require__(moduleId) {
|
608
|
+
/******/ // Check if module is in cache
|
609
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
610
|
+
/******/ if (cachedModule !== undefined) {
|
611
|
+
/******/ return cachedModule.exports;
|
612
|
+
/******/ }
|
613
|
+
/******/ // Create a new module (and put it into the cache)
|
614
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
615
|
+
/******/ // no module.id needed
|
616
|
+
/******/ // no module.loaded needed
|
617
|
+
/******/ exports: {}
|
618
|
+
/******/ };
|
619
|
+
/******/
|
620
|
+
/******/ // Execute the module function
|
621
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
622
|
+
/******/
|
623
|
+
/******/ // Return the exports of the module
|
624
|
+
/******/ return module.exports;
|
625
|
+
/******/ }
|
626
|
+
/******/
|
627
|
+
/************************************************************************/
|
628
|
+
/******/ /* webpack/runtime/compat get default export */
|
629
|
+
/******/ (() => {
|
630
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
631
|
+
/******/ __webpack_require__.n = (module) => {
|
632
|
+
/******/ var getter = module && module.__esModule ?
|
633
|
+
/******/ () => (module['default']) :
|
634
|
+
/******/ () => (module);
|
635
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
636
|
+
/******/ return getter;
|
637
|
+
/******/ };
|
638
|
+
/******/ })();
|
639
|
+
/******/
|
640
|
+
/******/ /* webpack/runtime/define property getters */
|
641
|
+
/******/ (() => {
|
642
|
+
/******/ // define getter functions for harmony exports
|
643
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
644
|
+
/******/ for(var key in definition) {
|
645
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
646
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
647
|
+
/******/ }
|
648
|
+
/******/ }
|
649
|
+
/******/ };
|
650
|
+
/******/ })();
|
651
|
+
/******/
|
652
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
653
|
+
/******/ (() => {
|
654
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
655
|
+
/******/ })();
|
656
|
+
/******/
|
657
|
+
/******/ /* webpack/runtime/make namespace object */
|
658
|
+
/******/ (() => {
|
659
|
+
/******/ // define __esModule on exports
|
660
|
+
/******/ __webpack_require__.r = (exports) => {
|
661
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
662
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
663
|
+
/******/ }
|
664
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
665
|
+
/******/ };
|
666
|
+
/******/ })();
|
667
|
+
/******/
|
668
|
+
/************************************************************************/
|
669
|
+
var __webpack_exports__ = {};
|
670
|
+
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
671
|
+
(() => {
|
672
|
+
"use strict";
|
673
|
+
/*!********************!*\
|
674
|
+
!*** ./dev/app.js ***!
|
675
|
+
\********************/
|
676
|
+
__webpack_require__.r(__webpack_exports__);
|
677
|
+
/* harmony import */ var _js_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./js/index.js */ "./dev/js/index.js");
|
678
|
+
/* harmony import */ var _js_index_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_index_js__WEBPACK_IMPORTED_MODULE_0__);
|
679
|
+
/* harmony import */ var _sass_app_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sass/app.scss */ "./dev/sass/app.scss");
|
680
|
+
|
681
|
+
|
682
|
+
})();
|
683
|
+
|
684
|
+
/******/ })()
|
685
|
+
;
|
686
|
+
//# sourceMappingURL=app.min.js.map
|