更加细致的优化:修复页面部分问题;新增CDN优选功能,可自己配置CDN网址

v1.2.0
jinqilin721 2020-03-20 13:23:41 +08:00
parent c68a04fdc9
commit 09ebadcdd6
21 changed files with 325 additions and 205 deletions

View File

@ -51,5 +51,4 @@
空空如也
</div>
</div>
</#if>

View File

@ -1,7 +1,7 @@
<#macro comment post,type>
<#if !post.disallowComment!false>
<script src="//cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
<script src="${options.comment_internal_plugin_js!'//cdn.jsdelivr.net/gh/halo-dev/halo-comment@latest/dist/halo-comment.min.js'}"></script>
<script src="${settings.cdn_vue_js!}"></script>
<script src="${options.comment_internal_plugin_js!'//cdn.jsdelivr.net/npm/halo-comment-normal@1.1.1/dist/halo-comment.min.js'}"></script>
<halo-comment id="${post.id}" type="${type}"/>
</#if>
<style>

View File

@ -12,8 +12,8 @@
</a>
<#else>
<span class="image is-7by1">
<img class="thumbnail" src="${post.thumbnail!}" alt="${post.title!}">
</span>
<img class="thumbnail" src="${post.thumbnail!}" alt="${post.title!}">
</span>
</#if>
</div>
</#if>
@ -117,7 +117,7 @@
</#if>
</div>
</div>
<#if !index>
<#if !index && !is_sheet??>
<div class="card" style="font-size: 20px; line-height: 1.5em; padding: 5px; color: black; background-color: rgba(255, 255, 255, 0.7); border-left: 3px solid skyblue;">
<div class="card-content">
<p style="font-size: 15px;">

View File

@ -4,7 +4,7 @@
<div class="level-start has-text-centered-mobile">
<#if settings.busuanzi!true>
<p style="text-align: left; line-height: 20px; margin: 0">
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<script async src="${settings.cdn_busuanzi_js!}"></script>
<br>
<span id="busuanzi_container_site_pv" style='display:none'>总访问量 <span id="busuanzi_value_site_pv"></span> 次 </span>
<span id="busuanzi_container_site_uv" style='display:none'>| 总访客数 <span id="busuanzi_value_site_uv"></span> 人 </span>
@ -46,7 +46,7 @@
</#if>
<#if settings.social_beian?? && settings.social_beian!=''>
<p style="text-align: left; line-height: 20px;margin: 0">
<a href="http://beian.miit.gov.cn/" style="color: black;font-style: inherit;font-weight: inherit;">
<a target="_blank" href="http://beian.miit.gov.cn/" style="color: black;font-style: inherit;font-weight: inherit;">
${settings.social_beian!}
</a>
</p>
@ -57,18 +57,17 @@
</p>
</#if>
<#if settings.caidai!true>
<script src="${static!}/source/lib/caidai.js?date=${.now?string('yyyyMM')}"></script>
<script src="${static!}/source/lib/caidai.js"></script>
</#if>
<#if settings.xiantiao!true>
<script type="text/javascript"
color="47,135,193" opacity='0.8' zIndex="-2" count="100"
src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js">
src="${settings.cdn_canvas_nest_js!}">
</script>
</#if>
<#if settings.dianji!true>
<script src="${static!}/source/lib/dianji.js?date=${.now?string('yyyyMM')}"></script>
<script src="${static!}/source/lib/dianji.js"></script>
</#if>
</p>
<@global.footer />
</div>
<div class="level-end">

View File

@ -16,8 +16,7 @@
<div class="blog-slider__item swiper-slide">
<div class="blog-slider__img">
<a href="${context!}/archives/${post.url!}">
<img src="${post.thumbnail!}"
alt="${post.title!}">
<img src="${post.thumbnail!}" alt="${post.title!}">
</a>
</div>
<div class="blog-slider__content">
@ -34,7 +33,7 @@
</div>
<!-- partial -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.5/js/swiper.min.js'></script>
<script src='${settings.cdn_jquery_js!}'></script>
<script src='${settings.cdn_swiper_js!}'></script>
</#if>
</#macro>

