hexo-theme-ayer
Advanced tools
Comparing version 1.8.16 to 1.8.17
{ | ||
"name": "hexo-theme-ayer", | ||
"version": "1.8.16", | ||
"version": "1.8.17", | ||
"description": "a clean and elegant theme for hexo.", | ||
@@ -32,4 +32,3 @@ "scripts": { | ||
"cssnano": "^4.1.10", | ||
"parcel-bundler": "^1.12.4", | ||
"parcel-plugin-bundle-visualiser": "^1.2.0", | ||
"parcel-bundler": "^1.12.5", | ||
"postcss-modules": "^1.5.0", | ||
@@ -36,0 +35,0 @@ "stylint": "^2.0.0" |
(function ($) { | ||
// Search | ||
let $searchWrap = $('.search-form-wrap'), | ||
let $searchWrap = $(".search-form-wrap"), | ||
isSearchAnim = false, | ||
@@ -18,8 +18,8 @@ searchAnimDuration = 200; | ||
$('.nav-item-search').click(() => { | ||
$(".nav-item-search").click(() => { | ||
if (isSearchAnim) return; | ||
startSearchAnim(); | ||
$searchWrap.addClass('on'); | ||
$searchWrap.addClass("on"); | ||
stopSearchAnim(function () { | ||
$('.local-search-input').focus(); | ||
$(".local-search-input").focus(); | ||
}); | ||
@@ -29,12 +29,12 @@ }); | ||
$(document).mouseup((e) => { | ||
const _con = $('.local-search'); | ||
const _con = $(".local-search"); | ||
if (!_con.is(e.target) && _con.has(e.target).length === 0) { | ||
$searchWrap.removeClass('on'); | ||
$searchWrap.removeClass("on"); | ||
} | ||
}); | ||
// 建议在移动端不初始化,其实 /search.xml 文件还挺大的, | ||
if ($('.local-search').size()) { | ||
$.getScript('/js/search.js', function () { | ||
searchFunc("/search.xml", 'local-search-input', 'local-search-result'); | ||
// Not recommended in mobile, /search.xml is actually large. | ||
if ($(".local-search").size()) { | ||
$.getScript("/js/search.js", function () { | ||
searchFunc("/search.xml", "local-search-input", "local-search-result"); | ||
}); | ||
@@ -61,18 +61,24 @@ } | ||
any: function () { | ||
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); | ||
} | ||
return ( | ||
isMobile.Android() || | ||
isMobile.BlackBerry() || | ||
isMobile.iOS() || | ||
isMobile.Opera() || | ||
isMobile.Windows() | ||
); | ||
}, | ||
}; | ||
// Share | ||
$('.share-outer').click(() => $('.share-wrap').fadeToggle()) | ||
$(".share-outer").click(() => $(".share-wrap").fadeToggle()); | ||
// Lazyload | ||
$("img.lazy").lazyload({ | ||
effect: "fadeIn" | ||
effect: "fadeIn", | ||
}); | ||
// JustifiedGallery | ||
$('#gallery').justifiedGallery({ | ||
$("#gallery").justifiedGallery({ | ||
rowHeight: 200, | ||
margins: 5 | ||
margins: 5, | ||
}); | ||
@@ -82,5 +88,5 @@ | ||
$(document).ready(function ($) { | ||
$('.anchor').click(function (e) { | ||
$(".anchor").click(function (e) { | ||
e.preventDefault(); | ||
$('main').animate({ scrollTop: $('.cover').height() }, 'smooth'); | ||
$("main").animate({ scrollTop: $(".cover").height() }, "smooth"); | ||
}); | ||
@@ -96,3 +102,3 @@ }); | ||
// Our scroll link element | ||
const scrollElem = $('#totop'); | ||
const scrollElem = $("#totop"); | ||
@@ -104,6 +110,6 @@ // Scroll to top speed | ||
scrollElem.hide(); | ||
$('.content').scroll(function () { | ||
const scrollTop = $('.content').scrollTop(); | ||
$(".content").scroll(function () { | ||
const scrollTop = $(".content").scrollTop(); | ||
if (scrollTop > upperLimit) { | ||
$(scrollElem).stop().fadeTo(200, .6); // fade back in | ||
$(scrollElem).stop().fadeTo(200, 0.6); // fade back in | ||
} else { | ||
@@ -116,3 +122,4 @@ $(scrollElem).stop().fadeTo(200, 0); // fade out | ||
$(scrollElem).click(function () { | ||
$('.content').animate({ scrollTop: 0 }, scrollSpeed); return false; | ||
$(".content").animate({ scrollTop: 0 }, scrollSpeed); | ||
return false; | ||
}); | ||
@@ -122,54 +129,54 @@ })(); | ||
// Mobile Nav | ||
const $content = $('.content'), | ||
$sidebar = $('.sidebar'); | ||
const $content = $(".content"), | ||
$sidebar = $(".sidebar"); | ||
$('.navbar-toggle').on('click', function () { | ||
$('.content,.sidebar').addClass('anim') | ||
$content.toggleClass('on'); | ||
$sidebar.toggleClass('on'); | ||
$(".navbar-toggle").on("click", function () { | ||
$(".content,.sidebar").addClass("anim"); | ||
$content.toggleClass("on"); | ||
$sidebar.toggleClass("on"); | ||
}); | ||
// Reward | ||
$('#reward-btn').click(() => { | ||
$('#reward').fadeIn(150) | ||
$('#mask').fadeIn(150) | ||
$("#reward-btn").click(() => { | ||
$("#reward").fadeIn(150); | ||
$("#mask").fadeIn(150); | ||
}); | ||
$('#reward .close, #mask').click(() => { | ||
$('#mask').fadeOut(100) | ||
$('#reward').fadeOut(100) | ||
}) | ||
$("#reward .close, #mask").click(() => { | ||
$("#mask").fadeOut(100); | ||
$("#reward").fadeOut(100); | ||
}); | ||
// DarkMode | ||
if (sessionStorage.getItem('darkmode') == 1) { | ||
$('body').addClass('darkmode') | ||
$('#todark i').removeClass('ri-moon-line').addClass('ri-sun-line') | ||
if (sessionStorage.getItem("darkmode") == 1) { | ||
$("body").addClass("darkmode"); | ||
$("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line"); | ||
} else { | ||
$('body').removeClass('darkmode') | ||
$('#todark i').removeClass('ri-sun-line').addClass('ri-moon-line') | ||
$("body").removeClass("darkmode"); | ||
$("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"); | ||
} | ||
$('#todark').click(() => { | ||
if (sessionStorage.getItem('darkmode') == 1) { | ||
$('body').removeClass('darkmode') | ||
$('#todark i').removeClass('ri-sun-line').addClass('ri-moon-line') | ||
sessionStorage.removeItem('darkmode') | ||
$("#todark").click(() => { | ||
if (sessionStorage.getItem("darkmode") == 1) { | ||
$("body").removeClass("darkmode"); | ||
$("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"); | ||
sessionStorage.removeItem("darkmode"); | ||
} else { | ||
$('body').addClass('darkmode') | ||
$('#todark i').removeClass('ri-moon-line').addClass('ri-sun-line') | ||
sessionStorage.setItem('darkmode', 1) | ||
$("body").addClass("darkmode"); | ||
$("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line"); | ||
sessionStorage.setItem("darkmode", 1); | ||
} | ||
}) | ||
}); | ||
// showThemeInConsole | ||
const ayerInfo = '主题不错?⭐star 支持一下 ->'; | ||
const ayerURL = 'https://github.com/Shen-Yu/hexo-theme-ayer'; | ||
// ShowThemeInConsole | ||
const ayerInfo = "主题不错?⭐star 支持一下 ->"; | ||
const ayerURL = "https://github.com/Shen-Yu/hexo-theme-ayer"; | ||
const ayerNameStr = | ||
'\n\n _ __ _______ _____ \n / \\ \\ \\ / / ____| _ \\ \n / _ \\ \\ V /| _| | |_) | \n / ___ \\ \| | | |___| _ < \n /_/ \\_\\ _| |_____|_| \\__\\ \n'; | ||
"\n\n _ __ _______ _____ \n / \\ \\ \\ / / ____| _ \\ \n / _ \\ \\ V /| _| | |_) | \n / ___ \\ | | | |___| _ < \n /_/ \\_\\ _| |_____|_| \\__\\ \n"; | ||
const ayerInfoStyle = | ||
'background-color: #49b1f5; color: #fff; padding: 8px; font-size: 14px;'; | ||
"background-color: #49b1f5; color: #fff; padding: 8px; font-size: 14px;"; | ||
const ayerURLStyle = | ||
'background-color: #ffbca2; padding: 8px; font-size: 14px;'; | ||
const ayerNameStyle = 'background-color: #eaf8ff;'; | ||
"background-color: #ffbca2; padding: 8px; font-size: 14px;"; | ||
const ayerNameStyle = "background-color: #eaf8ff;"; | ||
console.log( | ||
'%c%s%c%s%c%s', | ||
"%c%s%c%s%c%s", | ||
ayerInfoStyle, | ||
@@ -182,5 +189,29 @@ ayerInfo, | ||
); | ||
document.write('<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>'); | ||
})(jQuery); | ||
// Tracking | ||
!(function (p) { | ||
"use strict"; | ||
!(function (t) { | ||
var s = window, | ||
e = document, | ||
i = p, | ||
c = "".concat( | ||
"https:" === e.location.protocol ? "https://" : "http://", | ||
"sdk.51.la/js-sdk-pro.min.js" | ||
), | ||
n = e.createElement("script"), | ||
r = e.getElementsByTagName("script")[0]; | ||
(n.type = "text/javascript"), | ||
n.setAttribute("charset", "UTF-8"), | ||
(n.async = !0), | ||
(n.src = c), | ||
(n.id = "LA_COLLECT"), | ||
(i.d = n); | ||
var o = function () { | ||
s.LA.ids.push(i); | ||
}; | ||
s.LA ? s.LA.ids && o() : ((s.LA = p), (s.LA.ids = []), o()), | ||
r.parentNode.insertBefore(n, r); | ||
})(); | ||
})({ id: "JGjrOr2rebvP6q2a", ck: "JGjrOr2rebvP6q2a" }); |
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"MiQR":[function(require,module,exports) { | ||
},{}],"jSg4":[function(require,module,exports) { | ||
!function(e){var o=e(".search-form-wrap"),a=!1;e(".nav-item-search").click(function(){var s;a||(a=!0,o.addClass("on"),s=function(){e(".local-search-input").focus()},setTimeout(function(){a=!1,s&&s()},200))}),e(document).mouseup(function(a){var s=e(".local-search");s.is(a.target)||0!==s.has(a.target).length||o.removeClass("on")}),e(".local-search").size()&&e.getScript("/js/search.js",function(){searchFunc("/search.xml","local-search-input","local-search-result")});var s;e(".share-outer").click(function(){return e(".share-wrap").fadeToggle()}),e("img.lazy").lazyload({effect:"fadeIn"}),e("#gallery").justifiedGallery({rowHeight:200,margins:5}),e(document).ready(function(e){e(".anchor").click(function(o){o.preventDefault(),e("main").animate({scrollTop:e(".cover").height()},"smooth")})}),(s=e("#totop")).hide(),e(".content").scroll(function(){e(".content").scrollTop()>1e3?e(s).stop().fadeTo(200,.6):e(s).stop().fadeTo(200,0)}),e(s).click(function(){return e(".content").animate({scrollTop:0},1e3),!1});var n=e(".content"),r=e(".sidebar");e(".navbar-toggle").on("click",function(){e(".content,.sidebar").addClass("anim"),n.toggleClass("on"),r.toggleClass("on")}),e("#reward-btn").click(function(){e("#reward").fadeIn(150),e("#mask").fadeIn(150)}),e("#reward .close, #mask").click(function(){e("#mask").fadeOut(100),e("#reward").fadeOut(100)}),1==sessionStorage.getItem("darkmode")?(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line")):(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line")),e("#todark").click(function(){1==sessionStorage.getItem("darkmode")?(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"),sessionStorage.removeItem("darkmode")):(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line"),sessionStorage.setItem("darkmode",1))});console.log("%c%s%c%s%c%s","background-color: #49b1f5; color: #fff; padding: 8px; font-size: 14px;","主题不错?⭐star 支持一下 ->","background-color: #ffbca2; padding: 8px; font-size: 14px;","https://github.com/Shen-Yu/hexo-theme-ayer","background-color: #eaf8ff;","\n\n _ __ _______ _____ \n / \\ \\ \\ / / ____| _ \\ \n / _ \\ \\ V /| _| | |_) | \n / ___ \\ | | | |___| _ < \n /_/ \\_\\ _| |_____|_| \\__\\ \n"),document.write('<script type="text/javascript" src="https://js.users.51.la/20544303.js"><\/script>')}(jQuery); | ||
!function(e){var o=e(".search-form-wrap"),a=!1;e(".nav-item-search").click(function(){var n;a||(a=!0,o.addClass("on"),n=function(){e(".local-search-input").focus()},setTimeout(function(){a=!1,n&&n()},200))}),e(document).mouseup(function(a){var n=e(".local-search");n.is(a.target)||0!==n.has(a.target).length||o.removeClass("on")}),e(".local-search").size()&&e.getScript("/js/search.js",function(){searchFunc("/search.xml","local-search-input","local-search-result")});var n;e(".share-outer").click(function(){return e(".share-wrap").fadeToggle()}),e("img.lazy").lazyload({effect:"fadeIn"}),e("#gallery").justifiedGallery({rowHeight:200,margins:5}),e(document).ready(function(e){e(".anchor").click(function(o){o.preventDefault(),e("main").animate({scrollTop:e(".cover").height()},"smooth")})}),(n=e("#totop")).hide(),e(".content").scroll(function(){e(".content").scrollTop()>1e3?e(n).stop().fadeTo(200,.6):e(n).stop().fadeTo(200,0)}),e(n).click(function(){return e(".content").animate({scrollTop:0},1e3),!1});var t=e(".content"),r=e(".sidebar");e(".navbar-toggle").on("click",function(){e(".content,.sidebar").addClass("anim"),t.toggleClass("on"),r.toggleClass("on")}),e("#reward-btn").click(function(){e("#reward").fadeIn(150),e("#mask").fadeIn(150)}),e("#reward .close, #mask").click(function(){e("#mask").fadeOut(100),e("#reward").fadeOut(100)}),1==sessionStorage.getItem("darkmode")?(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line")):(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line")),e("#todark").click(function(){1==sessionStorage.getItem("darkmode")?(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"),sessionStorage.removeItem("darkmode")):(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line"),sessionStorage.setItem("darkmode",1))});console.log("%c%s%c%s%c%s","background-color: #49b1f5; color: #fff; padding: 8px; font-size: 14px;","主题不错?⭐star 支持一下 ->","background-color: #ffbca2; padding: 8px; font-size: 14px;","https://github.com/Shen-Yu/hexo-theme-ayer","background-color: #eaf8ff;","\n\n _ __ _______ _____ \n / \\ \\ \\ / / ____| _ \\ \n / _ \\ \\ V /| _| | |_) | \n / ___ \\ | | | |___| _ < \n /_/ \\_\\ _| |_____|_| \\__\\ \n")}(jQuery),function(e){"use strict";!function(o){var a=window,n=document,t=e,r="".concat("https:"===n.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),s=n.createElement("script"),c=n.getElementsByTagName("script")[0];s.type="text/javascript",s.setAttribute("charset","UTF-8"),s.async=!0,s.src=r,s.id="LA_COLLECT",t.d=s;var i=function(){a.LA.ids.push(t)};a.LA?a.LA.ids&&i():(a.LA=e,a.LA.ids=[],i()),c.parentNode.insertBefore(s,c)}()}({id:"JGjrOr2rebvP6q2a",ck:"JGjrOr2rebvP6q2a"}); | ||
},{}],"BNiz":[function(require,module,exports) { | ||
@@ -6,0 +6,0 @@ function e(e,t){e=e.replace(/<%-sUrl%>/g,encodeURIComponent(t.sUrl)).replace(/<%-sTitle%>/g,encodeURIComponent(t.sTitle)).replace(/<%-sDesc%>/g,encodeURIComponent(t.sDesc)).replace(/<%-sPic%>/g,encodeURIComponent(t.sPic));window.open(e)}function t(){$(".wx-share-modal").addClass("in ready"),$("#share-mask").show()}function s(){$(".wx-share-modal").removeClass("in ready"),$("#share-mask").hide()}function o(s,o){"weibo"===s?e("http://service.weibo.com/share/share.php?url=<%-sUrl%>&title=<%-sTitle%>&pic=<%-sPic%>",o):"qq"===s?e("http://connect.qq.com/widget/shareqq/index.html?url=<%-sUrl%>&title=<%-sTitle%>&source=<%-sDesc%>",o):"douban"===s?e("https://www.douban.com/share/service?image=<%-sPic%>&href=<%-sUrl%>&name=<%-sTitle%>&text=<%-sDesc%>",o):"qzone"===s?e("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=<%-sUrl%>&title=<%-sTitle%>&pics=<%-sPic%>&summary=<%-sDesc%>",o):"facebook"===s?e("https://www.facebook.com/sharer/sharer.php?u=<%-sUrl%>",o):"twitter"===s?e("https://twitter.com/intent/tweet?text=<%-sTitle%>&url=<%-sUrl%>",o):"google"===s?e("https://plus.google.com/share?url=<%-sUrl%>",o):"weixin"===s&&t()}var r=function(){var e=document.querySelectorAll(".share-sns");if(e&&0!==e.length){var t=window.location.href,r=document.querySelector("title").innerHTML,c=document.querySelectorAll(".article-entry img").length?document.querySelector(".article-entry img").getAttribute("src"):"";""===c||/^(http:|https:)?\/\//.test(c)||(c=window.location.origin+c),e.forEach(function(e){e.onclick=function(s){o(e.getAttribute("data-type"),{sUrl:t,sPic:c,sTitle:r,sDesc:r})}}),document.querySelector("#mask").onclick=s,document.querySelector(".modal-close").onclick=s}};r(); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
1010
2818768
147