美化Hexo Butterfly博客:让你的博客原地起飞!🚀
好家伙!前两篇教程带大伙儿把博客搭起来了是吧?今天咱整点刺激的——给你的Butterfly博客来波史诗级美容!看完这篇,保证你博客美得连亲妈都认不出来(手动狗头)
一、整容级主题美化(效果堪比PS十级)
1.1 改色大法好 🌈
打开_config.butterfly.yml直接开整:
# 主题颜色(骚粉色警告!)
theme_color:
light: \"#FF7C7C\" # 白天模式骚起来
dark: \"#FF5252\" # 晚上模式继续骚
# 渐变色背景(装X必备)
background:
light:
# 顶部渐变(朋友圈装X素材+1)
header: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)1.2 自定义CSS(秃头程序员の尊严)
在source/_data/styles.css里整点花活:
/* 字体必须安排(装文艺青年必备) */
body {
font-family: \'Noto Serif SC\', \'Microsoft YaHei\', sans-serif;
}
/* 卡片悬停效果(让访客直呼卧槽) */
.card-hover:hover {
transform: translateY(-5px);
box-shadow: 0 12px 24px rgba(0,0,0,0.15);
transition: all 0.3s ease;
}
/* 自定义按钮(点我必看效果) */
.btn-custom {
background: linear-gradient(45deg, #FF7C7C, #FF5252);
border-radius: 30px;
transition: all 0.3s;
}
.btn-custom:hover {
transform: scale(1.05);
box-shadow: 0 5px 15px rgba(255, 124, 124, 0.4);
}
二、动态特效安排(逼格拉满)
2.1 背景粒子特效 ✨
在source/_data/body-end.njk塞入这段魔法:
<script>
// 粒子特效(装X神器)
particlesJS(\'page-header\', {
\"particles\": {
\"number\": {\"value\": 80},
\"color\": {\"value\": \"#FF7C7C\"},
\"line_linked\": {
\"enable\": true,
\"color\": \"#FF7C7C\"
}
},
\"interactivity\": {
\"events\": {
\"onhover\": {\"enable\": true, \"mode\": \"grab\"},
\"onclick\": {\"enable\": true, \"mode\": \"push\"}
}
}
});
</script>2.2 滚动进度条(高端玩家必备)
配置文件里开启:
# 滚动进度条(让读者知道离解脱还有多远)
scroll_progress:
enable: true
height: 3px
color: \"#FF7C7C\"三、骚操作专区(秀翻全场)
3.1 动态分类标签云 ☁️
侧边栏整点彩虹屁:
aside:
card_category:
enable: true
color: true # 开启后直接彩虹色安排3.2 文章卡片美化(让读者欲罢不能)
# 文章封面(没图说个杰宝)
index_post_cover: true
index_post_cover_position: bottom
# 图片灯箱(点开大图更刺激)
medium_zoom: true四、真·装逼功能(慎用!)
4.1 页脚音乐播放器 🎵
在页脚塞个播放器(深夜写代码必备):
footer:
custom_text: |
<div id=\"music-player\">
<audio controls style=\"width:100%\">
<source src=\"/music/good-night.mp3\" type=\"audio/mpeg\">
</audio>
</div>
<style>
#music-player {
margin-top: 20px;
background: rgba(255,255,255,0.1);
backdrop-filter: blur(10px);
padding: 10px;
border-radius: 10px;
}
</style>
4.2 右下角3D模型(装逼指数MAX)🔥
<div id=\"3d-model\" style=\"position:fixed; right:20px; bottom:20px; width:150px; height:150px; z-index:999;\"></div>
<script>
// 看不懂没关系 复制就完事了!
const scene = new THREE.Scene();
const geometry = new THREE.TorusGeometry(10, 3, 16, 100);
const torus = new THREE.Mesh(geometry, material);
scene.add(torus);
</script>五、移动端优化(防翻车指南)
/* 手机党救星 */
@media (max-width: 768px) {
#page-header {
height: 40vh !important; /* 别问 问就是适配 */
}
#3d-model {
display: none; /* 手机端直接隐藏装逼组件 */
}
}最后说几句
整完这套操作,你的博客直接芜湖起飞!但注意几个雷区:
- 特效别堆太多,不然加载慢成狗🐶
- 颜色搭配要克制,避免变身QQ空间非主流
- 移动端一定要测试!不然手机党直接裂开
友情提示:改配置前记得备份!翻车了别来找我(手动滑稽)
觉得有用的老铁们评论区扣个1,下次整个更骚的教程!💪
评论