NexT主题中添加网页标题崩溃欺骗搞怪特效

给网页title添加一些搞怪特效

crash_cheat.js

在next\source\js\src文件夹下创建crash_cheat.js,添加代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!--崩溃欺骗-->
var OriginTitle = document.title;
var titleTime;
document.addEventListener('visibilitychange', function () {
if (document.hidden) {
$('[rel="icon"]').attr('href', "http://yun.name168.cn/TEP.ico");
document.title = '╭(°A°`)╮ 页面崩溃啦 ~';
clearTimeout(titleTime);
}
else {
$('[rel="icon"]').attr('href', "/favicon.ico");
document.title = '(ฅ>ω<*ฅ) 噫又好了~' + OriginTitle;
titleTime = setTimeout(function () {
document.title = OriginTitle;
}, 2000);
}
});

调用

在next\layout_layout.swig文件中,添加引用(注:在swig末尾添加):

1
<script type="text/javascript" src="/js/src/crash_cheat.js"></script>
0%