View File

@ -10,14 +10,13 @@
</#if>
</a>
<span class="navbar-burger burger" data-target="navMenu">
<span></span>
<span></span>
<span></span>
</span>
<span></span>
<span></span>
<span></span>
</span>
</div>
<div id="navMenu" class="navbar-menu transparent">
<div class="navbar-start transparent">
<@menuTag method="tree">
<#if menus?? && menus?size gt 0>
<#if settings.tree_menu_enable!false>
@ -26,48 +25,46 @@
<#if menu.children?? && menu.children?size gt 0>
<div class="navbar-item has-dropdown is-hoverable">
<a class="sub-menu">
${menu.name!}
<i class="${menu.icon!}" aria-hidden="true"></i>${menu.name!}
</a>
<div class="navbar-dropdown is-boxed">
<#list menu.children as child>
<a class="navbar-item"
href="${child.url!}">
${child.name!}
<a class="navbar-item" target="${child.target!'_self'}" href="${child.url!}">
<i class="${child.icon!}" aria-hidden="true"></i>&nbsp;${child.name!}
</a>
</#list>
</div>
</div>
<#else>
<a class="navbar-item" href="${menu.url}"
target="${menu.target!}">${menu.name}</a>
<a class="navbar-item" href="${menu.url!}" target="${menu.target!'_self'}"><i class="${menu.icon!}" aria-hidden="true"></i>${menu.name!}</a>
</#if>
</#list>
</div>
<#else>
<#if menus?? && menus?size gt 0>
<div class="navbar-start">
<#list menus?sort_by('priority') as menu>
<a class="navbar-item" href="${menu.url}"
target="${menu.target!}">${menu.name}</a>
<a class="navbar-item" href="${menu.url!}" target="${menu.target!'_self'}"><i class="${menu.icon!}" aria-hidden="true"></i>${menu.name!}</a>
</#list>
</div>
</#if> </#if>
</#if>
</#if>
</#if>
</@menuTag>
</div>
<div class="navbar-end">
<#-- ${settings.links_top!}-->
<#-- <a class="navbar-item search" title="夜间模式" href="javascript:alert('开发中,敬请期待');">-->
<#-- <i class="fas fa-adjust"></i>-->
<#-- </a>-->
<#--${settings.links_top!}
<a class="navbar-item search" title="夜间模式" href="javascript:alert('开发中,敬请期待');">
<i class="fas fa-adjust"></i>
</a>-->
<a class="navbar-item search" title="文章搜索" onclick="openSearchPanel()" href="javascript:;">
<i class="fas fa-search"></i>
</a>
</div>
</div>
</div>
</nav>
<style>
</style>
@ -79,8 +76,6 @@
burger.classList.toggle('is-active');
menu.classList.toggle('is-active');
});
})();
</script>
</#macro>
</#macro>

View File

