世界安好

记录一下第一次搭typecho XD

用的特效来自这里这里, 将html和js代码放入footer.php的body标签内最后即可。

HoerMouse: 鼠标插件
MC风格指针库

APlayer: 可选作用域的音乐播放器
QPlayer: 全局的音乐播放器
Pio: 看板娘

看板娘文档
Pio交互提示扩展:

1
2
3
4
5
6
7
8
9
10
11
12
13
{
"welcome": ["你好,欢迎来到Enoch的小站"],
"touch": ["我要恰大米!", "有大米吗?", "提款机我要吃大葱!"],
"home": "点击这里回到首页!",
"link": "https://coolenoch.ink",
"close": "QWQ 有缘再会吧~",
"referer": "你通过 %t 来到了这里",
"custom": [
{
"selector": ".comment-form"
}
]
}

GoTop: 返回顶部插件

离开网页提示
在footer.php中编辑

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!-- 离开网页提示 start -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
var OriginTitile = document.title,
titleTime;
document.addEventListener("visibilitychange", function() {
if (document.hidden) {
$('[rel="icon"]').attr("href", "https://img1.baidu.com/it/u=2168395802,233412699&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=526");
document.title = "页面已崩溃!点击恢复!";
clearTimeout(titleTime);
} else {
$('[rel="icon"]').attr("href", "https://user-images.githubusercontent.com/22438240/258717075-1c071b29-c4d5-4f75-9ca6-3cdcf9b73151.svg");
document.title = "(/≧▽≦/)咦!又好了! " + OriginTitile;
titleTime = setTimeout(function() {
document.title = OriginTitile;
}, 2000);
}
});
</script>
<!-- 离开网页提示 end -->

主页不显示文章全文
index.phparchive.php阅读全文所在div周围代码改成如下:

1
2
3
4
5
6
7
8
<div class="post-content" itemprop="articleBody">
<?php replaceTag($this->excerpt(100)); ?>
<div text-center class="post-button">
<a href="<?php $this->permalink() ?>">
<?php _e('- 阅读全文 -'); ?>
</a>
</div>
</div>

(主要是添加第二行代码<?php replaceTag($this->excerpt(100)); ?>;或者超过200字就显示为省略号<?php $this->excerpt(200, '...'); ?>或者直接不显示概要<?php $this->excerpt(); ?>)

石蒜摇~~~
添加到控制台-外观-设置外观-自定义CSS代码
代码来自itorr/sakana, 我稍微修改了一下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<meta name="viewport" content="width=device-width">
<style>
.sakana-box{
position: fixed;
left: 0;
bottom: 0;
transform-origin: 0% 100%; /* 从左下开始变换 */
}
</style>

<div class="sakana-box" style='position:fixed; z-index:999; left:0; bottom:0;'></div>
<script src="https://cdn.jsdelivr.net/npm/sakana@1.0.8"></script>
<script>
// 取消静音
Sakana.setMute(false);
// 启动
Sakana.init({
el: '.sakana-box', // 启动元素 node 或 选择器
scale: .5, // 缩放倍数
canSwitchCharacter: true, // 允许换角色
});
</script>

或者将这段代码添加到footer.php中也行:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!-- Sakana start -->
<div class="sakana-box" style='position:fixed; z-index:999; left:0; bottom:0; transform-origin: 0% 100%; /* 从左下开始变换 */'></div>
<script src="https://cdn.jsdelivr.net/npm/sakana@1.0.8"></script>
<script>
// 取消静音
Sakana.setMute(false);
// 启动
Sakana.init({
el: '.sakana-box', // 启动元素 node 或 选择器
scale: .5, // 缩放倍数
canSwitchCharacter: true, // 允许换角色
});
</script>
<!-- Sakana end -->

模糊的背景图片
添加到footer.php中

1
2
3
<!-- 模糊背景 start -->
<div class="backgroundDiv" style="position: fixed;top: 0;left: 0;width: 100%;height: 100%;background-image: url('/url/to/your.jpg');background-size: cover;background-position: center;filter: blur(10px);z-index: -1;"></div>
<!-- 模糊背景 end-->

世界安好
http://blog.coolenoch.ink/2023/07/20/0世界安好-230720/
作者
CoolestEnoch
发布于
2023年7月20日
许可协议