/*Initial Variables*/
var mashiro_option = new Object();
var mashiro_global = new Object();
mashiro_option.NProgressON = true;
/*
* 邮箱信息之类的东西可以填在这里,这些js变量基本都作用于sakura-app.js
* 这样的设置仅是为了方便在基于PHP开发的主题中设置js变量,既然移植到了Node上,我想或许可以精简这一逻辑吧
*/
mashiro_option.email_domain = "";
mashiro_option.email_name = "";
mashiro_option.cookie_version_control = "";
mashiro_option.qzone_autocomplete = false;
mashiro_option.site_name = "墨染云华技术站";
mashiro_option.author_name = "墨染云华技术站";
mashiro_option.site_url = "https://anania.staswit.name";
mashiro_option.v_appId = "GyC3NzMvd0hT9Yyd2hYIC0MN-gzGzoHsz";
mashiro_option.v_appKey = "mgOpfzbkHYqU92CV4IDlAUHQ";
mashiro_option.mathjax = "0";
mashiro_option.qq_api_url = "https://api.mashiro.top/qqinfo/";
mashiro_option.qq_avatar_api_url = "https://api.mashiro.top/qqinfo/";
// mashiro_option.jsdelivr_css_src = "https://cdn.jsdelivr.net/gh/moezx/cdn@3.4.5/css/lib.min.css";
// mashiro_option.float_player_on = true;
/*End of Initial Variables*/
var bg = "https://api-misc.iclart.com/v1/acgapi,https://i.xinger.ink:4443/images.php,https://api.dongmanxingkong.com/suijitupian/acg/1080p/index.php".split(",");
var bgindex = Math.floor(Math.random()*bg.length);
if (!!window.ActiveXObject || "ActiveXObject" in window) { //is IE?
alert('朋友,IE浏览器未适配哦~');
}
.hljs-ln{border-collapse:collapse}.hljs-ln td{padding:0}.hljs-ln-n:before{content:attr(data-line-number)}
(function (window) {
var INSIGHT_CONFIG = {
TRANSLATION: {
POSTS: 'Posts',
// PAGES: 'Pages',
CATEGORIES: 'Categories',
TAGS: 'Tags',
},
ROOT_URL: '/',
CONTENT_URL: '/content.json',
};
window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
fetch('https://counts.42cloud.cn/api/counts.html')
.then(response => response.json())
.then(data => {
if (document.getElementById("readcount")) {
document.getElementById("readcount").innerHTML=data.Count;
}
if (document.getElementById("allcount")){
document.getElementById("allcount").innerHTML=data.Allcount;
}
})
.catch(err => console.error(err))
/*
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
var Poi = {
"pjax": "1",
"movies": {"url": "https://cdn.jsdelivr.net/gh/honjun/hojun@1.2", "name": "Unbroken.mp4", "live": "close"},
"windowheight": "fixed",
"codelamp": "close",
"ajaxurl": "",
"order": "asc",
"formpostion": "bottom"
};
} else {
var Poi = {
"pjax": "1",
"movies": {"url": "https://cdn.jsdelivr.net/gh/honjun/hojun@1.2", "name": "Unbroken.mp4", "live": "open"},
"windowheight": "auto",
"codelamp": "close",
"ajaxurl": "",
"order": "asc",
"formpostion": "bottom"
};
}
/* ]]> */
$(document).ready(function () {
if ($(".toc").length > 0 && document.body.clientWidth > 1200) {
if ($(".pattern-center").length > 0) { //有图的情况
tocbot.init({
// Where to render the table of contents.
tocSelector: '.toc', // 放置目录的容器
// Where to grab the headings to build the table of contents.
contentSelector: '.entry-content', // 正文内容所在
// Which headings to grab inside of the contentSelector element.
scrollSmooth: true,
headingSelector: 'h1, h2, h3, h4, h5', // 需要索引的标题级别
headingsOffset: -400,
scrollSmoothOffset: -85
});
} else {
tocbot.init({
// Where to render the table of contents.
tocSelector: '.toc', // 放置目录的容器
// Where to grab the headings to build the table of contents.
contentSelector: '.entry-content', // 正文内容所在
// Which headings to grab inside of the contentSelector element.
scrollSmooth: true,
headingSelector: 'h1, h2, h3, h4, h5', // 需要索引的标题级别
headingsOffset: -85,
scrollSmoothOffset: -85
});
}
var offsetTop = $('.toc').offset().top - 95;
window.onscroll = function () {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
if (scrollTop >= offsetTop) {
$('.toc').addClass('toc-fixed');
} else {
$('.toc').removeClass('toc-fixed');
}
}
}
});
function NewDate(str) {
str = str.split('-');
var date = new Date();
date.setUTCFullYear(str[0], str[1] - 1, str[2]);
date.setUTCHours(0, 0, 0, 0);
return date;
}
function momxc() {
var birthDay = NewDate("2020-12-13");
var today = new Date();
var timeold = today.getTime() - birthDay.getTime();
var sectimeold = timeold / 1000
var secondsold = Math.floor(sectimeold);
var msPerDay = 24 * 60 * 60 * 1000;
var e_daysold = timeold / msPerDay;
var daysold = Math.floor(e_daysold);
var e_hrsold = (daysold - e_daysold) * -24;
var hrsold = Math.floor(e_hrsold);
var e_minsold = (hrsold - e_hrsold) * -60;
var minsold = Math.floor((hrsold - e_hrsold) * -60);
var seconds = Math.floor((minsold - e_minsold) * -60).toString();
document.getElementById("momk").innerHTML = "本站已安全运行" + daysold + "天" + hrsold + "小时" + minsold + "分" + seconds + "秒";
setTimeout(momxc, 1000);
}
momxc();
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
chakhsu(document.getElementById("chakhsu"), data.hitokoto);
})
.catch(err => console.error(err));
// 文字循环处理 两个参数,第一个是需要显示在哪个标签内append 以id为选择器,第二个参数是 要处理的文字
function chakhsu(r, text) {
function t() {
return b[Math.floor(Math.random() * b.length)];
}
function e() {
return String.fromCharCode(94 * Math.random() + 33);
}
function n(r) {
for (var n = document.createDocumentFragment(), i = 0; r > i; i++) {
var l = document.createElement("span");
(l.textContent = e()), (l.style.color = t()), n.appendChild(l);
}
return n;
}
function i() {
var t = o[c.skillI];
c.step
? c.step--
: ((c.step = g),
c.prefixP < l.length
? (c.prefixP >= 0 && (c.text += l[c.prefixP]), c.prefixP++)
: "forward" === c.direction
? c.skillP < t.length
? ((c.text += t[c.skillP]), c.skillP++)
: c.delay
? c.delay--
: ((c.direction = "backward"), (c.delay = a))
: c.skillP > 0
? ((c.text = c.text.slice(0, -1)), c.skillP--)
: ((c.skillI = (c.skillI + 1) % o.length),
(c.direction = "forward"))),
(r.textContent = c.text),
r.appendChild(
n(
c.prefixP < l.length
? Math.min(s, s + c.prefixP)
: Math.min(s, t.length - c.skillP)
)
),
setTimeout(i, d);
}
/*以下内容自定义修改*/
var l = "",
o = [text].map(function (r) {
return r + "";
}),
a = 3,
g = 1,
s = 5,
d = 75,
b = [
"rgb(110,64,170)",
"rgb(150,61,179)",
"rgb(191,60,175)",
"rgb(228,65,157)",
"rgb(254,75,131)",
"rgb(255,94,99)",
"rgb(255,120,71)",
"rgb(251,150,51)",
"rgb(226,183,47)",
"rgb(198,214,60)",
"rgb(175,240,91)",
"rgb(127,246,88)",
"rgb(82,246,103)",
"rgb(48,239,130)",
"rgb(29,223,163)",
"rgb(26,199,194)",
"rgb(35,171,216)",
"rgb(54,140,225)",
"rgb(76,110,219)",
"rgb(96,84,200)"
],
c = {
text: "",
prefixP: -s,
skillI: 0,
skillP: 0,
direction: "forward",
delay: a,
step: g
};
i();
}
.aplayer .aplayer-lrc {
height: 35px;
}
.aplayer .aplayer-lrc p{
font-size: 16px;
font-weight: 700;
line-height: 18px !important;
}
.aplayer .aplayer-lrc p.aplayer-lrc-current{
color: #FF1493;
}
.aplayer.aplayer-narrow .aplayer-body{
left: -66px !important;
}
.aplayer.aplayer-fixed .aplayer-lrc {
display: none;
}
.aplayer .aplayer-lrc.aplayer-lrc-hide {
display:none !important;
}
.aplayer.aplayer-fixed .lrc-show {
display: block;
background: rgba(255, 255, 255, 0.8);
}
switch="true"
id="387364422"
server="netease"
type="playlist"
fixed="true"
autoplay="false"
loop="all"
order="random"
preload="auto"
volume="0.7"
mutex="true"
$(function(){
$('body').on('click', '.aplayer', function(){
if($('.aplayer-button').hasClass('aplayer-play')) {
$('.aplayer-lrc').removeClass('lrc-show');
} else {
$('.aplayer-lrc').addClass('lrc-show');
}
})
});