@ -1,17 +1,14 @@
<#--<script src="//cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>-->
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="${settings.cdn_jquery_js!}"></script>
<#include "../plugin/gallery.ftl">
<#include "../plugin/outdated-browser.ftl">
<#include "../plugin/mathjax.ftl">
<#include "../plugin/back-to-top.ftl">
<script src="${static!}/source/js/bundle.js"></script>
<#if is_index??>
<script src="${static!}/source/js/widget_pin.js"></script>
</#if>
<#if is_post??>
<script src="${static!}/source/lib/toc/toc.min.js"></script>
<script>
new Toc({
@ -36,6 +33,4 @@
if (!urlstatus) {
$(".navbar-start a").eq(0).addClass('is-active');
}
</script>

View File

@ -1,63 +1,63 @@
<#macro widget position>
<#if is_post?? || is_sheet?? >
<div class="column is-4-tablet is-3-desktop is-3-widescreen is-3-fullhd <#if position=='right'>is-hidden-touch </#if> <#if position == 'left'>has-order-1<#else>has-order-3</#if> column-${position} <%= sticky_class(position) %>">
<#if is_post?? || is_sheet?? >
<div class="column is-4-tablet is-3-desktop is-3-widescreen is-3-fullhd <#if position=='right'>is-hidden-touch </#if> <#if position == 'left'>has-order-1<#else>has-order-3</#if> column-${position} <%= sticky_class(position) %>">
<#elseif is_index??>
<div class="column is-4-tablet is-4-desktop <#if position=='right'>is-hidden-touch is-hidden-desktop-only is-4-widescreen is-4-fullhd <#else>is-3-widescreen</#if> <#if position == 'left'>has-order-1<#else>has-order-3</#if> column-${position} <%= sticky_class(position) %>">
<#else >
<div class="column is-4-tablet is-4-desktop <#if position=='right'>is-hidden-touch is-hidden-desktop-only is-4-widescreen is-4-fullhd <#else>is-3-widescreen</#if> <#if position == 'left'>has-order-1<#else>has-order-3</#if> column-${position} <%= sticky_class(position) %>">
<#else>
<div class="column is-4-tablet is-4-desktop is-3-widescreen is-3-fullhd <#if position=='right'>is-hidden-touch is-hidden-desktop-only</#if> <#if position == 'left'>has-order-1<#else>has-order-3</#if> column-${position} <%= sticky_class(position) %>">
</#if>
<#if position == 'left'>
<#if settings.sidebar_profile!true>
<#include "../widget/profile.ftl">
</#if>
<#if settings.music!true>
<div class="card"
style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); padding: 5px; backgroud-color: white">
<link rel="stylesheet" href="${settings.cdn_aplayer_css!}">
<script src="${settings.cdn_aplayer_js!}"></script>
<div id="aplayer" class="aplayer" data-id="${settings.music_id!}" data-server="netease"
data-type="playlist"
data-fixed="false" data-listfolded="true" data-order="list" data-theme="#F58EA8" style="width: 100%"></div>
<script src="${settings.cdn_meting_js!}"></script>
</div>
</#if>
<#if settings.sidebar_categories!true>
<#include "../widget/category.ftl">
</#if>
<#if settings.sidebar_tagcloud!true>
<#include "../widget/tagcloud.ftl">
</#if>
<#if settings.sidebar_links!true>
<#include "../widget/links.ftl">
</#if>
</#if>
<#if position == 'right'>
<#if post??>
<#include "../widget/cate_posts.ftl">
<#include "../widget/tag_posts.ftl">
<#include "../widget/toc-post.ftl">
<#else>
<#if settings.sidebar_recentpost!true>
<#include "../widget/recent_posts.ftl">
</#if>
<#if position == 'left'>
<#if settings.sidebar_profile!true>
<#include "../widget/profile.ftl">
</#if>
<#if settings.music!true>
<div class="card"
style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); padding: 5px; backgroud-color: white">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script>
<div id="aplayer" class="aplayer" data-id="${settings.music_id!}" data-server="netease"
data-type="playlist"
data-fixed="false" data-listfolded="true" data-order="list" data-theme="#F58EA8" style="width: 100%"></div>
<script src="https://unpkg.com/meting@1.2/dist/Meting.min.js"></script>
</div>
</#if>
<#if settings.sidebar_categories!true>
<#include "../widget/category.ftl">
</#if>
<#if settings.sidebar_tagcloud!true>
<#include "../widget/tagcloud.ftl">
</#if>
<#if settings.sidebar_links!true>
<#include "../widget/links.ftl">
</#if>
</#if>
<#if settings.sidebar_recentcomment!true>
<#include "../widget/recent_comments.ftl">
</#if>
</#if>
<#if position == 'left'>
<div class="column-right-shadow is-hidden-widescreen is-6-fullhd ">
<#if settings.sidebar_recentpost!true>
<#include "../widget/recent_posts.ftl">
</#if>
<#if position == 'right'>
<#if post??>
<#include "../widget/cate_posts.ftl">
<#include "../widget/tag_posts.ftl">
<#include "../widget/toc-post.ftl">
<#else>
<#if settings.sidebar_recentpost!true>
<#include "../widget/recent_posts.ftl">
</#if>
</#if>
<#if settings.sidebar_recentcomment!true>
<#include "../widget/recent_comments.ftl">
</#if>
<#if settings.sidebar_recentcomment!true>
<#include "../widget/recent_comments.ftl">
</#if>
<#if position == 'left'>
<div class="column-right-shadow is-hidden-widescreen is-6-fullhd ">
<#if settings.sidebar_recentpost!true>
<#include "../widget/recent_posts.ftl">
</#if>
<#if settings.sidebar_recentcomment!true>
<#include "../widget/recent_comments.ftl">
</#if>
<#-- <#include "../widget/archive.ftl">-->
<#if settings.sidebar_tags!true>
<#include "../widget/tag.ftl">
</#if>
</div>
<#-- <#include "../widget/archive.ftl">-->
<#if settings.sidebar_tags!true>
<#include "../widget/tag.ftl">
</#if>
</div>
</#macro>
</#if>
</div>
</#macro>

