mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-10-04 06:22:00 +08:00
🎨 代碼優化
This commit is contained in:
1 parent
d2943bbbb1
commit
f4f725bb93
10 files changed
+76
-90
No files matched your search
@@ -12,6 +12,12 @@ div
|
|||||||
if theme.fancybox
|
if theme.fancybox
|
||||||
script(src=url_for(theme.CDN.fancybox))
|
script(src=url_for(theme.CDN.fancybox))
|
||||||
|
|
||||||
|
if theme.instantpage
|
||||||
|
script(src=url_for(theme.CDN.instantpage) type="module" defer)
|
||||||
|
|
||||||
|
if theme.lazyload.enable
|
||||||
|
script(src=url_for(theme.CDN.lazyload) async)
|
||||||
|
|
||||||
if theme.fireworks && theme.fireworks.enable
|
if theme.fireworks && theme.fireworks.enable
|
||||||
script(src=url_for(theme.CDN.anime))
|
script(src=url_for(theme.CDN.anime))
|
||||||
script(src=url_for(theme.CDN.fireworks))
|
script(src=url_for(theme.CDN.fireworks))
|
||||||
@@ -19,6 +25,9 @@ div
|
|||||||
if (theme.snackbar && theme.snackbar.enable)
|
if (theme.snackbar && theme.snackbar.enable)
|
||||||
script(src=url_for(theme.CDN.snackbar))
|
script(src=url_for(theme.CDN.snackbar))
|
||||||
|
|
||||||
|
if theme.pangu && theme.pangu.enable
|
||||||
|
include ./third-party/pangu.pug
|
||||||
|
|
||||||
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||||
include ./third-party/canvas-ribbon.pug
|
include ./third-party/canvas-ribbon.pug
|
||||||
|
|
||||||
@@ -35,12 +44,6 @@ div
|
|||||||
POWERMODE.shake = #{theme.activate_power_mode.shake};
|
POWERMODE.shake = #{theme.activate_power_mode.shake};
|
||||||
document.body.addEventListener('input', POWERMODE);
|
document.body.addEventListener('input', POWERMODE);
|
||||||
|
|
||||||
if theme.instantpage
|
|
||||||
script(src=url_for(theme.CDN.instantpage) type="module" defer)
|
|
||||||
|
|
||||||
if theme.lazyload.enable
|
|
||||||
script(src=url_for(theme.CDN.lazyload) async)
|
|
||||||
|
|
||||||
//- 鼠標特效
|
//- 鼠標特效
|
||||||
if theme.click_heart
|
if theme.click_heart
|
||||||
script(src=url_for(theme.CDN.click_heart) async)
|
script(src=url_for(theme.CDN.click_heart) async)
|
||||||
@@ -48,9 +51,6 @@ div
|
|||||||
if theme.ClickShowText && theme.ClickShowText.enable
|
if theme.ClickShowText && theme.ClickShowText.enable
|
||||||
script(src=url_for(theme.CDN.ClickShowText) async)
|
script(src=url_for(theme.CDN.ClickShowText) async)
|
||||||
|
|
||||||
if theme.pangu && theme.pangu.enable
|
|
||||||
include ./third-party/pangu.pug
|
|
||||||
|
|
||||||
//- search
|
//- search
|
||||||
if theme.algolia_search && theme.algolia_search.enable
|
if theme.algolia_search && theme.algolia_search.enable
|
||||||
script(src=url_for(theme.CDN.algolia_js))
|
script(src=url_for(theme.CDN.algolia_js))
|
||||||
@@ -76,15 +76,15 @@ div
|
|||||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||||
script(async src=url_for(theme.CDN.busuanzi))
|
script(async src=url_for(theme.CDN.busuanzi))
|
||||||
|
|
||||||
|
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||||
|
!=partial('includes/chat/index', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
if theme.aplayerInject && !config.aplayer.asset_inject
|
if theme.aplayerInject && !config.aplayer.asset_inject
|
||||||
if theme.pjax
|
if theme.pjax
|
||||||
include ./head/aplayer.pug
|
include ./head/aplayer.pug
|
||||||
else if page.aplayer
|
else if page.aplayer
|
||||||
include ./head/aplayer.pug
|
include ./head/aplayer.pug
|
||||||
|
|
||||||
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
|
||||||
!=partial('includes/chat/index', {}, {cache:theme.fragment_cache})
|
|
||||||
|
|
||||||
if theme.pjax
|
if theme.pjax
|
||||||
!=partial('includes/third-party/pjax', {}, {cache:theme.fragment_cache})
|
!=partial('includes/third-party/pjax', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
span=' '+label
|
span=' '+label
|
||||||
else
|
else
|
||||||
.menus_item
|
.menus_item
|
||||||
a.site-page
|
a.site-page(href='javascript:void(0);')
|
||||||
if label.split('||')[1]
|
if label.split('||')[1]
|
||||||
i.fa-fw(class=trim(label.split('||')[1]))
|
i.fa-fw(class=trim(label.split('||')[1]))
|
||||||
span=' '+ trim(label.split('||')[0])
|
span=' '+ trim(label.split('||')[0])
|
||||||
|
|||||||
@@ -7,9 +7,10 @@
|
|||||||
each item in theme.reward.QR_code
|
each item in theme.reward.QR_code
|
||||||
- var clickTo = (item.itemlist||item).link ? (item.itemlist||item).link : (item.itemlist||item).img
|
- var clickTo = (item.itemlist||item).link ? (item.itemlist||item).link : (item.itemlist||item).img
|
||||||
li.reward-item
|
li.reward-item
|
||||||
if theme.lazyload.enable
|
a(href=clickTo target='_blank')
|
||||||
img.post-qr-code-img(data-lazy-src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text onclick=`window.open('${url_for(clickTo)}')`)
|
if theme.lazyload.enable
|
||||||
else
|
img.post-qr-code-img(data-lazy-src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
|
||||||
img.post-qr-code-img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text onclick=`window.open('${url_for(clickTo)}')`)
|
else
|
||||||
|
img.post-qr-code-img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
|
||||||
.post-qr-code-desc=(item.itemlist||item).text
|
.post-qr-code-desc=(item.itemlist||item).text
|
||||||
|
|
||||||
Loaded 3 of 10 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user