-
Notifications
You must be signed in to change notification settings - Fork 56
/
404.php
165 lines (165 loc) · 7.41 KB
/
404.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
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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->page404(); ?>
<?php $this->need('header_com.php'); ?>
<div id="web_bg"></div>
<div class="error404" id="body-wrap">
<header class="not-top-img" id="page-header">
<?php $this->need('public/nav.php'); ?>
</header>
<div id="error-wrap"><div class="error-content"><div class="error-img"><img src="https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png" alt="Page not found" class="entered"></div><div class="error-info"><h1 class="error_title">404</h1><div class="error_subtitle">頁面沒有找到</div></div></div></div></div>
<?php require_once('public/rightside.php');?>
<?php if ($this->options->showFramework == 'off'): ?>
<style>.framework-info{display:none}</style>
<?php endif; ?>
<?php if ($this->options->CursorEffects !== 'off' &&$this->options->CursorEffects == 'heart') : ?>
<script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="false"></script>
<?php elseif ($this->options->CursorEffects !== 'off' &&$this->options->CursorEffects == 'fireworks') : ?>
<canvas class="fireworks"></canvas>
<script id="fireworks" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.0/dist/fireworks.min.js" async="async" mobile="false"></script>
<?php endif; ?>
<?php if ($this->options->ShowLive2D !== 'off' && !isMobile()) : ?>
<script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js"></script>
<?php endif; ?>
<script><?php $this->options->CustomScript() ?></script>
<?php $this->options->CustomBodyEnd() ?>
<!--搜索 -->
<div id="local-search">
<div class="search-dialog" style="">
<nav class="search-nav">
<span class="search-dialog-title">本地搜索</span>
<span id="loading-status"></span>
<button class="search-close-button">
<i class="fas fa-times"></i>
</button>
</nav>
<div class="search-wrap" style="display: block;">
<div id="local-search-input">
<form class="local-search-box" method="post" action="<?php $this->options->siteUrl(); ?>" role="search" id="search">
<label for="s" class="sr-only"><?php _e('搜索关键字'); ?></label>
<input type="text" name="s" placeholder="回车查询" required="required"></div>
</form>
<hr>
<div id="local-search-results"></div>
</div>
</div>
<div id="search-mask" style=""></div>
</div>
</div>
<!--搜索end -->
<div class="js-pjax">
<?php if ($this->options->NewTabLink == 'on'): ?>
<script>
document.addEventListener('DOMContentLoaded', function() {
var aElements = document.getElementsByTagName('a');
var domain = document.domain;
for (var i = 0; i < aElements.length; i++) {
var aElement = aElements[i];
var url = aElement.href;
if (url && url.length > 0 && url.indexOf(domain) === -1 && url !== 'javascript:void(0);') {
aElement.setAttribute('target', '_blank');
}
}
});
</script>
<?php endif; ?>
<?php if($this->is('index')): ?>
<!--打字-->
<?php if (is_array($this->options->beautifyBlock) && in_array('ShowTopimg',$this->options->beautifyBlock)): ?>
<?php if(!empty($this->options->CustomSubtitle)): ?>
<script>
function subtitleType() {
if (true) {
var typed = new Typed("#subtitle", {
strings: "<?php $this->options->CustomSubtitle()?>".split(","),
startDelay: 300,
typeSpeed: 150,
loop: <?php $this->options->SubtitleLoop() ?>,
backSpeed: 50
})
}
}
"function"==typeof Typed?subtitleType():getScript("https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js")
.then(subtitleType)
</script>
<?php else: ?>
<script>
function subtitleType(){
fetch("https://v1.hitokoto.cn").then(t=>t.json()).then(t=>{
o=0=="".length?new Array:" ".split(",");
o.unshift(t.hitokoto),
new Typed("#subtitle",{
strings:o,
startDelay:300,
typeSpeed:150,
loop: <?php $this->options->SubtitleLoop() ?>,
backSpeed:50
}
)}
)}
"function"==typeof Typed?subtitleType():getScript("https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js")
.then(subtitleType)
</script>
<?php endif ?>
<?php endif?>
<!--打字end-->
<!--判断主页end-->
<?php endif?>
</div>
<!--pjax-->
<?php if($this->options->EnablePjax === 'on') : ?>
<?php if($this->options->StaticFile == 'CDN' && $this->options->CDNURL == ''): ?>
<link rel="stylesheet" href="https://<?php $this->options->jsdelivrLink() ?>/gh/rstacruz/nprogress@master/nprogress.css">
<script src="https://<?php $this->options->jsdelivrLink() ?>/gh/rstacruz/nprogress@master/nprogress.js"></script>
<script src="https://<?php $this->options->jsdelivrLink() ?>/npm/pjax/pjax.min.js"></script>
<?php elseif($this->options->StaticFile == 'CDN' && $this->options->CDNURL !== ''): ?>
<link rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.css">
<script src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.js"></script>
<script src="<?php $this->options->CDNURL() ?>/js/pjax.min.js"></script>
<?php else: ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('static/css/nprogress.css'); ?>">
<script src="<?php $this->options->themeUrl('static/js/nprogress.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('static/js/pjax.min.js'); ?>"></script>
<?php endif; ?>
<script>
let pjaxSelectors = ["title", "#body-wrap", "#rightside-config-hide", "#rightside-config-show", ".js-pjax"];
var pjax = new Pjax({
elements: 'a:not([target="_blank"])',
selectors: pjaxSelectors,
cacheBust: !1,
analytics: !1,
scrollRestoration: !1});
document.addEventListener("pjax:send", (function() {
if (window.removeEventListener("scroll", window.tocScrollFn), window.removeEventListener("scroll", scrollCollect), "object" == typeof preloader && preloader.initLoading(), window.aplayers)
for (let e = 0; e < window.aplayers.length; e++) window.aplayers[e].options.fixed || window.aplayers[e].destroy();"object" == typeof typed && typed.destroy();
const e = document.body.classList;
e.contains("read-mode") && e.remove("read-mode")
NProgress.start();
})),
document.addEventListener("pjax:complete", (function() {
<?php $this->options->PjaxCallBack() ?>
NProgress.done();
window.refreshFn(),
document.querySelectorAll("script[data-pjax]").forEach(e => {
const t = document.createElement("script"),
o = e.text || e.textContent || e.innerHTML || "";
Array.from(e.attributes).forEach(e => t.setAttribute(e.name, e.value)), t.appendChild(document.createTextNode(o)), e.parentNode.replaceChild(t, e)}),
GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update(), "function" == typeof chatBtnFn && chatBtnFn(), "function" == typeof panguInit && panguInit(), "function" == typeof gtag && gtag("config", "",
{page_path: window.location.pathname}),
"object" == typeof _hmt && _hmt.push(["_trackPageview", window.location.pathname]),
"function" == typeof loadMeting && document.getElementsByClassName("aplayer").length && loadMeting(),
"object" == typeof Prism && Prism.highlightAll(), "object" == typeof preloader && preloader.endLoading()
})),
document.addEventListener("pjax:error", e => {
// 404 === e.request.status && pjax.loadUrl("/404");
if(e.request.status === 404){
window.location="/404";
}
if(e.request.status === 403){
window.location=e.request.responseURL
}
})
</script>
<?php endif?>
<!--pjax end-->
</body>
</html>