View File

@ -15,6 +15,6 @@
<div class="blog-slider__pagination"></div>
</div>
<!-- partial -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.5/js/swiper.min.js'></script>
<script src='${settings.cdn_jquery_js!}'></script>
<script src='${settings.cdn_swiper_js!}'></script>

View File

@ -29,9 +29,9 @@
<@global.head />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bulma@0.7.5/css/bulma.min.css">
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.4.1/css/all.css">
<link href="https://fonts.googleapis.com/css?family=Fira+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" href="${settings.cdn_bulma_css!}">
<link rel="stylesheet" href="${settings.cdn_fontawesome_css!}">
<link href="${settings.cdn_google_fonts!}/css?family=Fira+Sans&display=swap" rel="stylesheet">
<style>
body > .footer,
body > .navbar,
@ -65,11 +65,11 @@
</#if>
<#if is_post?? || is_sheet?? || is_journal??>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">
<link rel="stylesheet" href="${settings.cdn_lightgallery_css!}">
<link rel="stylesheet" href="${settings.cdn_justifiedGallery_css!}">
</#if>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">
<script src="//cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
<link rel="stylesheet" href="${settings.cdn_outdatedbrowser_css!}">
<script src="${settings.cdn_pace_js!}"></script>
<link rel="stylesheet" href="${static!}/source/css/style.css">
<link rel="stylesheet" href="${static!}/source/css/bundle.css">
@ -81,7 +81,7 @@
</#if>
<#if is_index??>
<link rel="stylesheet" href="${static!}/source/css/widget_pin.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.5/css/swiper.min.css">
<link rel="stylesheet" href="${settings.cdn_swiper_css!}">
</#if>
<#if settings.kanbanniang!true>
@ -93,7 +93,7 @@
<div class="card-normal">
<section class="section">
<div class="container">
<div class="columns">
<div class="columns"><#--<#if is_sheet??>is-centered</#if>-->
<#if post?? >
<#if is_post??>
<#if settings.share_type !=''>
@ -104,9 +104,10 @@
</div>
<@widget 'right' />
<#elseif is_sheet??>
<div class="column is-12-tablet is-12-desktop is-12-widescreen is-12-fullhd has-order-2 column-main">
<div class="column is-12-tablet is-9-desktop is-9-widescreen is-9-fullhd has-order-3 column-main">
<#nested />
</div>
<@widget 'right' />
</#if>
<#else >
<#if is_index??>

View File

@ -1,4 +1,4 @@
<#if is_post?? || is_sheet??>
<script src="//cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
<script src="//cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
<script src="${settings.cdn_lightgallery_js!}" defer></script>
<script src="${settings.cdn_justifiedGallery_js!}" defer></script>
</#if>

View File

@ -1,24 +1,24 @@
<#if (is_post?? || is_sheet??) && settings.mathjax_enable!false>
<script src="//cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script src="${settings.cdn_mathjax_js!}" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
MathJax.Hub.Config({
'HTML-CSS': {
matchFontHeight: false
},
SVG: {
matchFontHeight: false
},
CommonHTML: {
matchFontHeight: false
},
tex2jax: {
inlineMath: [
['$','$'],
['\\(','\\)']
]
}
document.addEventListener('DOMContentLoaded', function () {
MathJax.Hub.Config({
'HTML-CSS': {
matchFontHeight: false
},
SVG: {
matchFontHeight: false
},
CommonHTML: {
matchFontHeight: false
},
tex2jax: {
inlineMath: [
['$', '$'],
['\\(', '\\)']
]
}
});
});
});
</script>
</#if>

