Blog修改记录
下面的代码均在新建的 source\js\qwq.js 中使用。本文添加的css都是在qwq.jsjs注入的,参考下面 Butterfly多语种翻译(translate.js) 的方法。
Butterfly多语种翻译(translate.js)
之前使用过开源的 translate.js 来为静态页面实现翻译功能。在使用 Hexo Butterfly(经过大佬魔改的版本)时,虽然已经具备简体中文和繁体中文之间的切换功能,但不支持翻译成其他语言。
现在的浏览器自带翻译功能和各种翻译扩展已经非常强大,可以适当提醒用户进行翻译,网站右下角也提供选择翻译语言功能。
- 当用户的语言与网页语言不同时,会弹出提示,提醒用户是否启用翻译。点击
OK后提示就不会再次出现,如果两者语言一致,则不会显示任何提示。 - 设置按钮新增了
language按钮,点击后弹出翻译选择框,用户可以自行选择翻译语言,不用的时候自动隐藏。
翻译提醒通知代码:
qwq.js中添加的代码:
1 | //翻译提醒通知 |
翻译按钮代码:
qwq.js中添加的代码:
1 | // CSS 部分通过 JS 插入 |
themes\butterfly\layout\includes\rightside.pug中添加(关于language)代码:
1 | mixin rightsideItem(array) |
_config.butterfly.yml中添加的代码:
1 | inject: |
如果想隐藏原来繁简转换,可以在_config.butterfly.yml修改:
1 | translate: |
Twikoo评论头像位置错误修复
在使用Fomalhaut 3.5(大佬魔改的butterfly主题)Twikoo评论时,发现评论框的样式错误,打开f12开发者模式检测发现自适应代码在页面横像素大于1024px时会自动修改left的参数,导致头像框位置错误,评论框宽度width也被自动修改了。
所以在themes\butterfly\source\css\_custom\custom.css中删减或注释的代码阻止修改:
1 | /* 自适应内容 */ |
Twikoo添加想要的表情包
在twikoo评论时默认的表情包没有自己想要的表情包。
添加表情包
就想自己添加表情包,经过学习大佬的文章给twikoo添加自定义表情包,明白了owo.json文件的格式。(设置owo.json的操作就不再赘述)
| 标签 | 释义 |
|---|---|
| typet | 表情包的类别 |
| text | 表情包名字 |
| icon | 表情包图标(一般由img标签引入) |
在 owo.json 文件格式是这样的(注意。。不要漏,):
1 | { |
表情包下载
因为表情包在B站(BiliBili),所以借助BiliResourceDownloader 开源工具 (具体的使用方式请看原作者的仓库文档)下载自己喜欢的表情包。例如,站长这里添加鹿乃的表情包:
效果展示
将表情包存放在图床或其他地方,按照格式填写owo.json文件,刷新页面即可。
1 | { |
调整 Aplayer 收回方式、隐藏歌词和美化
调整 Aplayer 收回方式及隐藏歌词
Aplayer 收回方式
参考并添加了一点小动画:1
2
3
4
5
6
7
8.aplayer.aplayer-fixed.aplayer-narrow .aplayer-body{
left:-66px;
transition-delay: 2s;
}/*隐藏播放器*/
.aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover{
left:0;
transition-delay: 0s;
}
隐藏歌词
歌词默认显示,在_config.butterfly.yml替换CDN模拟点击关闭歌词。
例如:1
2
3
4
5bottom:
aplayer_css: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.css
aplayer_js: https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.js
+ meting_js: https://cdn.akioi.eu.org/meting.min.js
- meting_js: https://cdn1.tianli0.top/npm/js-heo@1.0.12/metingjs/Meting.min.js
美化(2025/8/13)
参考hexo博客butterfly主题aplyer音乐播放器美化与深色模式
效果本站播放器。大佬的样式,豪康(好看)!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/*aplayer日间模式调整*/
/*背景色*/
.aplayer{
background: rgba(255, 255, 255, 0.60);
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.07),0 1px 5px 0 rgba(0,0,0,.1);
position: relative;
}
.aplayer.aplayer-fixed .aplayer-lrc:after,.aplayer.aplayer-fixed .aplayer-lrc:before {
display: none
}
.aplayer.aplayer.aplayer-fixed .aplayer-body{
background:rgba(255, 255, 255, 0.60);
box-shadow: 0 2px 2px 0 rgba(0,0,0,.07),0 1px 5px 0 rgba(0,0,0,.1);
position: fixed;
}
/*毛玻璃效果*/
.aplayer-list{
backdrop-filter: blur(3px);
}
.aplayer-info{
backdrop-filter: blur(3px);
}
/*滚动条*/
.aplayer .aplayer-list ol::-webkit-scrollbar {
width: 5px
}
.aplayer .aplayer-list ol::-webkit-scrollbar-thumb {
border-radius: 3px;
background-color: #b0e1ff
}
.aplayer .aplayer-list ol::-webkit-scrollbar-thumb:hover {
background-color: #b0e1ff
}
/*圆角*/
.aplayer.aplayer-fixed .aplayer-list{
border-radius: 6px 6px 0 0;
}
.aplayer.aplayer-fixed .aplayer-miniswitcher{
border-radius: 0 6px 6px 0;
}
.aplayer.aplayer-fixed.aplayer-narrow .aplayer-body{
border-radius: 6px;
}
.aplayer-body{
border-radius:0 6px 6px 0;
}
.aplayer.no-destroy.no-reload.aplayer-withlist.aplayer-fixed{
border-radius:6px 6px 0 0;
}
/*选中与播放中歌曲激活颜色*/
.aplayer .aplayer-list ol li:hover{
background: #b0e1ff;
}
.aplayer .aplayer-list ol li.aplayer-list-light{
background: #ffdffa;
}
/*aplayer黑暗模式*/
[data-theme=dark]
.aplayer{
background: rgba(22, 22, 22, 0.60);
color: rgb(255, 255, 255);
box-shadow: 0 2px 2px 0 rgba(0,0,0,.07),0 1px 5px 0 rgba(0,0,0,.1);
}
[data-theme=dark]
.aplayer.aplayer-fixed .aplayer-body{
background: rgba(22, 22, 22, 0.60);
color: rgb(255, 255, 255);
box-shadow: 0 2px 2px 0 rgba(0,0,0,.07),0 1px 5px 0 rgba(0,0,0,.1);
}
[data-theme=dark]
.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon path{
fill: #d4d4d4;
}
[data-theme=dark]
.aplayer .aplayer-list ol li:hover{
background: #407290;
}
[data-theme=dark]
.aplayer .aplayer-list ol li.aplayer-list-light{
background: #9c8098;
}
[data-theme=dark]
.aplayer .aplayer-info .aplayer-controller .aplayer-time{
color: #d4d4d4;
}
[data-theme=dark]
.aplayer .aplayer-list ol li .aplayer-list-index{
color: #d4d4d4;
}
[data-theme=dark]
.aplayer .aplayer-list ol li .aplayer-list-author{
color: #d4d4d4;
}
首页分类磁贴1.0出现两组临时处理
hexo-magnet 插件 1.0
不知道为什么用着用着就会变成两组,直接F12大法,去掉顺序第二个磁贴.recent-post-item(具体样式看自己页面源码情况)。
1 | .recent-post-item:nth-child(2){ |
Blog朋友圈(Friend-Circle-Lite)
效果:RoHananの朋友圈








