-
Notifications
You must be signed in to change notification settings - Fork 0
/
offline.html
563 lines (455 loc) · 18.4 KB
/
offline.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Offline - Xheldon Blog</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="google-site-verification" content="EX6ES0UVArXTvp5aeeWrkXGn5M5MZ10bYqXanXDEzAs" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="description" content="阅读过的页面可以在离线时访问哦 ;)">
<meta name="keywords" content="Xheldon, 生活, 美食, 旅游, 前端, 技术, 分享">
<meta name="theme-color" content="#000000">
<meta name="twitter:card" content="summary_large_image">
<!-- Open Graph -->
<meta property="og:title" content="Offline - Xheldon Blog">
<meta property="og:type" content="website">
<meta name="og:description" content="阅读过的页面可以在离线时访问哦 ;)">
<meta property="twitter:image" content="https://static.xheldon.cn/img/404-bg.png">
<meta property="og:image" content="https://static.xheldon.cn/img/404-bg.png">
<meta property="og:url" content="https://www.xheldon.com/offline.html">
<meta property="og:site_name" content="Xheldon Blog">
<meta name="google-adsense-account" content="ca-pub-5486286026923411">
<script async src="https://fundingchoicesmessages.google.com/i/pub-5486286026923411?ers=1" nonce="hkl-3cDcQhqR8uwDMTDGjQ"></script><script nonce="hkl-3cDcQhqR8uwDMTDGjQ">(function() {function signalGooglefcPresent() {if (!window.frames['googlefcPresent']) {if (document.body) {const iframe = document.createElement('iframe'); iframe.style = 'width: 0; height: 0; border: none; z-index: -1000; left: -1000px; top: -1000px;'; iframe.style.display = 'none'; iframe.name = 'googlefcPresent'; document.body.appendChild(iframe);} else {setTimeout(signalGooglefcPresent, 0);}}}signalGooglefcPresent();})();</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5486286026923411"
crossorigin="anonymous"></script>
<!-- Web App Manifest -->
<link rel="manifest" href="/pwa/manifest.json">
<!-- Favicon -->
<link rel="shortcut icon" href="/resources/img/favicon.ico">
<!-- Canonical URL -->
<link rel="canonical" href="https://www.xheldon.com/offline.html">
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="https://static.xheldon.cn/css/bootstrap.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="https://static.xheldon.cn/css/xheldon-life-blog.min.css">
<!-- Custom Fonts -->
<!-- <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
<link href="https://static.xheldon.cn/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<!-- hack iOS CSS :active style -->
<body ontouchstart="">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
Xheldon Blog
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div id="xheldonblog_navbar">
<div class="navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="/">Home</a></li>
<li>
<a href="/about/">About</a>
</li>
<li>
<a href="/donate/">Donate</a>
</li>
<li>
<a href="/archive/">Archive</a>
</li>
<li>
<a href="/feed.xml">Rss</a>
</li>
<li class="search-icon">
<a href="javascript:void(0)">
<i class="fa fa-search"></i>
</a>
</li>
</ul>
</div>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<script>
// Drop Bootstarp low-performance Navbar
// Use customize navbar with high-quality material design animation
// in high-perf jank-free CSS3 implementation
var $body = document.body;
var $toggle = document.querySelector('.navbar-toggle');
var $navbar = document.querySelector('#xheldonblog_navbar');
var $collapse = document.querySelector('.navbar-collapse');
var __XheldonNav__ = {
close: function () {
$navbar.className = " ";
// wait until animation end.
setTimeout(function () {
// prevent frequently toggle
if ($navbar.className.indexOf('in') < 0) {
$collapse.style.height = "0px"
}
}, 400)
},
open: function () {
$collapse.style.height = "auto"
$navbar.className += " in";
}
}
// Bind Event
$toggle.addEventListener('click', function (e) {
if ($navbar.className.indexOf('in') > 0) {
__XheldonNav__.close()
} else {
__XheldonNav__.open()
}
})
/**
* Since Fastclick is used to delegate 'touchstart' globally
* to hack 300ms delay in iOS by performing a fake 'click',
* Using 'e.stopPropagation' to stop 'touchstart' event from
* $toggle/$collapse will break global delegation.
*
* Instead, we use a 'e.target' filter to prevent handler
* added to document close XheldonNav.
*
* Also, we use 'click' instead of 'touchstart' as compromise
*/
document.addEventListener('click', function (e) {
if (e.target == $toggle) return;
if (e.target.className == 'icon-bar') return;
__XheldonNav__.close();
})
</script>
<!-- Search -->
<div class="search-page">
<div class="search-icon-close-container">
<span class="search-icon-close">
<i class="fa fa-chevron-down"></i>
</span>
</div>
<div class="search-main container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<form></form>
<input type="text" id="search-input" placeholder="$ grep...">
</form>
<div id="search-results" class="mini-post-list"></div>
</div>
</div>
</div>
</div>
<!-- Page Header -->
<style type="text/css">
header.intro-header{
position: relative;
background-image: url('https://static.xheldon.cn/img/404-bg.png');
}
</style>
<header class="intro-header" >
<div class="header-mask"></div>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading">
<h1>Offline</h1>
<span class="subheading">阅读过的页面可以在离线时访问哦 ;)</span>
</div>
</div>
</div>
</div>
</header>
<script>
document.body.classList.add('page-fullscreen');
</script>
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<!-- SNS Link -->
<ul class="list-inline text-center">
<!--
<li>
<a target="_blank" href="/feed.xml">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-rss fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
-->
<li>
<a target="_blank" href="https://twitter.com/_xheldon">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a target="_blank" href="http://weibo.com/xheldon">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-weibo fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a target="_blank" href="https://www.youtube.com/@xheldon">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-youtube fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a target="_blank" href="https://space.bilibili.com/13835416">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-youtube-play fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a target="_blank" href="https://t.me/xheldon_tech">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-plane fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
<p class="copyright text-muted">
Copyright © <a href="https://github.com/Xheldon" target="_blank">Xheldon</a> 2024
<br>
Don't Panic | Theme fork from <a href="https://github.com/Huxpro/huxpro.github.io" target="_blank">Hux</a>
<br>
</p>
</div>
<!-- <div class="switch-mode" id="dark-mode">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x fa-inverse"></i>
<i class="fa fa-moon-o fa-stack-1x"></i>
</span>
</div>
<div class="switch-mode" id="light-mode">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-sun-o fa-stack-1x fa-inverse"></i>
</span>
</div> -->
</div>
</div>
</footer>
<script>
if (window.matchMedia('(prefers-color-scheme)').media === 'not all') {
console.log('浏览器不支持主题色');
} else {
if(window.matchMedia('(prefers-color-scheme: dark)').matches){
document.documentElement.classList.remove('light');
document.documentElement.classList.add('dark');
// Note: 推特列表添加暗黑主题
let ttl = document.querySelector('.twitter-timeline');
if (ttl) {
ttl.setAttribute('data-theme', 'dark');
}
}
if(window.matchMedia('(prefers-color-scheme: light)').matches){
document.documentElement.classList.remove('dark');
document.documentElement.classList.add('light');
let ttl = document.querySelector('.twitter-timeline');
if (ttl) {
ttl.removeAttribute('data-theme');
}
}
// document.getElementById('dark-mode').addEventListener('click', function() {
// document.documentElement.classList.remove('light');
// document.documentElement.classList.add('dark');
// });
// document.getElementById('light-mode').addEventListener('click', function() {
// document.documentElement.classList.add('light');
// document.documentElement.classList.remove('dark');
// });
// Note: 自动切换
window.matchMedia('(prefers-color-scheme: dark)').addListener(function(mediaQueryList) {
if (mediaQueryList.matches) {
document.documentElement.classList.add('dark');
document.documentElement.classList.remove('light');
}
})
window.matchMedia('(prefers-color-scheme: light)').addListener(function(mediaQueryList) {
if (mediaQueryList.matches) {
document.documentElement.classList.add('light');
document.documentElement.classList.remove('dark');
}
})
}
</script>
<!-- jQuery -->
<script src="https://static.xheldon.cn/js/jquery.min.js "></script>
<!-- Bootstrap Core JavaScript -->
<!-- Currently, only navbar scroll-down effect at desktop still depends on this -->
<script src="https://static.xheldon.cn/js/bootstrap.min.js "></script>
<!-- Custom Theme JavaScript -->
<script src="https://static.xheldon.cn/js/xheldon-life-blog.min.js?202110012319"></script>
<!-- Simple Jekyll Search -->
<script src="https://static.xheldon.cn/js/simple-jekyll-search.min.js"></script>
<!-- Vercel web analysis -->
<script defer src="/_vercel/insights/script.js"></script>
<!-- Service Worker -->
<script src="https://static.xheldon.cn/js/snackbar.js "></script>
<script src="https://static.xheldon.cn/js/sw-registration.js "></script>
<!-- async load function -->
<script>
function async(u, c) {
var d = document, t = 'script',
o = d.createElement(t),
s = d.getElementsByTagName(t)[0];
o.src = u;
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
s.parentNode.insertBefore(o, s);
}
</script>
<!--fastClick.js -->
<script>
async("https://static.xheldon.cn/js/fastclick.min.js", function () {
var $nav = document.querySelector("nav");
if ($nav) FastClick.attach($nav);
})
</script>
<!-- Google Analytics -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-79359216-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-79359216-1');
</script>
<!-- Side Catalog -->
<script type="text/javascript">
function generateCatalog(selector) {
// interop with multilangual
if ('' == 'true') {
_containerSelector = 'div.post-container.active'
} else {
_containerSelector = 'div.post-container'
}
// init
var P = $(_containerSelector), a, n, t, l, i, c;
a = P.find('h1,h2,h3,h4,h5,h6');
// clean
$(selector).html('')
// appending
a.each(function () {
n = $(this).prop('tagName').toLowerCase();
i = "#" + $(this).prop('id');
t = $(this).text();
c = $('<a href="' + i + '" rel="nofollow">' + t + '</a>');
l = $('<li class="' + n + '_nav"></li>').append(c);
$(selector).append(l);
});
return true;
}
generateCatalog(".catalog-body");
// toggle side catalog
$(".catalog-toggle").click((function (e) {
e.preventDefault();
$('.side-catalog').toggleClass("fold")
}))
/*
* Doc: https://github.com/davist11/jQuery-One-Page-Nav
* Fork by Hux to support padding
*/
async("https://static.xheldon.cn/js/jquery.nav.js", function () {
$('.catalog-body').onePageNav({
currentClass: "active",
changeHash: !1,
easing: "swing",
filter: "",
scrollSpeed: 700,
scrollOffset: 0,
scrollThreshold: .2,
begin: null,
end: null,
scrollChange: null,
padding: 80
});
});
</script>
<!-- Multi-Lingual -->
<!-- Simple Jekyll Search -->
<script>
// https://stackoverflow.com/questions/1912501/unescape-html-entities-in-javascript
function htmlDecode(input) {
var e = document.createElement('textarea');
e.innerHTML = input;
// handle case of empty input
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
}
SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('search-results'),
json: '/search.json',
searchResultTemplate: '<div class="post-preview item"><a href="{url}"><h2 class="post-title">{title}</h2><h3 class="post-subtitle">{subtitle}</h3><hr></a></div>',
noResultsText: 'No results',
limit: 50,
fuzzy: false,
// a hack to get escaped subtitle unescaped. for some reason,
// post.subtitle w/o escape filter nuke entire search.
templateMiddleware: function (prop, value, template) {
if (prop === 'subtitle' || prop === 'title') {
if (value.indexOf("code")) {
return htmlDecode(value);
} else {
return value;
}
}
}
});
$(document).ready(function () {
var $searchPage = $('.search-page');
var $searchOpen = $('.search-icon');
var $searchClose = $('.search-icon-close');
var $searchInput = $('#search-input');
var $body = $('body');
$searchOpen.on('click', function (e) {
e.preventDefault();
$searchPage.toggleClass('search-active');
var prevClasses = $body.attr('class') || '';
setTimeout(function () {
$body.addClass('no-scroll');
}, 400)
if ($searchPage.hasClass('search-active')) {
$searchClose.on('click', function (e) {
e.preventDefault();
$searchPage.removeClass('search-active');
$body.attr('class', prevClasses); // from closure
});
$searchInput.focus();
}
});
});
</script>
<!-- Image to hack wechat -->
<img src="/resources/img/icon_wechat.png" width="0" height="0" />
<!-- Migrate from head to bottom, no longer block render and still work -->
</body>
</html>