View File

@ -4,13 +4,13 @@
my browser now </a></p>
<p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="//cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer>
<script src="${settings.cdn_outdatedbrowser_js!}" defer></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
outdatedBrowser({
bgColor: '#f25648',
color: '#ffffff',
lowerThan: 'flex'
lowerThan: 'object-fit' // display on IE11 or below
});
});
</script>

View File

@ -5,8 +5,8 @@
</a>
</#if>
</div>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css">
<script src="//cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>
<link rel="stylesheet" href="${settings.cdn_share_css!}">
<script src="${settings.cdn_share_js!}"></script>
<style>
<#if is_post??>
.social-share a {

View File

@ -1,8 +1,7 @@
<div>
<div id="toc"></div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="${settings.cdn_jquery_js!}"></script>
<script>
// initToc()
// function initToc() {
@ -103,7 +102,7 @@
createPostDirectory(document.getElementById('post-article'), document.getElementById('toc'), false);
};
//建立关联关系
//建立关联关系
function initRelationship() {
var win = $(window);
var anchors = $('#toc').find('a');
@ -123,13 +122,11 @@
}
})
})
}
postDirectoryBuild();
initRelationship();
var dir = $("#toc");
var postdiv = $(".article-content");
var offsetLength = dir.offset().top
@ -168,8 +165,8 @@
}
})
})
}
function tocFixed() {
var dir = $("#toc");
var postdiv = $(".article-content");
@ -189,7 +186,6 @@
}
});
}
</script>
<style>
#toc {
@ -221,7 +217,6 @@
width: 3px;
opacity: .2;
z-index: 1;
}
#toc li, #toc ul {
@ -235,7 +230,6 @@
position: relative;
}
#toc > ul li::before {
position: relative;
top: 0;
@ -277,7 +271,6 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#toc ul li ul li a {
@ -301,8 +294,6 @@
width: 200px;
}
.directory-fixed {
position: fixed;
top: 0rem;

View File

@ -36,8 +36,8 @@
</p>
<div class="content">
<div class="post-comment-wrap">
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/halo-comment-normal@1.1.1/dist/halo-comment.min.js"></script>
<script src="${settings.cdn_vue_js!}"></script>
<script src="${options.comment_internal_plugin_js!'//cdn.jsdelivr.net/npm/halo-comment-normal@1.1.1/dist/halo-comment.min.js'}"></script>
<script>
// var configs = {
// autoLoad: true,

View File

@ -25,13 +25,13 @@
<@global.head />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bulma@0.7.5/css/bulma.min.css">
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.4.1/css/all.css">
<link rel="stylesheet" href="${settings.cdn_bulma_css!}">
<link rel="stylesheet" href="${settings.cdn_fontawesome_css!}">
<#include "layout/plugin/style.theme.ftl">
<link rel="stylesheet"
href="//cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">
href="${settings.cdn_outdatedbrowser_css!}">
<link rel="stylesheet" href="${static!}/source/css/style.css">
<link rel="stylesheet" href="${static!}/source/css/bundle.css">

View File

@ -366,4 +366,138 @@ custom_links:
</a>
</p>'
custom_cdn:
label: CDN优选
items:
cdn_google_fonts:
name: cdn_google_fonts
label: Google Fonts
type: text
default: 'https://fonts.googleapis.com'
placeholder: 'CDN网址'
cdn_jquery_js:
name: cdn_jquery_js
label: jQuery
type: text
default: '//cdn.bootcss.com/jquery/3.4.1/jquery.min.js'
placeholder: 'CDN网址'
cdn_fontawesome_css:
name: cdn_fontawesome_css
label: fontawesome-css(Font Awesome图标字体库)
type: text
default: '//cdn.bootcss.com/font-awesome/5.4.1/css/all.min.css'
placeholder: 'CDN网址'
cdn_busuanzi_js:
name: cdn_busuanzi_js
label: busuanzi(不蒜子网页计数器)
type: text
default: '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js'
placeholder: 'CDN网址'
cdn_canvas_nest_js:
name: cdn_canvas_nest_js
label: canvas-nest(线条)
type: text
default: '//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js'
placeholder: 'CDN网址'
cdn_bulma_css:
name: cdn_bulma_css
label: bulma-css(Bulma框架)
type: text
default: '//cdn.jsdelivr.net/npm/bulma@0.7.5/css/bulma.min.css'
placeholder: 'CDN网址'
cdn_outdatedbrowser_js:
name: cdn_outdatedbrowser_js
label: outdatedbrowser-js(浏览器兼容性提示插件)
type: text
default: '//cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js'
placeholder: 'CDN网址'
cdn_outdatedbrowser_css:
name: cdn_outdatedbrowser_css
label: outdatedbrowser-css(浏览器兼容性提示插件)
type: text
default: '//cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css'
placeholder: 'CDN网址'
cdn_pace_js:
name: cdn_pace_js
label: pace-js(浏览器加载效果插件)
type: text
default: '//cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js'
placeholder: 'CDN网址'
cdn_vue_js:
name: cdn_vue_js
label: vue-js(VUE框架评论模块用)
type: text
default: '//cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js'
placeholder: 'CDN网址'
cdn_swiper_js:
name: cdn_swiper_js
label: Swiper-js(触摸滑动插件)
type: text
default: '//cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.5/js/swiper.min.js'
placeholder: 'CDN网址'
cdn_swiper_css:
name: cdn_swiper_css
label: Swiper-css(触摸滑动插件)
type: text
default: '//cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.5/css/swiper.min.css'
placeholder: 'CDN网址'
cdn_mathjax_js:
name: cdn_mathjax_js
label: MathJax(数学公式支持插件)
type: text
default: '//cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML'
placeholder: 'CDN网址'
cdn_aplayer_js:
name: cdn_aplayer_js
label: APlayer-js(音乐播放器)
type: text
default: '//cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js'
placeholder: 'CDN网址'
cdn_aplayer_css:
name: cdn_aplayer_css
label: APlayer-css(音乐播放器)
type: text
default: '//cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css'
placeholder: 'CDN网址'
cdn_meting_js:
name: cdn_meting_js
label: Meting-js(音乐播放器)
type: text
default: '//cdn.jsdelivr.net/npm/meting@1.2.0/dist/Meting.min.js'
placeholder: 'CDN网址'
cdn_justifiedGallery_js:
name: cdn_justifiedGallery_js
label: Justified Gallery-js(相册展示插件)
type: text
default: '//cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.js'
placeholder: 'CDN网址'
cdn_justifiedGallery_css:
name: cdn_justifiedGallery_css
label: Justified Gallery-css(相册展示插件)
type: text
default: '//cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css'
placeholder: 'CDN网址'
cdn_lightgallery_js:
name: cdn_lightgallery_js
label: lightgallery-js(灯箱插件)
type: text
default: '//cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js'
placeholder: 'CDN网址'
cdn_lightgallery_css:
name: cdn_lightgallery_css
label: lightgallery-css(灯箱插件)
type: text
default: '//cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css'
placeholder: 'CDN网址'
cdn_share_js:
name: cdn_share_js
label: social-share-js(文章分享)
type: text
default: '//cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js'
placeholder: 'CDN网址'
cdn_share_css:
name: cdn_share_css
label: social-share-css(文章分享)
type: text
default: '//cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css'
placeholder: 'CDN网址'

View File

@ -9,8 +9,8 @@
});
document.querySelector('body > .navbar').style.transform = 'translateY(-100px)';
['.column-main > .card',
'.column-left > .card, .column-right-shadow > .card',
'.column-right > .card'].map(function (selector) {
'.column-left > .card, .column-right-shadow > .card',
'.column-right > .card'].map(function (selector) {
$(selector).forEach(function (element) {
element.style.transition = '0s';
element.style.opacity = '0';
@ -25,8 +25,8 @@
});
document.querySelector('body > .navbar').style.transform = 'translateY(0)';
['.column-main > .card',
'.column-left > .card, .column-right-shadow > .card',
'.column-right > .card'].map(function (selector) {
'.column-left > .card, .column-right-shadow > .card',
'.column-right > .card'].map(function (selector) {
var i = 1;
$(selector).forEach(function (element) {
setTimeout(function () {

View File

@ -1,9 +1,17 @@
var swiper = new Swiper('.blog-slider', {
spaceBetween: 30,
effect: 'fade',
// autoHeight: true,
pagination: {
autoplay: {
delay: 3000,
stopOnLastSlide: false,
disableOnInteraction: true,
},
spaceBetween: 30,
effect: 'fade',
mousewheel: {
invert: false,
},
// autoHeight: true,
pagination: {
el: '.blog-slider__pagination',
clickable: true,
}
});
}
});

View File

@ -1,80 +1,79 @@
(function(window,document,undefined){
(function (window, document, undefined) {
var hearts = [];
window.requestAnimationFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback){
setTimeout(callback,1000/60);
}
window.requestAnimationFrame = (function () {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback) {
setTimeout(callback, 1000 / 60);
}
})();
init();
function init(){
function init() {
css(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: absolute;}.heart:after{top: -5px;}.heart:before{left: -5px;}");
attachEvent();
gameloop();
}
function gameloop(){
for(var i=0;i<hearts.length;i++){
if(hearts[i].alpha <=0){
function gameloop() {
for (var i = 0; i < hearts.length; i++) {
if (hearts[i].alpha <= 0) {
document.body.removeChild(hearts[i].el);
hearts.splice(i,1);
hearts.splice(i, 1);
continue;
}
}
hearts[i].y--;
hearts[i].scale += 0.004;
hearts[i].alpha -= 0.013;
hearts[i].el.style.cssText = "left:"+hearts[i].x+"px;top:"+hearts[i].y+"px;opacity:"+hearts[i].alpha+";transform:scale("+hearts[i].scale+","+hearts[i].scale+") rotate(45deg);background:"+hearts[i].color;
hearts[i].y--;
hearts[i].scale += 0.004;
hearts[i].alpha -= 0.013;
hearts[i].el.style.cssText = "left:" + hearts[i].x + "px;top:" + hearts[i].y + "px;opacity:" + hearts[i].alpha + ";transform:scale(" + hearts[i].scale + "," + hearts[i].scale + ") rotate(45deg);background:" + hearts[i].color;
}
requestAnimationFrame(gameloop);
}
function attachEvent(){
var old = typeof window.onclick==="function" && window.onclick;
window.onclick = function(event){
function attachEvent() {
var old = typeof window.onclick === "function" && window.onclick;
window.onclick = function (event) {
old && old();
createHeart(event);
}
}
function createHeart(event){
function createHeart(event) {
var d = document.createElement("div");
d.className = "heart";
hearts.push({
el : d,
x : event.clientX - 5,
y : event.clientY - 5,
scale : 1,
alpha : 1,
color : randomColor()
el: d,
x: event.clientX - 5,
y: event.clientY - 5,
scale: 1,
alpha: 1,
color: randomColor()
});
document.body.appendChild(d);
}
function css(css){
function css(css) {
var style = document.createElement("style");
style.type="text/css";
try{
style.type = "text/css";
try {
style.appendChild(document.createTextNode(css));
}
catch(ex){
} catch (ex) {
style.styleSheet.cssText = css;
}
document.getElementsByTagName('head')[0].appendChild(style);
}
function randomColor(){
return "rgb("+(~~(Math.random()*255))+","+(~~(Math.random()*255))+","+(~~(Math.random()*255))+")";
function randomColor() {
return "rgb(" + (~~(Math.random() * 255)) + "," + (~~(Math.random() * 255)) + "," + (~~(Math.random() * 255)) + ")";
}
})(window,document);
})(window, document);