Move from miccall theme to kaze
This commit is contained in:
1
js/Meting.min.js
vendored
Normal file
1
js/Meting.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
'use strict';console.log('\n %c MetingJS v1.2.0 %c https://github.com/metowolf/MetingJS \n','color: #fadfa3; background: #030307; padding:5px 0;','background: #fadfa3; padding:5px 0;');var aplayers=[],loadMeting=function(){function a(a,b){var c={container:a,audio:b,mini:null,fixed:null,autoplay:!1,mutex:!0,lrcType:3,listFolded:!1,preload:'auto',theme:'#2980b9',loop:'all',order:'list',volume:null,listMaxHeight:null,customAudioType:null,storageName:'metingjs'};if(b.length){b[0].lrc||(c.lrcType=0);var d={};for(var e in c){var f=e.toLowerCase();(a.dataset.hasOwnProperty(f)||a.dataset.hasOwnProperty(e)||null!==c[e])&&(d[e]=a.dataset[f]||a.dataset[e]||c[e],('true'===d[e]||'false'===d[e])&&(d[e]='true'==d[e]))}aplayers.push(new APlayer(d))}}var b='https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r';'undefined'!=typeof meting_api&&(b=meting_api);for(var f=0;f<aplayers.length;f++)try{aplayers[f].destroy()}catch(a){console.log(a)}aplayers=[];for(var c=document.querySelectorAll('.aplayer'),d=function(){var d=c[e],f=d.dataset.id;if(f){var g=d.dataset.api||b;g=g.replace(':server',d.dataset.server),g=g.replace(':type',d.dataset.type),g=g.replace(':id',d.dataset.id),g=g.replace(':auth',d.dataset.auth),g=g.replace(':r',Math.random());var h=new XMLHttpRequest;h.onreadystatechange=function(){if(4===h.readyState&&(200<=h.status&&300>h.status||304===h.status)){var b=JSON.parse(h.responseText);a(d,b)}},h.open('get',g,!0),h.send(null)}else if(d.dataset.url){var i=[{name:d.dataset.name||d.dataset.title||'Audio name',artist:d.dataset.artist||d.dataset.author||'Audio artist',url:d.dataset.url,cover:d.dataset.cover||d.dataset.pic,lrc:d.dataset.lrc,type:d.dataset.type||'auto'}];a(d,i)}},e=0;e<c.length;e++)d()};document.addEventListener('DOMContentLoaded',loadMeting,!1);
|
||||
64
js/busuanzi.js
Normal file
64
js/busuanzi.js
Normal file
@@ -0,0 +1,64 @@
|
||||
function initialBusuanzi() {
|
||||
var bszCaller, bszTag;
|
||||
! function() {
|
||||
var c, d, e, a = !1,
|
||||
b = [];
|
||||
ready = function(c) {
|
||||
return a || "interactive" === document.readyState || "complete" === document.readyState ? c.call(document) : b.push(function() {
|
||||
return c.call(this)
|
||||
}), this
|
||||
}, d = function() {
|
||||
for (var a = 0, c = b.length; c > a; a++) b[a].apply(document);
|
||||
b = []
|
||||
}, e = function() {
|
||||
a || (a = !0, d.call(window), document.removeEventListener ? document.removeEventListener("DOMContentLoaded", e, !1) : document.attachEvent && (document.detachEvent("onreadystatechange", e), window == window.top && (clearInterval(c), c = null)))
|
||||
}, document.addEventListener ? document.addEventListener("DOMContentLoaded", e, !1) : document.attachEvent && (document.attachEvent("onreadystatechange", function() {
|
||||
/loaded|complete/.test(document.readyState) && e()
|
||||
}), window == window.top && (c = setInterval(function() {
|
||||
try {
|
||||
a || document.documentElement.doScroll("left")
|
||||
} catch (b) {
|
||||
return
|
||||
}
|
||||
e()
|
||||
}, 5)))
|
||||
}(), bszCaller = {
|
||||
fetch: function(a, b) {
|
||||
var c = "BusuanziCallback_" + Math.floor(1099511627776 * Math.random());
|
||||
window[c] = this.evalCall(b), a = a.replace("=BusuanziCallback", "=" + c), scriptTag = document.createElement("SCRIPT"), scriptTag.type = "text/javascript", scriptTag.defer = !0, scriptTag.src = a, document.getElementsByTagName("HEAD")[0].appendChild(scriptTag)
|
||||
},
|
||||
evalCall: function(a) {
|
||||
return function(b) {
|
||||
ready(function() {
|
||||
try {
|
||||
a(b), scriptTag.parentElement.removeChild(scriptTag)
|
||||
} catch (c) {
|
||||
bszTag.hides()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}, bszCaller.fetch("//busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback", function(a) {
|
||||
bszTag.texts(a), bszTag.shows()
|
||||
}), bszTag = {
|
||||
bszs: ["site_pv", "page_pv", "site_uv"],
|
||||
texts: function(a) {
|
||||
this.bszs.map(function(b) {
|
||||
var c = document.getElementById("busuanzi_value_" + b);
|
||||
c && (c.innerHTML = a[b])
|
||||
})
|
||||
},
|
||||
hides: function() {
|
||||
this.bszs.map(function(a) {
|
||||
var b = document.getElementById("busuanzi_container_" + a);
|
||||
b && (b.style.display = "none")
|
||||
})
|
||||
},
|
||||
shows: function() {
|
||||
this.bszs.map(function(a) {
|
||||
var b = document.getElementById("busuanzi_container_" + a);
|
||||
b && (b.style.display = "flex")
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
1
js/busuanzi.min.js
vendored
Normal file
1
js/busuanzi.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function initialBusuanzi(){var bszCaller,bszTag,c,d,e,a,b;a=!1,b=[],ready=function(c){return a||"interactive"===document.readyState||"complete"===document.readyState?c.call(document):b.push((function(){return c.call(this)})),this},d=function(){for(var a=0,c=b.length;c>a;a++)b[a].apply(document);b=[]},e=function(){a||(a=!0,d.call(window),document.removeEventListener?document.removeEventListener("DOMContentLoaded",e,!1):document.attachEvent&&(document.detachEvent("onreadystatechange",e),window==window.top&&(clearInterval(c),c=null)))},document.addEventListener?document.addEventListener("DOMContentLoaded",e,!1):document.attachEvent&&(document.attachEvent("onreadystatechange",(function(){/loaded|complete/.test(document.readyState)&&e()})),window==window.top&&(c=setInterval((function(){try{a||document.documentElement.doScroll("left")}catch(b){return}e()}),5))),(bszCaller={fetch:function(a,b){var c="BusuanziCallback_"+Math.floor(1099511627776*Math.random());window[c]=this.evalCall(b),a=a.replace("=BusuanziCallback","="+c),scriptTag=document.createElement("SCRIPT"),scriptTag.type="text/javascript",scriptTag.defer=!0,scriptTag.src=a,document.getElementsByTagName("HEAD")[0].appendChild(scriptTag)},evalCall:function(a){return function(b){ready((function(){try{a(b),scriptTag.parentElement.removeChild(scriptTag)}catch(c){bszTag.hides()}}))}}}).fetch("//busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback",(function(a){bszTag.texts(a),bszTag.shows()})),bszTag={bszs:["site_pv","page_pv","site_uv"],texts:function(a){this.bszs.map((function(b){var c=document.getElementById("busuanzi_value_"+b);c&&(c.innerHTML=a[b])}))},hides:function(){this.bszs.map((function(a){var b=document.getElementById("busuanzi_container_"+a);b&&(b.style.display="none")}))},shows:function(){this.bszs.map((function(a){var b=document.getElementById("busuanzi_container_"+a);b&&(b.style.display="flex")}))}}}
|
||||
141
js/canvas_bg.js
Normal file
141
js/canvas_bg.js
Normal file
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* created by lvfan
|
||||
* 2018-09-04
|
||||
*/
|
||||
|
||||
|
||||
(function drawBg() {
|
||||
window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
|
||||
const starDensity = 0.216;
|
||||
const speedCoeff = 0.05;
|
||||
let width;
|
||||
let height;
|
||||
let starCount;
|
||||
/* no-unused-vars */
|
||||
// let circleRadius;
|
||||
// let circleCenter;
|
||||
let first = true;
|
||||
let giantColor = '180,184,240';
|
||||
let starColor = '226,225,142';
|
||||
let cometColor = '226,225,224';
|
||||
const canva = document.getElementById('universe');
|
||||
let stars = [];
|
||||
let universe;
|
||||
windowResizeHandler();
|
||||
window.addEventListener('resize', windowResizeHandler, false);
|
||||
|
||||
function windowResizeHandler() {
|
||||
width = window.innerWidth;
|
||||
height = window.innerHeight;
|
||||
starCount = width * starDensity;
|
||||
// circleRadius = (width > height ? height / 2 : width / 2);
|
||||
// circleCenter = {
|
||||
// x: width / 2,
|
||||
// y: height / 2
|
||||
// };
|
||||
canva.setAttribute('width', width);
|
||||
canva.setAttribute('height', height);
|
||||
}
|
||||
|
||||
createUniverse();
|
||||
|
||||
function createUniverse() {
|
||||
universe = canva.getContext('2d');
|
||||
for (let i = 0; i < starCount; i++) {
|
||||
stars[i] = new Star();
|
||||
stars[i].reset();
|
||||
}
|
||||
draw();
|
||||
}
|
||||
|
||||
function draw() {
|
||||
universe.clearRect(0, 0, width, height);
|
||||
let starsLength = stars.length;
|
||||
for (let i = 0; i < starsLength; i++) {
|
||||
let star = stars[i];
|
||||
star.move();
|
||||
star.fadeIn();
|
||||
star.fadeOut();
|
||||
star.draw();
|
||||
}
|
||||
window.requestAnimationFrame(draw);
|
||||
}
|
||||
|
||||
function Star() {
|
||||
this.reset = function () {
|
||||
this.giant = getProbability(3);
|
||||
this.comet = this.giant || first ? false : getProbability(10);
|
||||
this.x = getRandInterval(0, width - 10);
|
||||
this.y = getRandInterval(0, height);
|
||||
this.r = getRandInterval(1.1, 2.6);
|
||||
this.dx = getRandInterval(speedCoeff, 6 * speedCoeff) + (this.comet + 1 - 1) * speedCoeff * getRandInterval(50, 120) + speedCoeff * 2;
|
||||
this.dy = -getRandInterval(speedCoeff, 6 * speedCoeff) - (this.comet + 1 - 1) * speedCoeff * getRandInterval(50, 120);
|
||||
this.fadingOut = null;
|
||||
this.fadingIn = true;
|
||||
this.opacity = 0;
|
||||
this.opacityTresh = getRandInterval(0.2, 1 - (this.comet + 1 - 1) * 0.4);
|
||||
this.do = getRandInterval(0.0005, 0.002) + (this.comet + 1 - 1) * 0.001;
|
||||
};
|
||||
this.fadeIn = function () {
|
||||
if (this.fadingIn) {
|
||||
this.fadingIn = !(this.opacity > this.opacityTresh);
|
||||
this.opacity += this.do;
|
||||
}
|
||||
};
|
||||
this.fadeOut = function () {
|
||||
if (this.fadingOut) {
|
||||
this.fadingOut = !(this.opacity < 0);
|
||||
this.opacity -= this.do / 2;
|
||||
if (this.x > width || this.y < 0) {
|
||||
this.fadingOut = false;
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
};
|
||||
this.draw = function () {
|
||||
universe.beginPath();
|
||||
if (this.giant) {
|
||||
universe.fillStyle = 'rgba(' + giantColor + ',' + this.opacity + ')';
|
||||
universe.arc(this.x, this.y, 2, 0, 2 * Math.PI, false);
|
||||
} else if (this.comet) {
|
||||
universe.fillStyle = 'rgba(' + cometColor + ',' + this.opacity + ')';
|
||||
universe.arc(this.x, this.y, 1.5, 0, 2 * Math.PI, false);
|
||||
// comet tail
|
||||
for (let i = 0; i < 30; i++) {
|
||||
universe.fillStyle = 'rgba(' + cometColor + ',' + (this.opacity - (this.opacity / 20) * i) + ')';
|
||||
universe.rect(this.x - this.dx / 4 * i, this.y - this.dy / 4 * i - 2, 2, 2);
|
||||
universe.fill();
|
||||
}
|
||||
} else {
|
||||
universe.fillStyle = 'rgba(' + starColor + ',' + this.opacity + ')';
|
||||
universe.rect(this.x, this.y, this.r, this.r);
|
||||
}
|
||||
universe.closePath();
|
||||
universe.fill();
|
||||
};
|
||||
this.move = function () {
|
||||
this.x += this.dx;
|
||||
this.y += this.dy;
|
||||
if (this.fadingOut === false) {
|
||||
this.reset();
|
||||
}
|
||||
if (this.x > width - (width / 4) || this.y < 0) {
|
||||
this.fadingOut = true;
|
||||
}
|
||||
};
|
||||
(function () {
|
||||
setTimeout(function () {
|
||||
first = false;
|
||||
}, 50);
|
||||
})();
|
||||
}
|
||||
|
||||
function getProbability(percents) {
|
||||
return ((Math.floor(Math.random() * 1000) + 1) < percents * 10);
|
||||
}
|
||||
|
||||
function getRandInterval(min, max) {
|
||||
return (Math.random() * (max - min) + min);
|
||||
}
|
||||
}());
|
||||
51
js/comments/gitment.js
Normal file
51
js/comments/gitment.js
Normal file
@@ -0,0 +1,51 @@
|
||||
(function () {
|
||||
var newGitment = 'https://imsun.github.io/gitment/dist/gitment.browser.js';
|
||||
var oldGitment = 'imsun.github.io/gitment/dist/gitment.browser.js';
|
||||
|
||||
var replaceScript = function (script, src) {
|
||||
//
|
||||
// Make redirected script
|
||||
//
|
||||
var newScript = document.createElement('script');
|
||||
newScript.src = newGitment + src.replace(/.*?(\?|$)/, '$1');
|
||||
//
|
||||
// Move onload and onerror handlers to new script
|
||||
//
|
||||
newScript.onload = script.onload;
|
||||
newScript.onerror = script.onerror;
|
||||
script.onload = script.onerror = null;
|
||||
//
|
||||
// Move any content (old-style configuration scripts)
|
||||
//
|
||||
while (script.firstChild) newScript.appendChild(script.firstChild);
|
||||
//
|
||||
// Copy script id
|
||||
//
|
||||
if (script.id != null) newScript.id = script.id;
|
||||
//
|
||||
// Replace original script with new one
|
||||
//
|
||||
script.parentNode.replaceChild(newScript, script);
|
||||
};
|
||||
|
||||
if (document.currentScript) {
|
||||
var script = document.currentScript;
|
||||
replaceScript(script, script.src);
|
||||
|
||||
} else {
|
||||
//
|
||||
// Look for current script by searching for one with the right source
|
||||
//
|
||||
var n = oldGitment.length;
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0; i < scripts.length; i++) {
|
||||
var script = scripts[i];
|
||||
var src = (script.src || '').replace(/.*?:\/\//, '');
|
||||
if (src.substr(0, n) === oldGitment) {
|
||||
replaceScript(script, src);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
2
js/comments/twikoo.all.min.js
vendored
Normal file
2
js/comments/twikoo.all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
50
js/copy.js
Normal file
50
js/copy.js
Normal file
@@ -0,0 +1,50 @@
|
||||
$(function () {
|
||||
// Add copy icon
|
||||
var $copyIcon = $('<i class="fa fa-clipboard" aria-hidden="true"></i>');
|
||||
var $notice = $('<div class="copy-notice"></div>');
|
||||
$('figure.highlight').prepend($copyIcon);
|
||||
$('figure.highlight').prepend($notice);
|
||||
// copy function
|
||||
function copy (text, ctx) {
|
||||
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
||||
try {
|
||||
document.execCommand('copy'); // Security exception may be thrown by some browsers.
|
||||
$(ctx).prev('.copy-notice')
|
||||
.text(GLOBAL_CONFIG.copy.success)
|
||||
.velocity({
|
||||
translateX: -30,
|
||||
opacity: 1
|
||||
}, {
|
||||
loop: 1,
|
||||
duration: 750,
|
||||
easing: 'easeOutQuint'
|
||||
});
|
||||
} catch (ex) {
|
||||
$(ctx).prev('.copy-notice')
|
||||
.text(GLOBAL_CONFIG.copy.error)
|
||||
.velocity({
|
||||
translateX: -30,
|
||||
opacity: 1
|
||||
}, {
|
||||
loop: 1,
|
||||
duration: 750,
|
||||
easing: 'easeOutQuint'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$(ctx).prev('.copy-notice').text(GLOBAL_CONFIG.copy.noSupport);
|
||||
}
|
||||
}
|
||||
// click events
|
||||
$('.highlight .fa-clipboard').on('click', function () {
|
||||
var selection = window.getSelection();
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents($(this).next('table').find('.code pre')[0]);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
var text = selection.toString();
|
||||
copy(text, this);
|
||||
selection.removeAllRanges();
|
||||
});
|
||||
});
|
||||
63
js/fan.js
Normal file
63
js/fan.js
Normal file
@@ -0,0 +1,63 @@
|
||||
(function () {
|
||||
/**
|
||||
* 内容的宽度为 900 ,侧边栏的宽度为 300
|
||||
* 900 的时候不能出现侧边栏
|
||||
*/
|
||||
window.onresize = (e) => {
|
||||
let width = e.currentTarget.innerWidth;
|
||||
let open = $('#side-button').hasClass('close');
|
||||
if (width <= 900) {
|
||||
document.documentElement.style.fontSize = width / 7.5 + 'px';
|
||||
//设置body字体大小,不影响body内字体大小
|
||||
document.body.style.fontSize = '12px';
|
||||
|
||||
$('#menu-inner').addClass('min-menu-inner');
|
||||
|
||||
$('#side-button').hide();
|
||||
if (open) {
|
||||
$('#sidebar').velocity('stop').velocity({left: '-300px'}, 800, 'spring');
|
||||
$('#main-container').velocity('stop').velocity({marginLeft: '0px'}, 800, 'spring');
|
||||
}
|
||||
} else {
|
||||
document.documentElement.style.fontSize = '12px';
|
||||
//设置body字体大小,不影响body内字体大小
|
||||
document.body.style.fontSize = '12px';
|
||||
|
||||
$('#menu-inner').removeClass('min-menu-inner');
|
||||
|
||||
$('#side-button').show();
|
||||
if (open) {
|
||||
$('#sidebar').velocity('stop').velocity({left: '0px'}, 800, 'spring');
|
||||
$('#main-container').velocity('stop').velocity({marginLeft: '300px'}, 800, 'spring');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 当宽度小于 900 的时候不显示展开侧边栏按钮
|
||||
*/
|
||||
if (window.innerWidth <= 900) {
|
||||
document.documentElement.style.fontSize = window.innerWidth / 7.5 + 'px';
|
||||
//设置body字体大小,不影响body内字体大小
|
||||
document.body.style.fontSize = '12px';
|
||||
|
||||
$('#menu-inner').addClass('min-menu-inner');
|
||||
|
||||
$('#side-button').hide();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description post 页面展开侧边栏
|
||||
* 第一次加载时候判断页面的宽度,如果宽度小则不展开侧边栏
|
||||
*/
|
||||
if (window.innerWidth > 900 && $('#post').length > 0) {
|
||||
setTimeout(function () {
|
||||
$('#side-button').click();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
$('.menu-list-icon').click(() => {
|
||||
$('#menu-inner').toggleClass('show-min-menu-inner');
|
||||
});
|
||||
|
||||
})();
|
||||
9
js/jquery.min.js
vendored
9
js/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
103
js/jquery.truncate.js
Normal file
103
js/jquery.truncate.js
Normal file
@@ -0,0 +1,103 @@
|
||||
(function($) {
|
||||
|
||||
// Matches trailing non-space characters.
|
||||
var chop = /(\s*\S+|\s)$/;
|
||||
|
||||
// Matches the first word in the string.
|
||||
var start = /^(\S*)/;
|
||||
|
||||
// Return a truncated html string. Delegates to $.fn.truncate.
|
||||
$.truncate = function(html, options) {
|
||||
return $('<div></div>').append(html).truncate(options).html();
|
||||
};
|
||||
|
||||
// Truncate the contents of an element in place.
|
||||
$.fn.truncate = function(options) {
|
||||
if ($.isNumeric(options)) options = {length: options};
|
||||
var o = $.extend({}, $.truncate.defaults, options);
|
||||
|
||||
return this.each(function() {
|
||||
var self = $(this);
|
||||
|
||||
if (o.noBreaks) self.find('br').replaceWith(' ');
|
||||
|
||||
var text = self.text();
|
||||
var excess = text.length - o.length;
|
||||
|
||||
if (o.stripTags) self.text(text);
|
||||
|
||||
// Chop off any partial words if appropriate.
|
||||
if (o.words && excess > 0) {
|
||||
var truncated = text.slice(0, o.length).replace(chop, '').length;
|
||||
|
||||
if (o.keepFirstWord && truncated === 0) {
|
||||
excess = text.length - start.exec(text)[0].length - 1;
|
||||
} else {
|
||||
excess = text.length - truncated - 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (excess < 0 || !excess && !o.truncated) return;
|
||||
|
||||
// Iterate over each child node in reverse, removing excess text.
|
||||
$.each(self.contents().get().reverse(), function(i, el) {
|
||||
var $el = $(el);
|
||||
var text = $el.text();
|
||||
var length = text.length;
|
||||
|
||||
// If the text is longer than the excess, remove the node and continue.
|
||||
if (length <= excess) {
|
||||
o.truncated = true;
|
||||
excess -= length;
|
||||
$el.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove the excess text and append the ellipsis.
|
||||
if (el.nodeType === 3) {
|
||||
// should we finish the block anyway?
|
||||
if (o.finishBlock) {
|
||||
$(el.splitText(length)).replaceWith(o.ellipsis);
|
||||
} else {
|
||||
$(el.splitText(length - excess - 1)).replaceWith(o.ellipsis);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Recursively truncate child nodes.
|
||||
$el.truncate($.extend(o, {length: length - excess}));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$.truncate.defaults = {
|
||||
|
||||
// Strip all html elements, leaving only plain text.
|
||||
stripTags: false,
|
||||
|
||||
// Only truncate at word boundaries.
|
||||
words: false,
|
||||
|
||||
// When 'words' is active, keeps the first word in the string
|
||||
// even if it's longer than a target length.
|
||||
keepFirstWord: false,
|
||||
|
||||
// Replace instances of <br> with a single space.
|
||||
noBreaks: false,
|
||||
|
||||
// if true always truncate the content at the end of the block.
|
||||
finishBlock: false,
|
||||
|
||||
// The maximum length of the truncated html.
|
||||
length: Infinity,
|
||||
|
||||
// The character to use as the ellipsis. The word joiner (U+2060) can be
|
||||
// used to prevent a hanging ellipsis, but displays incorrectly in Chrome
|
||||
// on Windows 7.
|
||||
// http://code.google.com/p/chromium/issues/detail?id=68323
|
||||
ellipsis: '\u2026' // '\u2060\u2026'
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
1
js/jquery.truncate.min.js
vendored
Normal file
1
js/jquery.truncate.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function($){var chop=/(\s*\S+|\s)$/,start=/^(\S*)/;$.truncate=function(html,options){return $("<div></div>").append(html).truncate(options).html()},$.fn.truncate=function(options){$.isNumeric(options)&&(options={length:options});var o=$.extend({},$.truncate.defaults,options);return this.each(function(){var self=$(this);o.noBreaks&&self.find("br").replaceWith(" ");var text=self.text(),excess=text.length-o.length;if(o.stripTags&&self.text(text),o.words&&excess>0){var truncated=text.slice(0,o.length).replace(chop,"").length;excess=o.keepFirstWord&&0===truncated?text.length-start.exec(text)[0].length-1:text.length-truncated-1}excess<0||!excess&&!o.truncated||$.each(self.contents().get().reverse(),function(i,el){var $el=$(el),text,length=$el.text().length;return length<=excess?(o.truncated=!0,excess-=length,void $el.remove()):3===el.nodeType?(o.finishBlock?$(el.splitText(length)).replaceWith(o.ellipsis):$(el.splitText(length-excess-1)).replaceWith(o.ellipsis),!1):($el.truncate($.extend(o,{length:length-excess})),!1)})})},$.truncate.defaults={stripTags:!1,words:!1,keepFirstWord:!1,noBreaks:!1,finishBlock:!1,length:1/0,ellipsis:"…"}}(jQuery);
|
||||
1
js/lib/busuanzi.min.js
vendored
Normal file
1
js/lib/busuanzi.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var bszCaller,bszTag;!function(){var c,d,e,a=!1,b=[];ready=function(c){return a||"interactive"===document.readyState||"complete"===document.readyState?c.call(document):b.push(function(){return c.call(this)}),this},d=function(){for(var a=0,c=b.length;c>a;a++)b[a].apply(document);b=[]},e=function(){a||(a=!0,d.call(window),document.removeEventListener?document.removeEventListener("DOMContentLoaded",e,!1):document.attachEvent&&(document.detachEvent("onreadystatechange",e),window==window.top&&(clearInterval(c),c=null)))},document.addEventListener?document.addEventListener("DOMContentLoaded",e,!1):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){/loaded|complete/.test(document.readyState)&&e()}),window==window.top&&(c=setInterval(function(){try{a||document.documentElement.doScroll("left")}catch(b){return}e()},5)))}(),bszCaller={fetch:function(a,b){var c="BusuanziCallback_"+Math.floor(1099511627776*Math.random());window[c]=this.evalCall(b),a=a.replace("=BusuanziCallback","="+c),scriptTag=document.createElement("SCRIPT"),scriptTag.type="text/javascript",scriptTag.defer=!0,scriptTag.src=a,document.getElementsByTagName("HEAD")[0].appendChild(scriptTag)},evalCall:function(a){return function(b){ready(function(){try{a(b),scriptTag.parentElement.removeChild(scriptTag)}catch(c){bszTag.hides()}})}}},bszCaller.fetch("//busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback",function(a){bszTag.texts(a),bszTag.shows()}),bszTag={bszs:["site_pv","page_pv","site_uv"],texts:function(a){this.bszs.map(function(b){var c=document.getElementById("busuanzi_value_"+b);c&&(c.innerHTML=a[b])})},hides:function(){this.bszs.map(function(a){var b=document.getElementById("busuanzi_container_"+a);b&&(b.style.display="none")})},shows:function(){this.bszs.map(function(a){var b=document.getElementById("busuanzi_container_"+a);b&&(b.style.display="inline")})}};
|
||||
6
js/lib/lightbox/baguetteBox.min.css
vendored
Normal file
6
js/lib/lightbox/baguetteBox.min.css
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* baguetteBox.js
|
||||
* @author feimosi
|
||||
* @version 1.11.1
|
||||
* @url https://github.com/feimosi/baguetteBox.js
|
||||
*/#baguetteBox-overlay{display:none;opacity:0;position:fixed;overflow:hidden;top:0;left:0;width:100%;height:100%;z-index:1000000;background-color:#222;background-color:rgba(0,0,0,.8);-webkit-transition:opacity .5s ease;transition:opacity .5s ease}#baguetteBox-overlay.visible{opacity:1}#baguetteBox-overlay .full-image{display:inline-block;position:relative;width:100%;height:100%;text-align:center}#baguetteBox-overlay .full-image figure{display:inline;margin:0;}#baguetteBox-overlay .full-image img{display:inline-block;width:auto;height:auto;max-height:100%;max-width:100%;vertical-align:middle;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);-moz-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6)}#baguetteBox-overlay .full-image figcaption{display:block;position:absolute;bottom:0;width:100%;text-align:center;line-height:1.8;white-space:normal;color:#ccc;background-color:#000;background-color:rgba(0,0,0,.6);font-family:sans-serif}#baguetteBox-overlay .full-image:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}#baguetteBox-slider{position:absolute;left:0;top:0;height:100%;width:100%;white-space:nowrap;-webkit-transition:left .4s ease,-webkit-transform .4s ease;transition:left .4s ease,-webkit-transform .4s ease;transition:left .4s ease,transform .4s ease;transition:left .4s ease,transform .4s ease,-webkit-transform .4s ease,-moz-transform .4s ease}#baguetteBox-slider.bounce-from-right{-webkit-animation:bounceFromRight .4s ease-out;animation:bounceFromRight .4s ease-out}#baguetteBox-slider.bounce-from-left{-webkit-animation:bounceFromLeft .4s ease-out;animation:bounceFromLeft .4s ease-out}@-webkit-keyframes bounceFromRight{0%,100%{margin-left:0}50%{margin-left:-30px}}@keyframes bounceFromRight{0%,100%{margin-left:0}50%{margin-left:-30px}}@-webkit-keyframes bounceFromLeft{0%,100%{margin-left:0}50%{margin-left:30px}}@keyframes bounceFromLeft{0%,100%{margin-left:0}50%{margin-left:30px}}.baguetteBox-button#next-button,.baguetteBox-button#previous-button{top:50%;top:calc(50% - 30px);width:44px;height:60px}.baguetteBox-button{position:absolute;cursor:pointer;outline:0;padding:0;margin:0;border:0;-moz-border-radius:15%;border-radius:15%;background-color:#323232;background-color:rgba(50,50,50,.5);color:#ddd;font:1.6em sans-serif;-webkit-transition:background-color .4s ease;transition:background-color .4s ease}.baguetteBox-button:focus,.baguetteBox-button:hover{background-color:rgba(50,50,50,.9)}.baguetteBox-button#next-button{right:2%}.baguetteBox-button#previous-button{left:2%}.baguetteBox-button#close-button{top:20px;right:2%;right:calc(2% + 6px);width:30px;height:30px}.baguetteBox-button svg{position:absolute;left:0;top:0}.baguetteBox-spinner{width:40px;height:40px;display:inline-block;position:absolute;top:50%;left:50%;margin-top:-20px;margin-left:-20px}.baguetteBox-double-bounce1,.baguetteBox-double-bounce2{width:100%;height:100%;-moz-border-radius:50%;border-radius:50%;background-color:#fff;opacity:.6;position:absolute;top:0;left:0;-webkit-animation:bounce 2s infinite ease-in-out;animation:bounce 2s infinite ease-in-out}.baguetteBox-double-bounce2{-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes bounce{0%,100%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounce{0%,100%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}
|
||||
7
js/lib/lightbox/baguetteBox.min.js
vendored
Normal file
7
js/lib/lightbox/baguetteBox.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
11
js/lib/lozad.min.js
vendored
Normal file
11
js/lib/lozad.min.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/*! lozad.js - v1.15.0 - 2020-05-23
|
||||
* https://github.com/ApoorvSaxena/lozad.js
|
||||
* Copyright (c) 2020 Apoorv Saxena; Licensed MIT */
|
||||
/* eslint-disable */
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict";
|
||||
/**
|
||||
* Detect IE browser
|
||||
* @const {boolean}
|
||||
* @private
|
||||
*/var u="undefined"!=typeof document&&document.documentMode,c={rootMargin:"0px",threshold:0,load:function(t){if("picture"===t.nodeName.toLowerCase()){var e=document.createElement("img");u&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.getAttribute("data-alt")&&(e.alt=t.getAttribute("data-alt")),t.append(e)}if("video"===t.nodeName.toLowerCase()&&!t.getAttribute("data-src")&&t.children){for(var r=t.children,a=void 0,i=0;i<=r.length-1;i++)(a=r[i].getAttribute("data-src"))&&(r[i].src=a);t.load()}t.getAttribute("data-poster")&&(t.poster=t.getAttribute("data-poster")),t.getAttribute("data-src")&&(t.src=t.getAttribute("data-src")),t.getAttribute("data-srcset")&&t.setAttribute("srcset",t.getAttribute("data-srcset"));var o=",";if(t.getAttribute("data-background-delimiter")&&(o=t.getAttribute("data-background-delimiter")),t.getAttribute("data-background-image"))t.style.backgroundImage="url('"+t.getAttribute("data-background-image").split(o).join("'),url('")+"')";else if(t.getAttribute("data-background-image-set")){var n=t.getAttribute("data-background-image-set").split(o),d=n[0].substr(0,n[0].indexOf(" "))||n[0];// Substring before ... 1x
|
||||
d=-1===d.indexOf("url(")?"url("+d+")":d,1===n.length?t.style.backgroundImage=d:t.setAttribute("style",(t.getAttribute("style")||"")+"background-image: "+d+"; background-image: -webkit-image-set("+n+"); background-image: image-set("+n+")")}t.getAttribute("data-toggle-class")&&t.classList.toggle(t.getAttribute("data-toggle-class"))},loaded:function(){}};function l(t){t.setAttribute("data-loaded",!0)}var b=function(t){return"true"===t.getAttribute("data-loaded")};return function(){var r,a,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:".lozad",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},c,t),o=e.root,n=e.rootMargin,d=e.threshold,u=e.load,g=e.loaded,s=void 0;return"undefined"!=typeof window&&window.IntersectionObserver&&(s=new IntersectionObserver((r=u,a=g,function(t,e){t.forEach(function(t){(0<t.intersectionRatio||t.isIntersecting)&&(e.unobserve(t.target),b(t.target)||(r(t.target),l(t.target),a(t.target)))})}),{root:o,rootMargin:n,threshold:d})),{observe:function(){for(var t=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document;return t instanceof Element?[t]:t instanceof NodeList?t:e.querySelectorAll(t)}(i,o),e=0;e<t.length;e++)b(t[e])||(s?s.observe(t[e]):(u(t[e]),l(t[e]),g(t[e])))},triggerLoad:function(t){b(t)||(u(t),l(t),g(t))},observer:s}}});
|
||||
2
js/lib/md5.min.js
vendored
Normal file
2
js/lib/md5.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
!function(n){"use strict";function d(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function f(n,t,r,e,o,u){return d((c=d(d(t,n),d(e,u)))<<(f=o)|c>>>32-f,r);var c,f}function l(n,t,r,e,o,u,c){return f(t&r|~t&e,n,t,o,u,c)}function v(n,t,r,e,o,u,c){return f(t&e|r&~e,n,t,o,u,c)}function g(n,t,r,e,o,u,c){return f(t^r^e,n,t,o,u,c)}function m(n,t,r,e,o,u,c){return f(r^(t|~e),n,t,o,u,c)}function i(n,t){var r,e,o,u;n[t>>5]|=128<<t%32,n[14+(t+64>>>9<<4)]=t;for(var c=1732584193,f=-271733879,i=-1732584194,a=271733878,h=0;h<n.length;h+=16)c=l(r=c,e=f,o=i,u=a,n[h],7,-680876936),a=l(a,c,f,i,n[h+1],12,-389564586),i=l(i,a,c,f,n[h+2],17,606105819),f=l(f,i,a,c,n[h+3],22,-1044525330),c=l(c,f,i,a,n[h+4],7,-176418897),a=l(a,c,f,i,n[h+5],12,1200080426),i=l(i,a,c,f,n[h+6],17,-1473231341),f=l(f,i,a,c,n[h+7],22,-45705983),c=l(c,f,i,a,n[h+8],7,1770035416),a=l(a,c,f,i,n[h+9],12,-1958414417),i=l(i,a,c,f,n[h+10],17,-42063),f=l(f,i,a,c,n[h+11],22,-1990404162),c=l(c,f,i,a,n[h+12],7,1804603682),a=l(a,c,f,i,n[h+13],12,-40341101),i=l(i,a,c,f,n[h+14],17,-1502002290),c=v(c,f=l(f,i,a,c,n[h+15],22,1236535329),i,a,n[h+1],5,-165796510),a=v(a,c,f,i,n[h+6],9,-1069501632),i=v(i,a,c,f,n[h+11],14,643717713),f=v(f,i,a,c,n[h],20,-373897302),c=v(c,f,i,a,n[h+5],5,-701558691),a=v(a,c,f,i,n[h+10],9,38016083),i=v(i,a,c,f,n[h+15],14,-660478335),f=v(f,i,a,c,n[h+4],20,-405537848),c=v(c,f,i,a,n[h+9],5,568446438),a=v(a,c,f,i,n[h+14],9,-1019803690),i=v(i,a,c,f,n[h+3],14,-187363961),f=v(f,i,a,c,n[h+8],20,1163531501),c=v(c,f,i,a,n[h+13],5,-1444681467),a=v(a,c,f,i,n[h+2],9,-51403784),i=v(i,a,c,f,n[h+7],14,1735328473),c=g(c,f=v(f,i,a,c,n[h+12],20,-1926607734),i,a,n[h+5],4,-378558),a=g(a,c,f,i,n[h+8],11,-2022574463),i=g(i,a,c,f,n[h+11],16,1839030562),f=g(f,i,a,c,n[h+14],23,-35309556),c=g(c,f,i,a,n[h+1],4,-1530992060),a=g(a,c,f,i,n[h+4],11,1272893353),i=g(i,a,c,f,n[h+7],16,-155497632),f=g(f,i,a,c,n[h+10],23,-1094730640),c=g(c,f,i,a,n[h+13],4,681279174),a=g(a,c,f,i,n[h],11,-358537222),i=g(i,a,c,f,n[h+3],16,-722521979),f=g(f,i,a,c,n[h+6],23,76029189),c=g(c,f,i,a,n[h+9],4,-640364487),a=g(a,c,f,i,n[h+12],11,-421815835),i=g(i,a,c,f,n[h+15],16,530742520),c=m(c,f=g(f,i,a,c,n[h+2],23,-995338651),i,a,n[h],6,-198630844),a=m(a,c,f,i,n[h+7],10,1126891415),i=m(i,a,c,f,n[h+14],15,-1416354905),f=m(f,i,a,c,n[h+5],21,-57434055),c=m(c,f,i,a,n[h+12],6,1700485571),a=m(a,c,f,i,n[h+3],10,-1894986606),i=m(i,a,c,f,n[h+10],15,-1051523),f=m(f,i,a,c,n[h+1],21,-2054922799),c=m(c,f,i,a,n[h+8],6,1873313359),a=m(a,c,f,i,n[h+15],10,-30611744),i=m(i,a,c,f,n[h+6],15,-1560198380),f=m(f,i,a,c,n[h+13],21,1309151649),c=m(c,f,i,a,n[h+4],6,-145523070),a=m(a,c,f,i,n[h+11],10,-1120210379),i=m(i,a,c,f,n[h+2],15,718787259),f=m(f,i,a,c,n[h+9],21,-343485551),c=d(c,r),f=d(f,e),i=d(i,o),a=d(a,u);return[c,f,i,a]}function a(n){for(var t="",r=32*n.length,e=0;e<r;e+=8)t+=String.fromCharCode(n[e>>5]>>>e%32&255);return t}function h(n){var t=[];for(t[(n.length>>2)-1]=void 0,e=0;e<t.length;e+=1)t[e]=0;for(var r=8*n.length,e=0;e<r;e+=8)t[e>>5]|=(255&n.charCodeAt(e/8))<<e%32;return t}function e(n){for(var t,r="0123456789abcdef",e="",o=0;o<n.length;o+=1)t=n.charCodeAt(o),e+=r.charAt(t>>>4&15)+r.charAt(15&t);return e}function r(n){return unescape(encodeURIComponent(n))}function o(n){return a(i(h(t=r(n)),8*t.length));var t}function u(n,t){return function(n,t){var r,e,o=h(n),u=[],c=[];for(u[15]=c[15]=void 0,16<o.length&&(o=i(o,8*n.length)),r=0;r<16;r+=1)u[r]=909522486^o[r],c[r]=1549556828^o[r];return e=i(u.concat(h(t)),512+8*t.length),a(i(c.concat(e),640))}(r(n),r(t))}function t(n,t,r){return t?r?u(t,n):e(u(t,n)):r?o(n):e(o(n))}"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.md5=t}(this);
|
||||
//# sourceMappingURL=md5.min.js.map
|
||||
8
js/lib/prism/prism-coy.min.css
vendored
Normal file
8
js/lib/prism/prism-coy.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.1.
|
||||
* Original file: /npm/prismjs@1.20.0/themes/prism-coy.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{position:relative;margin:.5em 0;overflow:visible;padding:0}pre[class*=language-]>code{position:relative;border-left:10px solid #358ccb;box-shadow:-1px 0 0 0 #358ccb,0 0 0 1px #dfdfdf;background-color:#fdfdfd;background-image:linear-gradient(transparent 50%,rgba(69,142,209,.04) 50%);background-size:3em 3em;background-origin:content-box;background-attachment:local}code[class*=language]{max-height:inherit;height:inherit;padding:0 1em;display:block;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background-color:#fdfdfd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:1em}:not(pre)>code[class*=language-]{position:relative;padding:.2em;border-radius:.3em;color:#c92c2c;border:1px solid rgba(0,0,0,.1);display:inline;white-space:normal}pre[class*=language-]:after,pre[class*=language-]:before{content:'';z-index:-2;display:block;position:absolute;bottom:.75em;left:.18em;width:40%;height:20%;max-height:13em;box-shadow:0 13px 8px #979797;-webkit-transform:rotate(-2deg);-moz-transform:rotate(-2deg);-ms-transform:rotate(-2deg);-o-transform:rotate(-2deg);transform:rotate(-2deg)}:not(pre)>code[class*=language-]:after,pre[class*=language-]:after{right:.75em;left:auto;-webkit-transform:rotate(2deg);-moz-transform:rotate(2deg);-ms-transform:rotate(2deg);-o-transform:rotate(2deg);transform:rotate(2deg)}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#7d8b99}.token.punctuation{color:#5f6364}.token.boolean,.token.constant,.token.deleted,.token.function-name,.token.number,.token.property,.token.symbol,.token.tag{color:#c92c2c}.token.attr-name,.token.builtin,.token.char,.token.function,.token.inserted,.token.selector,.token.string{color:#2f9c0a}.token.entity,.token.operator,.token.url,.token.variable{color:#a67f59;background:rgba(255,255,255,.5)}.token.atrule,.token.attr-value,.token.class-name,.token.keyword{color:#1990b8}.token.important,.token.regex{color:#e90}.language-css .token.string,.style .token.string{color:#a67f59;background:rgba(255,255,255,.5)}.token.important{font-weight:400}.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.namespace{opacity:.7}@media screen and (max-width:767px){pre[class*=language-]:after,pre[class*=language-]:before{bottom:14px;box-shadow:none}}.token.cr:before,.token.lf:before,.token.tab:not(:empty):before{color:#e0d7d1}pre[class*=language-].line-numbers.line-numbers{padding-left:0}pre[class*=language-].line-numbers.line-numbers code{padding-left:3.8em}pre[class*=language-].line-numbers.line-numbers .line-numbers-rows{left:0}pre[class*=language-][data-line]{padding-top:0;padding-bottom:0;padding-left:0}pre[data-line] code{position:relative;padding-left:4em}pre .line-highlight{margin-top:0}
|
||||
/*# sourceMappingURL=/sm/c73a084ad016251bbbbe892ab95de64b19a6eeb3c2d86ba5539be7e21f56cd1f.map */
|
||||
8
js/lib/prism/prism-dark.min.css
vendored
Normal file
8
js/lib/prism/prism-dark.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.1.
|
||||
* Original file: /npm/prismjs@1.20.0/themes/prism-dark.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
code[class*=language-],pre[class*=language-]{color:#fff;background:0 0;text-shadow:0 -.1em .2em #000;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}:not(pre)>code[class*=language-],pre[class*=language-]{background:#4c3f33}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border:.3em solid #7a6651;border-radius:.5em;box-shadow:1px 1px .5em #000 inset}:not(pre)>code[class*=language-]{padding:.15em .2em .05em;border-radius:.3em;border:.13em solid #7a6651;box-shadow:1px 1px .3em -.1em #000 inset;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#997f66}.token.punctuation{opacity:.7}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.number,.token.property,.token.symbol,.token.tag{color:#d1939e}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#bce051}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f4b73d}.token.atrule,.token.attr-value,.token.keyword{color:#d1939e}.token.important,.token.regex{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.deleted{color:red}
|
||||
/*# sourceMappingURL=/sm/97e557e95df7de597f3d7ae3a86d56e83c99bc3130fb9d0ceda00fe9d703ed07.map */
|
||||
8
js/lib/prism/prism-funky.min.css
vendored
Normal file
8
js/lib/prism/prism-funky.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.1.
|
||||
* Original file: /npm/prismjs@1.20.0/themes/prism-funky.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
code[class*=language-],pre[class*=language-]{font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:.4em .8em;margin:.5em 0;overflow:auto;background:url('data:image/svg+xml;charset=utf-8,<svg%20version%3D"1.1"%20xmlns%3D"http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg"%20width%3D"100"%20height%3D"100"%20fill%3D"rgba(0%2C0%2C0%2C.2)">%0D%0A<polygon%20points%3D"0%2C50%2050%2C0%200%2C0"%20%2F>%0D%0A<polygon%20points%3D"0%2C100%2050%2C100%20100%2C50%20100%2C0"%20%2F>%0D%0A<%2Fsvg>');background-size:1em 1em}code[class*=language-]{background:#000;color:#fff;box-shadow:-.3em 0 0 .3em #000,.3em 0 0 .3em #000}:not(pre)>code[class*=language-]{padding:.2em;border-radius:.3em;box-shadow:none;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#aaa}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.number,.token.property,.token.symbol,.token.tag{color:#0cf}.token.attr-name,.token.builtin,.token.char,.token.selector,.token.string{color:#ff0}.language-css .token.string,.token.entity,.token.inserted,.token.operator,.token.url,.token.variable{color:#9acd32}.token.atrule,.token.attr-value,.token.keyword{color:#ff1493}.token.important,.token.regex{color:orange}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.deleted{color:red}pre.diff-highlight.diff-highlight>code .token.deleted:not(.prefix),pre>code.diff-highlight.diff-highlight .token.deleted:not(.prefix){background-color:rgba(255,0,0,.3);display:inline}pre.diff-highlight.diff-highlight>code .token.inserted:not(.prefix),pre>code.diff-highlight.diff-highlight .token.inserted:not(.prefix){background-color:rgba(0,255,128,.3);display:inline}
|
||||
/*# sourceMappingURL=/sm/97d19382f4cc980bcf43a22534277f236150c175652422db18877bcfa4253a9a.map */
|
||||
8
js/lib/prism/prism-line-numbers.min.css
vendored
Normal file
8
js/lib/prism/prism-line-numbers.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.1.
|
||||
* Original file: /npm/prismjs@1.20.0/plugins/line-numbers/prism-line-numbers.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
pre[class*=language-].line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}
|
||||
/*# sourceMappingURL=/sm/1804facaffb0dda5677f475a30cb4fd7f2e7e69d20f3351c07dc9498191181a4.map */
|
||||
8
js/lib/prism/prism-okaidia.min.css
vendored
Normal file
8
js/lib/prism/prism-okaidia.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.1.
|
||||
* Original file: /npm/prismjs@1.20.0/themes/prism-okaidia.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#272822}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#f8f8f2}.token.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#ae81ff}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#a6e22e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#e6db74}.token.keyword{color:#66d9ef}.token.important,.token.regex{color:#fd971f}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
|
||||
/*# sourceMappingURL=/sm/4d06843ca8b863038763f80d48cfee31fe7ab0b4328ab710c2c57eac6af458e3.map */
|
||||
8
js/lib/prism/prism-solarizedlight.min.css
vendored
Normal file
8
js/lib/prism/prism-solarizedlight.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.1.
|
||||
* Original file: /npm/prismjs@1.20.0/themes/prism-solarizedlight.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
code[class*=language-],pre[class*=language-]{color:#657b83;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{background:#073642}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{background:#073642}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background-color:#fdf6e3}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#93a1a1}.token.punctuation{color:#586e75}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#268bd2}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string,.token.url{color:#2aa198}.token.entity{color:#657b83;background:#eee8d5}.token.atrule,.token.attr-value,.token.keyword{color:#859900}.token.class-name,.token.function{color:#b58900}.token.important,.token.regex,.token.variable{color:#cb4b16}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
|
||||
/*# sourceMappingURL=/sm/2ebe3d0f213efcab2d9cb741c6a641a03620362e8e35f672019c372c387107d2.map */
|
||||
8
js/lib/prism/prism-tomorrow.min.css
vendored
Normal file
8
js/lib/prism/prism-tomorrow.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.1.
|
||||
* Original file: /npm/prismjs@1.20.0/themes/prism-tomorrow.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}
|
||||
/*# sourceMappingURL=/sm/1b15fe2971998a048aebb60f26f6eed76122071db9ef3b995abd003224f52a98.map */
|
||||
8
js/lib/prism/prism-twilight.min.css
vendored
Normal file
8
js/lib/prism/prism-twilight.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.1.
|
||||
* Original file: /npm/prismjs@1.20.0/themes/prism-twilight.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
code[class*=language-],pre[class*=language-]{color:#fff;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;text-shadow:0 -.1em .2em #000;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}:not(pre)>code[class*=language-],pre[class*=language-]{background:#141414}pre[class*=language-]{border-radius:.5em;border:.3em solid #545454;box-shadow:1px 1px .5em #000 inset;margin:.5em 0;overflow:auto;padding:1em}pre[class*=language-]::-moz-selection{background:#27292a}pre[class*=language-]::selection{background:#27292a}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:hsla(0,0%,93%,.15)}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:hsla(0,0%,93%,.15)}:not(pre)>code[class*=language-]{border-radius:.3em;border:.13em solid #545454;box-shadow:1px 1px .3em -.1em #000 inset;padding:.15em .2em .05em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#777}.token.punctuation{opacity:.7}.token.namespace{opacity:.7}.token.boolean,.token.deleted,.token.number,.token.tag{color:#ce6849}.token.builtin,.token.constant,.token.keyword,.token.property,.token.selector,.token.symbol{color:#f9ed99}.language-css .token.string,.style .token.string,.token.attr-name,.token.attr-value,.token.char,.token.entity,.token.inserted,.token.operator,.token.string,.token.url,.token.variable{color:#909e6a}.token.atrule{color:#7385a5}.token.important,.token.regex{color:#e8c062}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}pre[data-line]{padding:1em 0 1em 3em;position:relative}.language-markup .token.attr-name,.language-markup .token.punctuation,.language-markup .token.tag{color:#ac885c}.token{position:relative;z-index:1}.line-highlight{background:hsla(0,0%,33%,.25);background:linear-gradient(to right,hsla(0,0%,33%,.1) 70%,hsla(0,0%,33%,0));border-bottom:1px dashed #545454;border-top:1px dashed #545454;left:0;line-height:inherit;margin-top:.75em;padding:inherit 0;pointer-events:none;position:absolute;right:0;white-space:pre;z-index:0}.line-highlight:before,.line-highlight[data-end]:after{background-color:#8693a6;border-radius:999px;box-shadow:0 1px #fff;color:#f4f1ef;content:attr(data-start);font:bold 65%/1.5 sans-serif;left:.6em;min-width:1em;padding:0 .5em;position:absolute;text-align:center;text-shadow:none;top:.4em;vertical-align:.3em}.line-highlight[data-end]:after{bottom:.4em;content:attr(data-end);top:auto}
|
||||
/*# sourceMappingURL=/sm/4ab7eb92c4592b58ef2bb686cf2b45782b104a9491464bbe30b090a7296eff69.map */
|
||||
8
js/lib/prism/prism.min.css
vendored
Normal file
8
js/lib/prism/prism.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using clean-css v4.2.1.
|
||||
* Original file: /npm/prismjs@1.20.0/themes/prism.css
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
|
||||
/*# sourceMappingURL=/sm/928e23e6b9fcef82c5f1d1f05b6f7fc5a6e187c60195e59fbf16fc9d071ee057.map */
|
||||
33
js/loadaplayer.js
Normal file
33
js/loadaplayer.js
Normal file
@@ -0,0 +1,33 @@
|
||||
var aplayerconf = "<!-- 我使用的APlayer本体 -->"
|
||||
aplayerconf += "<div class=\"aplayer\" "
|
||||
aplayerconf += "data-id=\"" + musiclist + "\" "
|
||||
aplayerconf += "data-server=\"netease\" "
|
||||
aplayerconf += "data-type=\"playlist\" "
|
||||
aplayerconf += "data-fixed=\"true\" "
|
||||
aplayerconf += "data-autoplay=\"false\" "
|
||||
aplayerconf += "data-order=\"random\" "
|
||||
aplayerconf += "data-volume=\"0.55\" "
|
||||
aplayerconf += "data-preload=\"true\""
|
||||
aplayerconf += "data-mutex=\"true\""
|
||||
aplayerconf += "</div>"
|
||||
aplayerconf += "<!--如果将本体放在body里面导致页面加载出现问题,请尝试放到body体后面-->"
|
||||
|
||||
function removelrc() {
|
||||
//检测是否存在歌词按钮
|
||||
if (!document.querySelector(".aplayer-icon-lrc"))
|
||||
return;
|
||||
else
|
||||
{
|
||||
//触发以后立刻移除监听
|
||||
document.removeEventListener("DOMNodeInserted",removelrc);
|
||||
//稍作延时保证触发函数时存在按钮
|
||||
setTimeout(function() {
|
||||
//以触发按钮的方式隐藏歌词,防止在点击显示歌词按钮时需要点击两次才能出现的问题
|
||||
document.querySelector(".aplayer-icon-lrc").click();
|
||||
}, 1);
|
||||
// console.log("success");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMNodeInserted', removelrc)
|
||||
260
js/main.js
260
js/main.js
@@ -1,259 +1 @@
|
||||
(function($) {
|
||||
|
||||
skel.breakpoints({
|
||||
xlarge: '(max-width: 1680px)',
|
||||
large: '(max-width: 1280px)',
|
||||
medium: '(max-width: 980px)',
|
||||
small: '(max-width: 736px)',
|
||||
xsmall: '(max-width: 480px)',
|
||||
xxsmall: '(max-width: 360px)'
|
||||
});
|
||||
|
||||
/**
|
||||
* Applies parallax scrolling to an element's background image.
|
||||
* @return {jQuery} jQuery object.
|
||||
*/
|
||||
$.fn._parallax = function(intensity) {
|
||||
|
||||
var $window = $(window),
|
||||
$this = $(this);
|
||||
|
||||
if (this.length == 0 || intensity === 0)
|
||||
return $this;
|
||||
|
||||
if (this.length > 1) {
|
||||
|
||||
for (var i=0; i < this.length; i++)
|
||||
$(this[i])._parallax(intensity);
|
||||
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
if (!intensity)
|
||||
intensity = 0.25;
|
||||
|
||||
$this.each(function() {
|
||||
|
||||
var $t = $(this),
|
||||
$bg = $('<div class="bg"></div>').appendTo($t),
|
||||
on, off;
|
||||
|
||||
on = function() {
|
||||
|
||||
$bg
|
||||
.removeClass('fixed')
|
||||
.css('transform', 'none');
|
||||
|
||||
$window
|
||||
.on('scroll._parallax', function() {
|
||||
|
||||
$bg.css('transform', 'none');
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
off = function() {
|
||||
|
||||
$bg
|
||||
.addClass('fixed')
|
||||
.css('transform', 'none');
|
||||
|
||||
$window
|
||||
.off('scroll._parallax');
|
||||
|
||||
};
|
||||
|
||||
// Disable parallax on ..
|
||||
if (skel.vars.browser == 'ie' // IE
|
||||
|| skel.vars.browser == 'edge' // Edge
|
||||
|| window.devicePixelRatio > 1 // Retina/HiDPI (= poor performance)
|
||||
|| skel.vars.mobile) // Mobile devices
|
||||
off();
|
||||
|
||||
// Enable everywhere else.
|
||||
else {
|
||||
|
||||
skel.on('!large -large', on);
|
||||
skel.on('+large', off);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$window
|
||||
.off('load._parallax resize._parallax')
|
||||
.on('load._parallax resize._parallax', function() {
|
||||
$window.trigger('scroll');
|
||||
});
|
||||
|
||||
return $(this);
|
||||
|
||||
};
|
||||
|
||||
$(function() {
|
||||
|
||||
var $window = $(window),
|
||||
$body = $('body'),
|
||||
$wrapper = $('#wrapper'),
|
||||
$header = $('#header'),
|
||||
$nav = $('#nav'),
|
||||
$main = $('#main'),
|
||||
$navPanelToggle, $navPanel, $navPanelInner;
|
||||
|
||||
// Disable animations/transitions until the page has loaded.
|
||||
$window.on('load', function() {
|
||||
window.setTimeout(function() {
|
||||
$body.removeClass('is-loading');
|
||||
}, 100);
|
||||
});
|
||||
|
||||
// Prioritize "important" elements on medium.
|
||||
skel.on('+medium -medium', function() {
|
||||
$.prioritize(
|
||||
'.important\\28 medium\\29',
|
||||
skel.breakpoint('medium').active
|
||||
);
|
||||
});
|
||||
|
||||
// Scrolly.
|
||||
$('.scrolly').scrolly();
|
||||
|
||||
// Background.
|
||||
$wrapper._parallax(0.925);
|
||||
|
||||
// Nav Panel.
|
||||
|
||||
// Toggle.
|
||||
$navPanelToggle = $(
|
||||
'<a href="#navPanel" id="navPanelToggle">Menu</a>'
|
||||
)
|
||||
.appendTo($wrapper);
|
||||
|
||||
// Change toggle styling once we've scrolled past the header.
|
||||
$header.scrollex({
|
||||
bottom: '5vh',
|
||||
enter: function() {
|
||||
$navPanelToggle.removeClass('alt');
|
||||
},
|
||||
leave: function() {
|
||||
$navPanelToggle.addClass('alt');
|
||||
}
|
||||
});
|
||||
|
||||
// Panel.
|
||||
$navPanel = $(
|
||||
'<div id="navPanel">' +
|
||||
'<nav>' +
|
||||
'</nav>' +
|
||||
'<a href="#navPanel" class="close"></a>' +
|
||||
'</div>'
|
||||
)
|
||||
.appendTo($body)
|
||||
.panel({
|
||||
delay: 500,
|
||||
hideOnClick: true,
|
||||
hideOnSwipe: true,
|
||||
resetScroll: true,
|
||||
resetForms: true,
|
||||
side: 'right',
|
||||
target: $body,
|
||||
visibleClass: 'is-navPanel-visible'
|
||||
});
|
||||
|
||||
// Get inner.
|
||||
$navPanelInner = $navPanel.children('nav');
|
||||
|
||||
// Move nav content on breakpoint change.
|
||||
var $navContent = $nav.children();
|
||||
|
||||
skel.on('!medium -medium', function() {
|
||||
|
||||
// NavPanel -> Nav.
|
||||
$navContent.appendTo($nav);
|
||||
|
||||
// Flip icon classes.
|
||||
$nav.find('.icons, .icon')
|
||||
.removeClass('alt');
|
||||
|
||||
});
|
||||
|
||||
skel.on('+medium', function() {
|
||||
|
||||
// Nav -> NavPanel.
|
||||
$navContent.appendTo($navPanelInner);
|
||||
|
||||
// Flip icon classes.
|
||||
$navPanelInner.find('.icons, .icon')
|
||||
.addClass('alt');
|
||||
|
||||
});
|
||||
|
||||
// Hack: Disable transitions on WP.
|
||||
if (skel.vars.os == 'wp'
|
||||
&& skel.vars.osVersion < 10)
|
||||
$navPanel
|
||||
.css('transition', 'none');
|
||||
|
||||
// Intro.
|
||||
var $intro = $('#intro');
|
||||
|
||||
if ($intro.length > 0) {
|
||||
|
||||
// Hack: Fix flex min-height on IE.
|
||||
if (skel.vars.browser == 'ie') {
|
||||
$window.on('resize.ie-intro-fix', function() {
|
||||
|
||||
var h = $intro.height();
|
||||
|
||||
if (h > $window.height())
|
||||
$intro.css('height', 'auto');
|
||||
else
|
||||
$intro.css('height', h);
|
||||
|
||||
}).trigger('resize.ie-intro-fix');
|
||||
}
|
||||
|
||||
// Hide intro on scroll (> small).
|
||||
skel.on('!small -small', function() {
|
||||
|
||||
$main.unscrollex();
|
||||
|
||||
$main.scrollex({
|
||||
mode: 'bottom',
|
||||
top: '25vh',
|
||||
bottom: '-50vh',
|
||||
enter: function() {
|
||||
$intro.addClass('hidden');
|
||||
},
|
||||
leave: function() {
|
||||
$intro.removeClass('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Hide intro on scroll (<= small).
|
||||
skel.on('+small', function() {
|
||||
|
||||
$main.unscrollex();
|
||||
|
||||
$main.scrollex({
|
||||
mode: 'middle',
|
||||
top: '15vh',
|
||||
bottom: '-15vh',
|
||||
enter: function() {
|
||||
$intro.addClass('hidden');
|
||||
},
|
||||
leave: function() {
|
||||
$intro.removeClass('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
!function(){"use strict";console.log(" \nThis blog is using hexo-theme-kaze based on MIT license\nSee theme at https://github.com/theme-kaze/hexo-theme-kaze\n");const e=document.body.scrollWidth||document.documentElement.scrollWidth;let t=null;function o(e){const t=e.target,n=document.getElementById("mobiletoc");n&&t&&!n.contains(t)&&(n.style.display="none",window.mask.remove(),document.removeEventListener("click",o))}window.searchControlButton=null,e<=742?(t=document.getElementsByClassName("darkwidget")[0],window.searchControlButton=document.getElementsByClassName("searchwidget")[0]):(t=document.getElementsByClassName("darknavbar")[0],window.searchControlButton=document.getElementsByClassName("searchnavbar")[0]),t.addEventListener("click",(()=>{window.setDarkmode(window.reverseDarkModeSetting())}));const n=()=>{const e=document.getElementById("mobiletoc");if(!e)return;e.style.display="block";const t=document.createElement("div");t.id="mask",document.body.append(t),setTimeout((()=>{document.addEventListener("click",o)}),0)};setTimeout((()=>{const e=document.getElementById("menubutton");e&&(e.onclick=n)}),0);const l=()=>{const e=document.getElementById("scrollbutton"),t=document.getElementById("menubutton"),o=document.getElementById("popbutton"),n=document.body.scrollWidth||document.documentElement.scrollWidth;"1"===e.style.opacity?(e.style.bottom="32px",e.style.opacity="0",o.style.transform="none"):(o.style.transform="rotate(90deg)",e.style.bottom="85px",e.style.opacity="1");const l=document.getElementById("mobiletoc");n<=862&&l&&("1"===t.style.opacity?(t.style.right="32px",t.style.opacity="0"):(t.style.right="85px",t.style.opacity="1"));const s=document.querySelector(".darkwidget"),c=document.querySelector(".searchwidget");n<=742&&("1"===s.style.opacity?(s.style.bottom="32px",s.style.opacity="0",s.style.transform="none"):(s.style.display="flex",o.style.transform="rotate(90deg)",s.style.bottom="138px",s.style.opacity="1"),"1"===c.style.opacity?(c.style.bottom="32px",c.style.opacity="0",c.style.transform="none"):(c.style.display="flex",c.style.transform="rotate(90deg)",c.style.bottom="191px",c.style.opacity="1"))};setTimeout((()=>{document.getElementById("popbutton").addEventListener("click",l)}),0);const s=()=>{let e=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;e>1?(window.requestAnimationFrame(s),scrollTo(0,Math.floor(.85*e))):scrollTo(0,0)};function c(e){const t=document.querySelector("#local-search");if(!t.contains(e.target)){const e=document.querySelector("#search-input"),o=document.querySelector("#search-content");e.value="",t.style.display="none",o.innerHTML="",window.mask.remove(),document.removeEventListener("click",c)}}setTimeout((()=>{const e=document.getElementById("scrollbutton");e&&(e.onclick=s)}),0),setTimeout((()=>{window.searchControlButton&&window.searchControlButton.addEventListener("click",(()=>{const e=document.createElement("div");e.id="mask",document.body.append(e);document.querySelector("#local-search").style.display="block",setTimeout((()=>{document.addEventListener("click",c)}),0)}))})),window.localSearch=function(e){fetch(e).then((e=>e.json())).then((e=>{let t=document.getElementById("search-input"),o=document.getElementById("search-content");t.addEventListener("input",(function(){let t='<ul class="search-result-list">',n=this.value.trim().toLowerCase().replace(/[<>&"]/g,(e=>({"<":"<",">":">","&":"&",'"':"""}[e])));if(o.innerHTML="",!(this.value.trim().length<=0)){if(e.forEach((function(e){let o=!0;e.title&&""!==e.title.trim()||(e.title="Untitled");let l=e.title.trim().toLowerCase();const s=e.content.trim().replace(/<[^>]+>/g,"").toLowerCase();let c=-1;const i=l.indexOf(n);let r=0;if(""!==s&&(r=s.indexOf(n),c=r),i<0&&r<0&&(o=!1),r<0&&(c=0),o){t+=`<li><a href="${e.url}" class="search-result-title" >'${l}</a>`;const o=e.content;if(c>=0){const e=Math.max(0,c-12),l=Math.min(o.length,c+12);let s=o.substr(e,l);s=s.replace(new RegExp(n,"gi"),'<em class="search-keyword">'+n+"</em>"),t+='<p class="search-result">'+s+"...</p>"}t+="</li>"}})),t+="</ul>",-1===t.indexOf("<li>"))return o.innerHTML='<ul><span class="local-search-empty">没有搜索到结果<span></ul>';o.innerHTML=t}}))}))}}();
|
||||
|
||||
53
js/mathjax/mathjax.js
Normal file
53
js/mathjax/mathjax.js
Normal file
@@ -0,0 +1,53 @@
|
||||
(function () {
|
||||
var newMathJax = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js';
|
||||
var oldMathJax = 'cdn.mathjax.org/mathjax/latest/MathJax.js';
|
||||
|
||||
var replaceScript = function (script, src) {
|
||||
//
|
||||
// Make redirected script
|
||||
//
|
||||
var newScript = document.createElement('script');
|
||||
newScript.src = newMathJax + src.replace(/.*?(\?|$)/, '$1');
|
||||
//
|
||||
// Move onload and onerror handlers to new script
|
||||
//
|
||||
newScript.onload = script.onload;
|
||||
newScript.onerror = script.onerror;
|
||||
script.onload = script.onerror = null;
|
||||
//
|
||||
// Move any content (old-style configuration scripts)
|
||||
//
|
||||
while (script.firstChild) newScript.appendChild(script.firstChild);
|
||||
//
|
||||
// Copy script id
|
||||
//
|
||||
if (script.id != null) newScript.id = script.id;
|
||||
//
|
||||
// Replace original script with new one
|
||||
//
|
||||
script.parentNode.replaceChild(newScript, script);
|
||||
//
|
||||
// Issue a console warning
|
||||
//
|
||||
console.warn('WARNING: cdn.mathjax.org has been retired. Check https://www.mathjax.org/cdn-shutting-down/ for migration tips.')
|
||||
}
|
||||
|
||||
if (document.currentScript) {
|
||||
var script = document.currentScript;
|
||||
replaceScript(script, script.src);
|
||||
} else {
|
||||
//
|
||||
// Look for current script by searching for one with the right source
|
||||
//
|
||||
var n = oldMathJax.length;
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0; i < scripts.length; i++) {
|
||||
var script = scripts[i];
|
||||
var src = (script.src || '').replace(/.*?:\/\//, '');
|
||||
if (src.substr(0, n) === oldMathJax) {
|
||||
replaceScript(script, src);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
1343
js/obsidian.js
Normal file
1343
js/obsidian.js
Normal file
File diff suppressed because it is too large
Load Diff
1
js/obsidian.min.js
vendored
Normal file
1
js/obsidian.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
61
js/plugin.js
Normal file
61
js/plugin.js
Normal file
File diff suppressed because one or more lines are too long
137
js/scroll.js
Normal file
137
js/scroll.js
Normal file
@@ -0,0 +1,137 @@
|
||||
(function () {
|
||||
|
||||
/**
|
||||
* @description 监听滚动高度,是否显示返回顶部
|
||||
*/
|
||||
function myCustomFn(el) {
|
||||
if (el.mcs.top < -600) {
|
||||
if ($('#return-top').css('opacity') === '0') {
|
||||
$('#return-top').velocity('stop').velocity({opacity: 1}, {
|
||||
duration: 500,
|
||||
display: 'block'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$('#return-top').velocity('stop').velocity({opacity: 0}, {
|
||||
duration: 500,
|
||||
display: 'none'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 阅读进度
|
||||
* @param el
|
||||
*/
|
||||
function readPercent(el) {
|
||||
// console.log(el.mcs.content[0].offsetHeight);
|
||||
let percent = Math.round(-el.mcs.top / (el.mcs.content[0].offsetHeight - el.offsetHeight) * 100);
|
||||
$('.sidebar-toc-progress .progress-num').text(percent);
|
||||
$('.sidebar-toc-progress-bar').velocity('stop').velocity({width: percent + '%'}, {
|
||||
duration: 100,
|
||||
easing: 'easeInOutQuart'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 滚动到页面顶部
|
||||
*/
|
||||
$('#return-top').on('click', function () {
|
||||
$('#content-outer').mCustomScrollbar('scrollTo', 'top', {
|
||||
scrollInertia: 1000,
|
||||
scrollEasing: 'easeInOut'
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 滚动条修饰 - jquery 插件
|
||||
*/
|
||||
$('#content-outer').mCustomScrollbar({
|
||||
theme: 'minimal',
|
||||
axis: 'y', // horizontal scrollbar
|
||||
callbacks: {
|
||||
whileScrolling: function () {
|
||||
myCustomFn(this);
|
||||
readPercent(this);
|
||||
findHeadPosition(this);
|
||||
},
|
||||
onScroll: function () {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#sidebar-toc-content').mCustomScrollbar({
|
||||
theme: 'minimal',
|
||||
axis: 'y', // horizontal scrollbar
|
||||
callbacks: {}
|
||||
});
|
||||
|
||||
// $('figure.highlight').mCustomScrollbar({
|
||||
// theme: 'minimal',
|
||||
// axis: 'x', // horizontal scrollbar
|
||||
// mouseWheel: {
|
||||
// enable: false
|
||||
// },
|
||||
// callbacks: {}
|
||||
// });
|
||||
|
||||
/**
|
||||
* @description menu link scroll to content
|
||||
*/
|
||||
$('.sidebar-toc-content .toc-link').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
let _id = $(this).attr('href');
|
||||
$('#content-outer').mCustomScrollbar('scrollTo', _id, {
|
||||
scrollInertia: 500
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 找到当前页面的位置,更改 active 目录
|
||||
* @param el
|
||||
*/
|
||||
function findHeadPosition(el) {
|
||||
let currentId = '';
|
||||
const menuHeight = $('#menu-outer').height() + 1;
|
||||
// console.log(el.mcs);
|
||||
let list = $('#post').find('h1,h2,h3,h4,h5,h6');
|
||||
list.each(function () {
|
||||
if ($(this).offset().top <= menuHeight) {
|
||||
currentId = $(this).attr('id');
|
||||
}
|
||||
});
|
||||
$('.sidebar-toc-content .toc-link').removeClass('active');
|
||||
if (currentId === '') {
|
||||
// currentId = list[0].id;
|
||||
return;
|
||||
}
|
||||
let $this = $('.sidebar-toc-content .toc-link[href="#' + currentId + '"]');
|
||||
$this.addClass('active');
|
||||
let parents = $this.parents('.toc-child');
|
||||
if (parents.length > 0) {
|
||||
let child = null;
|
||||
parents.length > 1 ? child = parents.eq(parents.length - 1).find('.toc-child') : child = parents;
|
||||
if (child.length > 0 && child.is(':hidden')) {
|
||||
expandToc(child);
|
||||
}
|
||||
parents.eq(parents.length - 1).closest('.toc-item').siblings('.toc-item').find('.toc-child').hide();
|
||||
} else {
|
||||
if ($this.closest('.toc-item').find('.toc-child').is(':hidden')) {
|
||||
expandToc($this.closest('.toc-item').find('.toc-child'));
|
||||
}
|
||||
$this.closest('.toc-item').siblings('.toc-item').find('.toc-child').hide();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description expand toc-item
|
||||
* @param $item
|
||||
*/
|
||||
function expandToc($item) {
|
||||
// $item.show();
|
||||
$item.velocity('stop').velocity('fadeIn', {
|
||||
duration: 500,
|
||||
easing: 'easeInQuart'
|
||||
});
|
||||
}
|
||||
}());
|
||||
142
js/search.js
Normal file
142
js/search.js
Normal file
@@ -0,0 +1,142 @@
|
||||
// A local search script with the help of [hexo-generator-search](https://github.com/PaicHyperionDev/hexo-generator-search)
|
||||
// Copyright (C) 2017
|
||||
// Liam Huang <http://github.com/Liam0205>
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
// 02110-1301 USA
|
||||
//
|
||||
|
||||
var searchFunc = function (path, search_id, content_id) {
|
||||
// 0x00. environment initialization
|
||||
'use strict';
|
||||
var BTN = "<i id='local-search-close'></i>";
|
||||
var SEARCH_START = "<span>" + $('#local-search-result').data('start') + "</span>",
|
||||
SEARCH_INITIALISE = "<span class='local-search-empty'>" + $('#local-search-result').data('initialise') + "<span>",
|
||||
SEARCH_EMPTY = "<span class='local-search-empty'>" + $('#local-search-result').data('empty') + "<span>";
|
||||
var $input = document.getElementById(search_id);
|
||||
var $resultContent = document.getElementById(content_id);
|
||||
$resultContent.innerHTML = BTN + "<ul>" + SEARCH_INITIALISE + "</ul>";
|
||||
$.ajax({
|
||||
// 0x01. load xml file
|
||||
url: path,
|
||||
dataType: "xml",
|
||||
success: function (xmlResponse) {
|
||||
// 0x02. parse xml file
|
||||
var datas = $("entry", xmlResponse).map(function () {
|
||||
return {
|
||||
title: $("title", this).text(),
|
||||
content: $("content", this).text(),
|
||||
url: $("url", this).text()
|
||||
};
|
||||
}).get();
|
||||
$resultContent.innerHTML = "";
|
||||
|
||||
$input.addEventListener('input', function () {
|
||||
// 0x03. parse query to keywords list
|
||||
var str = '<ul class=\"search-result-list\">';
|
||||
var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
|
||||
$resultContent.innerHTML = "";
|
||||
if (this.value.trim().length <= 0) {
|
||||
$('#local-search-result').html(SEARCH_START);
|
||||
return;
|
||||
}
|
||||
// 0x04. perform local searching
|
||||
datas.forEach(function (data) {
|
||||
var isMatch = true;
|
||||
var content_index = [];
|
||||
if (!data.title || data.title.trim() === '') {
|
||||
data.title = "Untitled";
|
||||
}
|
||||
var orig_data_title = data.title.trim();
|
||||
var data_title = orig_data_title.toLowerCase();
|
||||
var orig_data_content = data.content.trim().replace(/<[^>]+>/g, "");
|
||||
var data_content = orig_data_content.toLowerCase();
|
||||
var data_url = /^\//.test(data.url) ? '' : '/' + data.url;
|
||||
var index_title = -1;
|
||||
var index_content = -1;
|
||||
var first_occur = -1;
|
||||
// only match artiles with not empty contents
|
||||
if (data_content !== '') {
|
||||
keywords.forEach(function (keyword, i) {
|
||||
index_title = data_title.indexOf(keyword);
|
||||
index_content = data_content.indexOf(keyword);
|
||||
|
||||
if (index_title < 0 && index_content < 0) {
|
||||
isMatch = false;
|
||||
} else {
|
||||
if (index_content < 0) {
|
||||
index_content = 0;
|
||||
}
|
||||
if (i == 0) {
|
||||
first_occur = index_content;
|
||||
}
|
||||
// content_index.push({index_content:index_content, keyword_len:keyword_len});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
isMatch = false;
|
||||
}
|
||||
// 0x05. show search results
|
||||
if (isMatch) {
|
||||
str += "<li><a href='" + data_url + "' class='search-result-title posttitle' target='_blank'>" + orig_data_title + "</a>";
|
||||
var content = orig_data_content;
|
||||
if (first_occur >= 0) {
|
||||
// cut out 100 characters
|
||||
var start = first_occur - 20;
|
||||
var end = first_occur + 80;
|
||||
|
||||
if (start < 0) {
|
||||
start = 0;
|
||||
}
|
||||
|
||||
if (start == 0) {
|
||||
end = 100;
|
||||
}
|
||||
|
||||
if (end > content.length) {
|
||||
end = content.length;
|
||||
}
|
||||
|
||||
var match_content = content.substr(start, end);
|
||||
|
||||
// highlight all keywords
|
||||
keywords.forEach(function (keyword) {
|
||||
var regS = new RegExp(keyword, "gi");
|
||||
match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
|
||||
});
|
||||
|
||||
str += "<p class=\"search-result\">" + match_content + "...</p>";
|
||||
}
|
||||
str += "</li>";
|
||||
}
|
||||
});
|
||||
str += "</ul>";
|
||||
if (str.indexOf('<li>') === -1) {
|
||||
$resultContent.innerHTML = BTN + "<ul>" + SEARCH_EMPTY + "</ul>";
|
||||
return;
|
||||
}
|
||||
$resultContent.innerHTML = BTN + str;
|
||||
});
|
||||
}
|
||||
});
|
||||
$(document).on('click', '#local-search-close', function() {
|
||||
$('#local-search-input').val('');
|
||||
$('#local-search-result').html(SEARCH_START);
|
||||
});
|
||||
};
|
||||
|
||||
var getSearchFile = function(){
|
||||
var path = "/search.xml";
|
||||
searchFunc(path, 'local-search-input', 'local-search-result');
|
||||
};
|
||||
219
js/search/algolia.js
Normal file
219
js/search/algolia.js
Normal file
@@ -0,0 +1,219 @@
|
||||
(function () {
|
||||
$('a.social-icon.search').on('click', function () {
|
||||
$('body').css('width', '100%');
|
||||
$('body').css('overflow', 'hidden');
|
||||
$('.search-dialog').velocity('stop').velocity('fadeIn', {
|
||||
duration: 300,
|
||||
complete: function () {
|
||||
$('.ais-search-box--input').focus();
|
||||
}
|
||||
});
|
||||
$('.search-mask').velocity('stop').velocity('fadeIn', {
|
||||
duration: 300
|
||||
});
|
||||
|
||||
// shortcut: ESC
|
||||
document.addEventListener('keydown', function f(event) {
|
||||
if (event.code === 'Escape') {
|
||||
closeSearch();
|
||||
document.removeEventListener('keydown', f);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var closeSearch = function () {
|
||||
$('body').css('overflow', 'auto');
|
||||
$('.search-dialog').velocity('stop').velocity('fadeOut', {
|
||||
duration: 300
|
||||
});
|
||||
$('.search-mask').velocity('stop').velocity('fadeOut', {
|
||||
duration: 300
|
||||
});
|
||||
};
|
||||
$('.search-mask, .search-close-button').on('click', closeSearch);
|
||||
|
||||
|
||||
var algolia = window.GLOBAL_CONFIG.algolia;
|
||||
var isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName;
|
||||
if (!isAlgoliaValid) {
|
||||
return console.error('Algolia setting is invalid!');
|
||||
}
|
||||
|
||||
var search = instantsearch({
|
||||
appId: algolia.appId,
|
||||
apiKey: algolia.apiKey,
|
||||
indexName: algolia.indexName,
|
||||
routing: true,
|
||||
searchParameters: {
|
||||
hitsPerPage: algolia.hits.per_page || 10
|
||||
}
|
||||
// searchFunction: function (helper) {
|
||||
// var searchInput = $('#search-box').find('input');
|
||||
// if (searchInput.val()) {
|
||||
// helper.search();
|
||||
// }
|
||||
// }
|
||||
});
|
||||
|
||||
// initialize currentRefinedValues
|
||||
// search.addWidget(
|
||||
// instantsearch.widgets.currentRefinedValues({
|
||||
// container: '#current-refined-values',
|
||||
// // This widget can also contain a clear all link to remove all filters,
|
||||
// // we disable it in this example since we use `clearAll` widget on its own.
|
||||
// clearAll: false
|
||||
// })
|
||||
// );
|
||||
|
||||
// initialize clearAll
|
||||
// search.addWidget(
|
||||
// instantsearch.widgets.clearAll({
|
||||
// container: '#clear-all',
|
||||
// templates: {
|
||||
// link: 'Reset everything'
|
||||
// },
|
||||
// autoHideContainer: false
|
||||
// })
|
||||
// );
|
||||
|
||||
// initialize pagination
|
||||
search.addWidget(
|
||||
instantsearch.widgets.pagination({
|
||||
container: '#algolia-pagination',
|
||||
scrollTo: false,
|
||||
showFirstLast: false,
|
||||
labels: {
|
||||
first: '<i class="fa fa-angle-double-left"></i>',
|
||||
last: '<i class="fa fa-angle-double-right"></i>',
|
||||
previous: '<i class="fa fa-angle-left"></i>',
|
||||
next: '<i class="fa fa-angle-right"></i>'
|
||||
},
|
||||
cssClasses: {
|
||||
root: 'pagination',
|
||||
item: 'pagination-item',
|
||||
link: 'page-number',
|
||||
active: 'current',
|
||||
disabled: 'disabled-item'
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// initialize RefinementList
|
||||
// search.addWidget(
|
||||
// instantsearch.widgets.refinementList({
|
||||
// container: '#refinement-list',
|
||||
// attributeName: 'categories'
|
||||
// })
|
||||
// );
|
||||
|
||||
// initialize SearchBox
|
||||
search.addWidget(
|
||||
instantsearch.widgets.searchBox({
|
||||
container: '#search-box',
|
||||
placeholder: window.GLOBAL_CONFIG.algolia.languages.input_placeholder
|
||||
})
|
||||
);
|
||||
|
||||
search.addWidget(
|
||||
instantsearch.widgets.hits({
|
||||
container: '#hits',
|
||||
templates: {
|
||||
item: function (data) {
|
||||
var link = data.permalink ? data.permalink : (window.GLOBAL_CONFIG.root + data.path);
|
||||
return (
|
||||
'<a href="' + link + '" class="algolia-hit-item-link">' +
|
||||
data._highlightResult.title.value +
|
||||
'</a>'
|
||||
);
|
||||
},
|
||||
empty: function (data) {
|
||||
return (
|
||||
'<div id="algolia-hits-empty">' +
|
||||
window.GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/, data.query) +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
},
|
||||
cssClasses: {
|
||||
item: 'algolia-hit-item'
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// search.addWidget(
|
||||
// instantsearch.widgets.searchBox({
|
||||
// container: '#algolia-search-input',
|
||||
// reset: false,
|
||||
// magnifier: false,
|
||||
// placeholder: window.GLOBAL_CONFIG.algolia.languages.input_placeholder
|
||||
// })
|
||||
// );
|
||||
// search.addWidget(
|
||||
// instantsearch.widgets.hits({
|
||||
// container: '#algolia-hits',
|
||||
// templates: {
|
||||
// item: function (data) {
|
||||
// var link = data.permalink ? data.permalink : (window.GLOBAL_CONFIG.root + data.path);
|
||||
// return (
|
||||
// '<a href="' + link + '" class="algolia-hit-item-link">' +
|
||||
// data._highlightResult.title.value +
|
||||
// '</a>'
|
||||
// );
|
||||
// },
|
||||
// empty: function (data) {
|
||||
// return (
|
||||
// '<div id="algolia-hits-empty">' +
|
||||
// window.GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/, data.query) +
|
||||
// '</div>'
|
||||
// );
|
||||
// }
|
||||
// },
|
||||
// cssClasses: {
|
||||
// item: 'algolia-hit-item'
|
||||
// }
|
||||
// })
|
||||
// );
|
||||
//
|
||||
// search.addWidget(
|
||||
// instantsearch.widgets.stats({
|
||||
// container: '#algolia-stats',
|
||||
// templates: {
|
||||
// body: function (data) {
|
||||
// var stats = window.GLOBAL_CONFIG.algolia.languages.hits_stats
|
||||
// .replace(/\$\{hits}/, data.nbHits)
|
||||
// .replace(/\$\{time}/, data.processingTimeMS);
|
||||
// return (
|
||||
// '<hr>' +
|
||||
// stats +
|
||||
// '<span class="algolia-logo pull-right">' +
|
||||
// ' <img src="' + window.GLOBAL_CONFIG.root + 'img/algolia.svg" alt="Algolia" />' +
|
||||
// '</span>'
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// )
|
||||
//
|
||||
// search.addWidget(
|
||||
// instantsearch.widgets.pagination({
|
||||
// container: '#algolia-pagination',
|
||||
// scrollTo: false,
|
||||
// showFirstLast: false,
|
||||
// labels: {
|
||||
// first: '<i class="fa fa-angle-double-left"></i>',
|
||||
// last: '<i class="fa fa-angle-double-right"></i>',
|
||||
// previous: '<i class="fa fa-angle-left"></i>',
|
||||
// next: '<i class="fa fa-angle-right"></i>'
|
||||
// },
|
||||
// cssClasses: {
|
||||
// root: 'pagination',
|
||||
// item: 'pagination-item',
|
||||
// link: 'page-number',
|
||||
// active: 'current',
|
||||
// disabled: 'disabled-item'
|
||||
// }
|
||||
// })
|
||||
// );
|
||||
|
||||
search.start();
|
||||
})();
|
||||
116
js/sidebar.js
Normal file
116
js/sidebar.js
Normal file
@@ -0,0 +1,116 @@
|
||||
(function() {
|
||||
/**
|
||||
* @description 侧边栏展开/隐藏
|
||||
* @let open true -展开状态; false -收缩状态
|
||||
*/
|
||||
$('#side-button').on('click', function() {
|
||||
let open = $('#side-button').hasClass('close');
|
||||
if (open) {
|
||||
$('#side-button').removeClass('close');
|
||||
$('#sidebar').velocity('stop').velocity({ left: '-300px' }, 800, 'spring');
|
||||
$('#main-container').velocity('stop').velocity({ marginLeft: '0px' }, 800, 'spring');
|
||||
} else {
|
||||
$('#side-button').addClass('close');
|
||||
$('#sidebar').velocity('stop').velocity({ left: '0px' }, 800, 'spring');
|
||||
$('#main-container').velocity('stop').velocity({ marginLeft: '300px' }, 800, 'spring');
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 文章详情页面侧边栏切换文章与概览
|
||||
*/
|
||||
$('.toggle-sidebar-info span').on('click', function() {
|
||||
let toggleText = $(this).attr('data-toggle');
|
||||
$(this).attr('data-toggle', $(this).text());
|
||||
$(this).text(toggleText);
|
||||
if ($('#sidebar .author-info').is(':visible')) {
|
||||
$('#sidebar .author-info').velocity('stop').velocity({
|
||||
left: '80px',
|
||||
opacity: 0
|
||||
}, {
|
||||
duration: 300,
|
||||
display: 'none',
|
||||
easing: 'ease-in',
|
||||
complete: function() {
|
||||
$('#sidebar .sidebar-toc').velocity('stop').velocity({
|
||||
opacity: 1,
|
||||
left: 0
|
||||
}, {
|
||||
duration: 500,
|
||||
display: 'block',
|
||||
easing: 'ease-out'
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#sidebar .sidebar-toc').velocity('stop').velocity({
|
||||
opacity: 0,
|
||||
left: '-80px'
|
||||
}, {
|
||||
duration: 300,
|
||||
display: 'none',
|
||||
easing: 'ease-in',
|
||||
complete: function() {
|
||||
$('#sidebar .author-info').velocity('stop').velocity({
|
||||
left: '0px',
|
||||
opacity: 1
|
||||
}, {
|
||||
duration: 500,
|
||||
display: 'flex',
|
||||
easing: 'ease-out'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// let left = $('#sidebar .sidebar-toc').css('left');
|
||||
// if (left === '0px') {
|
||||
// $('#sidebar .sidebar-toc').velocity('stop').velocity({
|
||||
// left: '-80px',
|
||||
// opacity: '0'
|
||||
// }, {
|
||||
// duration: 300,
|
||||
// easing: 'easeInQuart',
|
||||
// display: 'none',
|
||||
// component: function () {
|
||||
// $('#sidebar .author-info').velocity('stop').velocity({
|
||||
// left: '0px',
|
||||
// opacity: '1'
|
||||
// }, {
|
||||
// duration: 300,
|
||||
// easing: 'easeOutQuart',
|
||||
// display: 'flex'
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// $('#sidebar .author-info').velocity('stop').velocity({
|
||||
// left: '80px',
|
||||
// opacity: '0'
|
||||
// }, {
|
||||
// duration: 300,
|
||||
// easing: 'easeInQuart',
|
||||
// display: 'none',
|
||||
// component: function () {
|
||||
// $('#sidebar .sidebar-toc').velocity('stop').velocity({
|
||||
// left: '0px',
|
||||
// opacity: '1'
|
||||
// }, {
|
||||
// duration: 300,
|
||||
// easing: 'easeOutQuart',
|
||||
// display: 'block'
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
});
|
||||
/**
|
||||
* @description 为toc-link添加URI解码,适配Hexo 5.0.0+
|
||||
*/
|
||||
var list = document.getElementsByClassName('toc-link');
|
||||
for (var i in list) {
|
||||
if (list.hasOwnProperty(i)) {
|
||||
var tochref = decodeURI(list[i].getAttribute('href'));
|
||||
list[i].href = tochref;
|
||||
}
|
||||
}
|
||||
}());
|
||||
2
js/thirdparty/jquery-3.3.1.min.js
vendored
Normal file
2
js/thirdparty/jquery-3.3.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
js/thirdparty/jquery.mCustomScrollbar.concat.min.js
vendored
Normal file
5
js/thirdparty/jquery.mCustomScrollbar.concat.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
js/thirdparty/velocity.min.js
vendored
Normal file
4
js/thirdparty/velocity.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
62
js/utils.js
Normal file
62
js/utils.js
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* created by lvfan
|
||||
* 2018-09-04
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description 获取实时时间,写入 id 为 now-time 的标签中
|
||||
*/
|
||||
(function () {
|
||||
const divTime = document.getElementById('now-time');
|
||||
|
||||
function getTime() {
|
||||
let time = new Date();
|
||||
let hour = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
|
||||
let minute = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
|
||||
let second = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
|
||||
divTime.innerText = hour + ':' + minute + ':' + second;
|
||||
}
|
||||
|
||||
getTime();
|
||||
setInterval(function () {
|
||||
getTime();
|
||||
}, 1000);
|
||||
}());
|
||||
|
||||
/**
|
||||
* @description 判断当前页面是否为活动页
|
||||
*/
|
||||
(function () {
|
||||
// 网页当前状态判断
|
||||
let state, visibilityChange, status, doc = document;
|
||||
if (typeof document.hidden !== 'undefined') {
|
||||
visibilityChange = 'visibilitychange';
|
||||
state = 'visibilityState';
|
||||
} else if (typeof document.mozHidden !== 'undefined') {
|
||||
visibilityChange = 'mozvisibilitychange';
|
||||
state = 'mozVisibilityState';
|
||||
} else if (typeof document.msHidden !== 'undefined') {
|
||||
visibilityChange = 'msvisibilitychange';
|
||||
state = 'msVisibilityState';
|
||||
} else if (typeof document.webkitHidden !== 'undefined') {
|
||||
visibilityChange = 'webkitvisibilitychange';
|
||||
state = 'webkitVisibilityState';
|
||||
}
|
||||
let docText = doc.title;
|
||||
// 添加监听器,在title里显示状态变化
|
||||
doc.addEventListener(visibilityChange, function () {
|
||||
if (doc[state] === 'visible') {
|
||||
doc.title = '欢迎回来!d(`・∀・)b 👏';
|
||||
status = setTimeout(() => {
|
||||
doc.title = docText;
|
||||
}, 1000);
|
||||
} else {
|
||||
doc.title = '藏起来了d(`x_x)b';
|
||||
if (status) {
|
||||
clearTimeout(status);
|
||||
}
|
||||
}
|
||||
}, false);
|
||||
// 初始化页面状态
|
||||
// doc.title = '吕钒的后花园';
|
||||
}());
|
||||
Reference in New Issue
Block a user