mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
2. Feature: 可設置夜間模式作爲默認樣式 3. Feature: 可設置是否顯示code language名稱 4. Feature: 可設置是否展開或關閉代碼框 5. Feature: 可設置背景圖片/顔色 6. Feature: 可設置是否顯示footer背景 7. Feature: 增加 canvas-nest.js 8. Feature: 頭像可設置效果(轉圈圈) 9. Feature: menu可設置分組 9. Fix: 優化打賞和搜索打開特效 10. Fix: 優化sidebar的打開特效,避免與文章頁特效不同步 11. Fix: 適配**hexo-blog-encrypt**,現在可以顯示toc 12. Fix: 修復設置不顯示評論時,直達評論按鈕沒有消失的bug 13. Fix: 修復post頁底欄,當沒有顯示評論,不顯示TOC,評論和toc都不顯示 這三種狀態下按鈕的bug 14. Fix: 修復代碼框左右滑動時,代碼名字跟著滑動的bug 15. Fix: 其他page頁標題的字體顯示 16. Fix: 修復當設置開啓canvas_ribbons,進入網站會先顯示canvas_ribbons的bug 17. Fix: 完善夜間模式下,字體顯示問題 18. Fix: 修復代碼框 複製 和 代碼名 z-index bug #25 19. Fix: 完善阅读模式
102 lines
3.1 KiB
Plaintext
102 lines
3.1 KiB
Plaintext
if (theme.algolia_search.enable)
|
|
script(async src=url_for('/js/search/algolia.js'))
|
|
if (theme.mathjax && theme.mathjax.enable)
|
|
if(!is_tag() && !is_category() && !is_archive())
|
|
include ./third-party/mathjax.pug
|
|
if (theme.katex && theme.katex.enable)
|
|
if(!is_tag() && !is_category() && !is_archive())
|
|
include ./third-party/katex.pug
|
|
if (theme.local_search && theme.local_search.enable)
|
|
script(async src=url_for('/js/search/local-search.js'))
|
|
|
|
if theme.fireworks && theme.fireworks.enable
|
|
script(src='https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js')
|
|
script(src=url_for('/js/third-party/fireworks.js'))
|
|
|
|
if theme.nightshift.enable
|
|
script(src=url_for('js/nightshift.js'))
|
|
|
|
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
|
include ./third-party/canvas-ribbon.pug
|
|
|
|
if (theme.canvas_ribbon_piao && theme.canvas_ribbon_piao.enable)
|
|
include ./third-party/canvas-ribbon-piao.pug
|
|
|
|
if (theme.canvas_nest && theme.canvas_nest.enable)
|
|
include ./third-party/canvas-nest.pug
|
|
|
|
if theme.baidu_push && theme.baidu_push.enable
|
|
script(src=url_for('js/baidupush.js'))
|
|
|
|
if theme.activate_power_mode.enable
|
|
script(src=url_for('js/activate-power-mode.js'))
|
|
script.
|
|
POWERMODE.colorful = true; // make power mode colorful
|
|
POWERMODE.shake = true; // turn off shake
|
|
document.body.addEventListener('input', POWERMODE);
|
|
|
|
if theme.translate && theme.translate.enable
|
|
script(src=url_for('/js/tw_cn.js'))
|
|
script.
|
|
translateInitilization()
|
|
|
|
|
|
if is_home() && theme.subtitle.enable
|
|
script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9")
|
|
script.
|
|
var typed = new Typed(".subtitle", {
|
|
strings: ['!{theme.subtitle.sub1}','!{theme.subtitle.sub2}'],
|
|
startDelay: 300,
|
|
typeSpeed: 100,
|
|
loop: true,
|
|
backSpeed: 50
|
|
});
|
|
|
|
if is_home()
|
|
script.
|
|
//首頁fullpage
|
|
function alignContent() {
|
|
for (var n = $(window).height(), e = document.querySelectorAll(".full_page"), i = 0; i < e.length; i++)
|
|
e[i].style.height = n + "px";
|
|
$("#site-info").each(function () {
|
|
var x = $(this).height();
|
|
$(this).css("top", (n-x)/2)
|
|
})
|
|
}
|
|
|
|
function recent_post_padding() {
|
|
$(".recent-post-info").each(function () {
|
|
var k = $(".recent-post-item").height();
|
|
var e = $(this).height();
|
|
$(this).css({"padding-top": (k-e)/2 , "padding-bottom": (k-e)/2 })
|
|
})
|
|
}
|
|
|
|
alignContent();
|
|
|
|
//recent-post-item垂直置中
|
|
if ($(window).width() > 768) {
|
|
recent_post_padding();
|
|
}
|
|
|
|
$(window).bind("resize", function () {
|
|
|
|
alignContent()
|
|
|
|
if ($(window).width() > 768) {
|
|
recent_post_padding();
|
|
}
|
|
})
|
|
|
|
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
|
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
|
|
|
if theme.instantpage.enable
|
|
script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module")
|
|
|
|
if theme.lazyload.enable
|
|
script(src=url_for(theme.lazyload.script))
|
|
script.
|
|
const observer = lozad(); // lazy loads elements with default selector as '.lozad'
|
|
observer.observe();
|