-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathfooter.php
88 lines (86 loc) · 4.08 KB
/
footer.php
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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<div class="mx-auto px3 my5">
<footer id="footer" style="display:block;">
<div class="footer-left">
Copyright © <?php echo date('Y'); ?> By <a href="http://www.typecho.org" target="_blank" rel="nofollow">Typecho</a> & <a href="https://www.krsay.com/typecho/cactus.html" target="_blank">Xingr</a> <?php if($this->options->beian): ?><a href="https://beian.miit.gov.cn/"><?php $this->options->beian();?></a><?php endif; ?>
</div>
<div class="footer-right">
<nav>
<ul>
<li>
<a href="<?php $this->options->siteUrl();?>">Home</a>
</li>
<?php $this->widget('Widget_Contents_Page_List')->parse('<li><a href="{permalink}">{title}</a></li>'); ?>
<?php if($this->options->github): ?><li>
<a href="<?php $this->options->github();?>" target="_blank">Github</a>
</li><?php endif; ?>
</ul>
</nav>
</div>
</footer>
</div>
<link rel="stylesheet" href="<?php $this->options->themeUrl('lib/font-awesome/css/font-awesome.min.css'); ?>">
<script src="<?php $this->options->themeUrl('js/main.js'); ?>"></script>
<?php if ($this->is('index')) : ?>
<script src="<?php $this->options->themeUrl('lib/typed.js'); ?>"></script>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<script>
$(function () {
if (location.pathname !== "/") return;
$.get("<?php $this->options->siteUrl();?><?php echo date('Ymd').'.json';?>", function (data) {
var str = (data.content || "") + "\n" + (data.translation || "");
var options = {
strings: [
str + "\nWelcome to my blog. ^1000",
str + "\nHave a good day. ^1000",
str + `\n---- ${data.author}. ^1000`,
],
typeSpeed: 20,
startDelay: 300,
// loop: true,
};
var typed = new Typed(".description .typed", options);
});
});
</script>
<?php endif; ?>
<?php if ($this->is('post') || $this->is('page')) : ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('css/lightbox.min.css'); ?>">
<script src="<?php $this->options->themeUrl('js/lightbox.min.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('lib/highlight.min.js'); ?>"></script>
<script>
$('#post-content img').wrap(function () {
return '<a href="' + this.src + '" title="' + this.alt + '" data-lightbox="roadtrip"></a>';
});
</script>
<script>hljs.highlightAll();</script>
<?php endif; ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('css/search.css'); ?>">
<div class="searchbox">
<div class="searchbox-container">
<div class="searchbox-input-wrapper">
<form class="search-form" method="post" action="<?php $this->options->siteUrl(); ?>" role="search">
<input name="s" type="search" class="searchbox-input" placeholder="输入关键字回车搜索" />
<span class="searchbox-close searchbox-selectable"><i class="fa fa-times-circle"></i></span>
</form>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded',function(){(function($){$('#search').click(function(){$('.searchbox').toggleClass('show')});$('.searchbox .searchbox-mask').click(function(){$('.searchbox').removeClass('show')});$('.searchbox-close').click(function(){$('.searchbox').removeClass('show')})})(jQuery)});
</script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
const code = document.querySelector('#code');
navigator.serviceWorker.register('<?php $this->options->themeUrl('/sw.js'); ?>').then(function(registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
console.log('ServiceWorker registration failed: ', err);
});
});
}
</script>
<?php $this->footer(); ?>
</body>
</html>