主题魔改
主题魔改的文件放在 source/custom.css 文件中
之后在 inject 中引入即可
一图流
来源:博客魔改教程总结(一) | Fomalhaut🥝
在 custom.css
中加入以下的代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| #footer { background: transparent !important; } #page-header { background: transparent !important; }
#footer::before { background: transparent !important; } #page-header::before { background: transparent !important; }
[data-theme="dark"] #footer::before { background: transparent !important; } [data-theme="dark"] #page-header::before { background: transparent !important; }
|
之后在 inject
中加入以下代码
1 2 3
| inject: head: - <link rel="stylesheet" href="/css/custom.css" media="defer" onload="this.media='all'">
|
还需要取消 home page
的 index_img
和 footer_bg
1 2 3 4 5
| index_img:
footer_bg: false
|
之后需要设置的背景图片就可以直接以下的选项设置
1
| background: url(https://source.fomal.cc/img/home_bg.webp)
|
底部标签栏升级
来源:Add Github Badge | Akilarの糖果屋
首先是下载一个插件
1
| npm install hexo-butterfly-footer-beautify --save
|
之后直接在 _config.butterfly.yml
中添加配置文件
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
| footer_beautify: enable: timer: true bdage: true priority: 5 enable_page: all exclude: layout: type: id name: footer-wrap index: 0 runtime_js: /static/js/runtime.js runtime_css: /static/css/runtime.css swiperpara: 0 bdageitem: - link: https://hexo.io/ shields: https://img.shields.io/badge/Frame-Hexo-blue?style=flat&logo=hexo message: 博客框架为Hexo_v5.4.0 - link: https://butterfly.js.org/ shields: https://img.shields.io/badge/Theme-Butterfly-6513df?style=flat&logo=bitdefender message: 主题版本Butterfly_v3.8.2 - link: https://www.jsdelivr.com/ shields: https://img.shields.io/badge/CDN-jsDelivr-orange?style=flat&logo=jsDelivr message: 本站使用JsDelivr为静态资源提供CDN加速 - link: https://icp.gov.moe/?keyword=20232775 shields: https://img.shields.io/badge/萌ICP备案-20232775-pink?style=flat&logo=adafruit message: 萌ICP备20232775号 - link: https://github.com/ shields: https://img.shields.io/badge/Source-Github-d021d6?style=flat&logo=GitHub message: 本站项目由Github托管 - link: http://creativecommons.org/licenses/by-nc-sa/4.0/ shields: https://img.shields.io/badge/Copyright-BY--NC--SA%204.0-d42328?style=flat&logo=Claris message: 本站采用知识共享署名-非商业性使用-相同方式共享4.0国际许可协议进行许可 swiper_css: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.css swiper_js: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.js swiperbdage_init_js: https://npm.elemecdn.com/hexo-butterfly-footer-beautify/lib/swiperbdage_init.min.js
|
之后在本地引入两个文件:runtime.js
,runtime.css
其中 css 文件是为了样式
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
| setInterval(() => { let create_time = Math.round(new Date('2023-6-1 00:00:00').getTime() / 1000); let timestamp = Math.round((new Date().getTime()) / 1000); let second = timestamp - create_time; let time = new Array(0, 0, 0, 0, 0);
var nol = function (h) { return h > 9 ? h : '0' + h; } if (second >= 365 * 24 * 3600) { time[0] = parseInt(second / (365 * 24 * 3600)); second %= 365 * 24 * 3600; } if (second >= 24 * 3600) { time[1] = parseInt(second / (24 * 3600)); second %= 24 * 3600; } if (second >= 3600) { time[2] = nol(parseInt(second / 3600)); second %= 3600; } if (second >= 60) { time[3] = nol(parseInt(second / 60)); second %= 60; } if (second > 0) { time[4] = nol(second); } let runtime = "<div id='runtime'>" + '本站已经运行了'; if (time[0] > 0) { runtime += ' ' + time[0] + ' 年'; } if (time[1] > 0) { runtime += ' ' + time[1] + ' 天'; } runtime += ' ' + time[2] + ' 小时 ' + time[3] + ' 分钟 ' + time[4] + ' 秒 ! ' + '</div>'; currentTimeHtml = runtime; document.getElementById("workboard").innerHTML = currentTimeHtml; }, 1000);
|
分类磁贴
来源: Categories Magnet | Akilarの糖果屋
1
| npm install hexo-butterfly-categories-card --save
|
添加配置文件
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
|
categoryBar: enable: true priority: 5 enable_page: / layout: type: id name: recent-posts index: 0 column: odd row: 1 message: - descr: test cover: https://npm.elemecdn.com/akilar-candyassets/image/cover1.webp - descr: 玩转Win10 cover: https://npm.elemecdn.com/akilar-candyassets/image/cover2.webp - descr: 长篇小说连载 cover: https://npm.elemecdn.com/akilar-candyassets/image/cover3.webp - descr: 个人日记 cover: https://npm.elemecdn.com/akilar-candyassets/image/cover4.webp - descr: 诗词歌赋 cover: https://npm.elemecdn.com/akilar-candyassets/image/cover5.webp - descr: 杂谈教程 cover: https://npm.elemecdn.com/akilar-candyassets/image/cover6.webp custom_css: https://npm.elemecdn.com/hexo-butterfly-categories-card@1.0.0/lib/categorybar.css
|
注意其中的 descr 需要和你原本的分类标签一致,cover 也需要
文章置顶滚动栏
来源:♪(^∇^*)欢迎回来!Swiper Bar | Akilarの糖果屋
1
| npm install hexo-butterfly-swiper --save
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
swiper: enable: true priority: 5 enable_page: all timemode: date layout: type: id name: recent-posts index: 0 default_descr: 再怎么看我也不知道怎么描述它的啦! swiper_css: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.css swiper_js: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.js custom_css: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiperstyle.css custom_js: https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper_init.js
|
使用方法,在 front_matter 中配置 swiper_index
1 2 3 4 5 6 7 8
| --- title: 文章标题 date: 创建日期 updated: 更新日期 cover: 文章封面 description: 文章描述 swiper_index: 1 #置顶轮播图顺序,非负整数,数字越大越靠前 ---
|
字体个性化
来源: 博客魔改教程总结(一) | Fomalhaut🥝
1 2 3 4 5 6 7 8 9 10 11 12
| @font-face { font-family: "LXGW"; src: url(/static/font/LXGWWenKaiMonoGB-Bold.TTF); font-weight: normal; font-style: normal; font-display: block; }
|
之后修改配置文件即可
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| font: global-font-size: "15pxpx" code-font-size: "14px" font-family: LXGW,-apple-system, 'Quicksand', 'Nimbus Roman No9 L', 'PingFang SC', 'Hiragino Sans GB', 'Noto Serif SC', 'Microsoft Yahei', 'WenQuanYi Micro Hei', 'ST Heiti', sans-serif; code-font-family: Consolas_1,var(--global-font),"Microsoft YaHei",Menlo,"PingFang SC","Microsoft JhengHei",sans-serif
blog_title_font: font_link: font-family: LXGW
|
导航栏修改
1 2 3 4 5 6 7 8 9
|
#nav .menus_items { position: absolute !important; width: fit-content !important; left: 50% !important; transform: translateX(-50%) !important; font-size: x-large; }
|
文章双栏布局插件
1
| npm i hexo-butterfly-article-double-row --save
|
在 _config
中添加
1 2
| butterfly_article_double_row: enable: true
|
WOWJS 插件
1
| npm install hexo-butterfly-wowjs --save
|
主题配置文件中
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| wowjs: enable: true priority: 10 mobile: false animateitem: - class: recent-post-item style: animate__zoomIn duration: 2s delay: 1s offset: 100 iteration: 2 - class: card-widget style: animate__zoomIn animate_css: https://npm.elemecdn.com/hexo-butterfly-wowjs/lib/animate.min.css wow_js: https://npm.elemecdn.com/hexo-butterfly-wowjs/lib/wow.min.js wow_init_js: https://npm.elemecdn.com/hexo-butterfly-wowjs/lib/wow_init.js
|
黑夜霓虹灯
来源:博客魔改教程总结(一) | Fomalhaut🥝
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
|
[data-theme="light"] #site-name, [data-theme="light"] #site-title, [data-theme="light"] #site-subtitle, [data-theme="light"] #post-info { animation: none; }
[data-theme="dark"] .site-name{ animation: light_10px 10s linear infinite; } [data-theme="dark"] #site-title { animation: light_15px 10s linear infinite; } [data-theme="dark"] #site-subtitle { animation: light_10px 10s linear infinite; } [data-theme="dark"] #post-info { animation: light_5px 10s linear infinite; }
@keyframes light_15px { 0% { text-shadow: #5636ed 0 0 15px; } 12.5% { text-shadow: #11ee5e 0 0 15px; } 25% { text-shadow: #f14747 0 0 15px; } 37.5% { text-shadow: #f1a247 0 0 15px; } 50% { text-shadow: #f1ee47 0 0 15px; } 50% { text-shadow: #b347f1 0 0 15px; } 62.5% { text-shadow: #002afa 0 0 15px; } 75% { text-shadow: #ed709b 0 0 15px; } 87.5% { text-shadow: #39c5bb 0 0 15px; } 100% { text-shadow: #5636ed 0 0 15px; } }
@keyframes light_10px { 0% { text-shadow: #5636ed 0 0 10px; } 12.5% { text-shadow: #11ee5e 0 0 10px; } 25% { text-shadow: #f14747 0 0 10px; } 37.5% { text-shadow: #f1a247 0 0 10px; } 50% { text-shadow: #f1ee47 0 0 10px; } 50% { text-shadow: #b347f1 0 0 10px; } 62.5% { text-shadow: #002afa 0 0 10px; } 75% { text-shadow: #ed709b 0 0 10px; } 87.5% { text-shadow: #39c5bb 0 0 10px; } 100% { text-shadow: #5636ed 0 0 10px; } }
@keyframes light_5px { 0% { text-shadow: #5636ed 0 0 5px; } 12.5% { text-shadow: #11ee5e 0 0 5px; } 25% { text-shadow: #f14747 0 0 5px; } 37.5% { text-shadow: #f1a247 0 0 15px; } 50% { text-shadow: #f1ee47 0 0 5px; } 50% { text-shadow: #b347f1 0 0 5px; } 62.5% { text-shadow: #002afa 0 0 5px; } 75% { text-shadow: #ed709b 0 0 5px; } 87.5% { text-shadow: #39c5bb 0 0 5px; } 100% { text-shadow: #5636ed 0 0 5px; } }
|
侧边栏个人信息卡片动态渐变色
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
| #aside-content > .card-widget.card-info { background: linear-gradient( -45deg, #e8d8b9, #eccec5, #a3e9eb, #bdbdf0, #eec1ea ); box-shadow: 0 0 5px rgb(66, 68, 68); position: relative; background-size: 400% 400%; -webkit-animation: Gradient 10s ease infinite; -moz-animation: Gradient 10s ease infinite; animation: Gradient 10s ease infinite !important; } @-webkit-keyframes Gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } @-moz-keyframes Gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } @keyframes Gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
[data-theme="dark"] #aside-content > .card-widget.card-info { background: #191919ee; }
#aside-content > .card-widget.card-info > #card-info-btn { background-color: #3eb8be; border-radius: 8px; }
|
星空背景 与 页面样式美化
来源:博客魔改教程总结(一) | Fomalhaut🥝
渐变色版权美化
来源:博客魔改教程总结(一) | Fomalhaut🥝**
添加弹窗
来源:博客魔改教程总结(三) | Fomalhaut🥝
使用说明:
1 2 3 4 5 6 7 8 9 10 11 12 13
| new Vue({ data: function () { this.$notify({ title: "你已被发现😜", message: "小伙子,扒源记住要遵循GPL协议!", position: 'top-left', offset: 50, showClose: true, type: "warning", duration: 5000 }); } })
|
添加按键防抖
来源:博客魔改教程总结(三) | Fomalhaut🥝
分享链接按钮
来源:博客魔改教程总结(三) | Fomalhaut🥝
pdf插件
1
| npm install hexo-pdf --save
|
使用方法
快速添加友链
来源:友情链接快速添加 | 怕冷爱上雪 (4t.pw)