q78kgblog 0.0.0-1720441708496 → 0.0.0-1720859005089
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/404.html +3 -3
- package/about/index.html +5 -5
- package/archives/2023/02/index.html +4 -4
- package/archives/2023/04/index.html +4 -4
- package/archives/2023/05/index.html +4 -4
- package/archives/2023/08/index.html +4 -4
- package/archives/2023/09/index.html +4 -4
- package/archives/2023/index.html +4 -4
- package/archives/2024/01/index.html +4 -4
- package/archives/2024/02/index.html +4 -4
- package/archives/2024/index.html +4 -4
- package/archives/index.html +4 -4
- package/atom.xml +9 -9
- package/baidusitemap.xml +8 -8
- package/bangumis/index.html +4 -4
- package/bigpie/index.html +3 -3
- package/categories/Hexo/index.html +4 -4
- package/categories/index.html +3 -3
- package/categories//345/271/264/347/273/210/346/200/273/347/273/223/index.html +4 -4
- package/categories//347/264/240/346/235/220/index.html +4 -4
- package/categories//351/227/262/350/201/212/346/235/202/350/260/210/index.html +4 -4
- package/content.json +1 -1
- package/css/404page.css +1 -65
- package/css/ariasakablog.css +1 -6669
- package/css/commentBarrage.css +1 -118
- package/css/danmaku.css +1 -106
- package/css/essay.css +1 -306
- package/css/iconfont.css +1 -55
- package/css/index.css +1 -7006
- package/css/people.css +1 -18
- package/css/stylessimple.css +1 -40
- package/css/swiperstyle.css +1 -567
- package/fcircle/index.html +3 -3
- package/fontawesome/index.html +3 -3
- package/index.html +11 -11
- package/js/aplayersave.js +1 -268
- package/js/baiduhistory.js +1 -76
- package/js/browser.js +1 -35
- package/js/calendar.js +1 -380
- package/js/cate.js +1 -22
- package/js/commentBarrage.js +17 -232
- package/js/commentsCount.js +1 -43
- package/js/copy.js +1 -23
- package/js/countup.js +1 -209
- package/js/cursor.js +1 -82
- package/js/danmaku.js +0 -106
- package/js/day.js +13 -195
- package/js/dianzan.js +1 -249
- package/js/dis.js +4 -252
- package/js/dist/baiduhistory.dev.js +1 -102
- package/js/dist/bbtalk.dev.js +159 -12872
- package/js/dist/bbtalklunbo.dev.js +1 -45
- package/js/dist/calendar.dev.js +1 -395
- package/js/dist/fixbugpjax.dev.js +1 -8
- package/js/dist/gongnong.dev.js +1 -565
- package/js/dist/heimu.dev.js +1 -19
- package/js/dist/links.dev.js +1 -13
- package/js/dist/main.dev.js +5 -843
- package/js/dist/resizeTop.dev.js +1 -50
- package/js/dist/seo.dev.js +1 -33
- package/js/dist/twikoo.all.min.dev.js +946 -1
- package/js/fixbugpjax.js +1 -7
- package/js/fixed_card_widget.js +1 -46
- package/js/fps.js +1 -58
- package/js/gitalker.js +1 -11
- package/js/heimu.js +1 -16
- package/js/hide.show.js +1 -17
- package/js/languages.js +1 -511
- package/js/latest.js +1 -49
- package/js/local-search.js +2 -476
- package/js/lunar.js +1 -1071
- package/js/lyxTalk.js +1 -12
- package/js/main.js +5 -781
- package/js/nav.js +1 -30
- package/js/noie.js +1 -3
- package/js/owo.js +1 -52
- package/js/people.js +2 -175
- package/js/randomFriend.js +1 -95
- package/js/resizeTop.js +1 -43
- package/js/rightmenu.js +3 -333
- package/js/sakura.js +1 -164
- package/js/search/algolia.js +4 -154
- package/js/search/local-search.js +1 -188
- package/js/settings.js +3 -343
- package/js/sitetime.js +1 -25
- package/js/smooth-scrolling.js +1 -546
- package/js/sw-toolbox.js +1 -16
- package/js/swiperinit.js +1 -23
- package/js/tw_cn.js +1 -100
- package/js/utils.js +1 -278
- package/js/welcome.js +1 -107
- package/js/welcomeconsole.js +1 -23
- package/links/index.html +3 -3
- package/othersite/index.html +3 -3
- package/package.json +1 -1
- package/posts/164ef646/index.html +6 -6
- package/posts/228c2ef8/index.html +6 -6
- package/posts/a9a6c1fb/index.html +6 -6
- package/posts/c262e439/index.html +6 -6
- package/posts/c81531cf/index.html +6 -6
- package/posts/ccdf7cfc/index.html +6 -6
- package/posts/de1f83f4/index.html +6 -6
- package/posts/e54f7476/index.html +6 -6
- package/sitemap.xml +49 -49
- package/sw.js +2 -193
- package/swReg.js +1 -29
- package/tags/AI/index.html +5 -5
- package/tags/Butterfly/index.html +5 -5
- package/tags/Cloudflare/index.html +5 -5
- package/tags/DiffSinger/index.html +5 -5
- package/tags/Hexo/index.html +5 -5
- package/tags/Next/index.html +5 -5
- package/tags/RAID/index.html +5 -5
- package/tags/Vercel/index.html +5 -5
- package/tags/Workers/index.html +5 -5
- package/tags/index.html +3 -3
- package/tags//344/270/273/351/242/230/index.html +5 -5
- package/tags//345/206/231/344/275/234/index.html +5 -5
- package/tags//345/245/263/346/200/247/346/204/217/350/257/206/index.html +5 -5
- package/tags//345/255/246/344/271/240/index.html +5 -5
- package/tags//345/256/266/351/207/214/344/272/221/index.html +5 -5
- package/tags//345/271/264/347/273/210/346/200/273/347/273/223/index.html +5 -5
- package/tags//346/212/230/350/205/276/index.html +5 -5
- package/tags//346/227/245/345/270/270/index.html +5 -5
- package/tags//346/234/215/345/212/241/345/231/250/index.html +5 -5
- package/tags//346/265/252/346/275/256/index.html +5 -5
- package/tags//347/256/200/347/210/261/index.html +5 -5
- package/tags//350/207/252/345/212/250/346/240/207/346/263/250/index.html +5 -5
- package/tags//350/256/272/346/226/207/index.html +5 -5
- package/tags//350/260/267/346/255/214/347/277/273/350/257/221/index.html +5 -5
- package/tags//350/264/237/350/275/275/345/235/207/350/241/241/index.html +5 -5
- package/tags//351/207/221/345/217/245/index.html +5 -5
- package/tags//351/255/224/346/224/271/index.html +5 -5
@@ -1,188 +1 @@
|
|
1
|
-
window.addEventListener(
|
2
|
-
let loadFlag = false
|
3
|
-
let dataObj = []
|
4
|
-
const $searchMask = document.getElementById('search-mask')
|
5
|
-
|
6
|
-
const openSearch = () => {
|
7
|
-
const bodyStyle = document.body.style
|
8
|
-
bodyStyle.width = '100%'
|
9
|
-
bodyStyle.overflow = 'hidden'
|
10
|
-
btf.animateIn($searchMask, 'to_show 0.5s')
|
11
|
-
btf.animateIn(document.querySelector('#local-search .search-dialog'), 'titleScale 0.5s')
|
12
|
-
setTimeout(() => { document.querySelector('#local-search-input input').focus() }, 100)
|
13
|
-
if (!loadFlag) {
|
14
|
-
search()
|
15
|
-
loadFlag = true
|
16
|
-
}
|
17
|
-
// shortcut: ESC
|
18
|
-
document.addEventListener('keydown', function f (event) {
|
19
|
-
if (event.code === 'Escape') {
|
20
|
-
closeSearch()
|
21
|
-
document.removeEventListener('keydown', f)
|
22
|
-
}
|
23
|
-
})
|
24
|
-
}
|
25
|
-
|
26
|
-
const closeSearch = () => {
|
27
|
-
const bodyStyle = document.body.style
|
28
|
-
bodyStyle.width = ''
|
29
|
-
bodyStyle.overflow = ''
|
30
|
-
btf.animateOut(document.querySelector('#local-search .search-dialog'), 'search_close .5s')
|
31
|
-
btf.animateOut($searchMask, 'to_hide 0.5s')
|
32
|
-
}
|
33
|
-
|
34
|
-
const searchClickFn = () => {
|
35
|
-
document.querySelector('#search-button > .search').addEventListener('click', openSearch)
|
36
|
-
}
|
37
|
-
|
38
|
-
const searchClickFnOnce = () => {
|
39
|
-
document.querySelector('#local-search .search-close-button').addEventListener('click', closeSearch)
|
40
|
-
$searchMask.addEventListener('click', closeSearch)
|
41
|
-
if (GLOBAL_CONFIG.localSearch.preload) dataObj = fetchData(GLOBAL_CONFIG.localSearch.path)
|
42
|
-
}
|
43
|
-
|
44
|
-
// check url is json or not
|
45
|
-
const isJson = url => {
|
46
|
-
const reg = /\.json$/
|
47
|
-
return reg.test(url)
|
48
|
-
}
|
49
|
-
|
50
|
-
const fetchData = async (path) => {
|
51
|
-
let data = []
|
52
|
-
const response = await fetch(path)
|
53
|
-
if (isJson(path)) {
|
54
|
-
data = await response.json()
|
55
|
-
} else {
|
56
|
-
const res = await response.text()
|
57
|
-
const t = await new window.DOMParser().parseFromString(res, 'text/xml')
|
58
|
-
const a = await t
|
59
|
-
data = [...a.querySelectorAll('entry')].map(item =>{
|
60
|
-
return {
|
61
|
-
title: item.querySelector('title').textContent,
|
62
|
-
content: item.querySelector('content') && item.querySelector('content').textContent,
|
63
|
-
url: item.querySelector('url').textContent
|
64
|
-
}
|
65
|
-
})
|
66
|
-
}
|
67
|
-
if (response.ok) {
|
68
|
-
const $loadDataItem = document.getElementById('loading-database')
|
69
|
-
$loadDataItem.nextElementSibling.style.display = 'block'
|
70
|
-
$loadDataItem.remove()
|
71
|
-
}
|
72
|
-
return data
|
73
|
-
}
|
74
|
-
|
75
|
-
const search = () => {
|
76
|
-
if (!GLOBAL_CONFIG.localSearch.preload) {
|
77
|
-
dataObj = fetchData(GLOBAL_CONFIG.localSearch.path)
|
78
|
-
}
|
79
|
-
|
80
|
-
const $input = document.querySelector('#local-search-input input')
|
81
|
-
const $resultContent = document.getElementById('local-search-results')
|
82
|
-
const $loadingStatus = document.getElementById('loading-status')
|
83
|
-
|
84
|
-
$input.addEventListener('input', function () {
|
85
|
-
const keywords = this.value.trim().toLowerCase().split(/[\s]+/)
|
86
|
-
if (keywords[0] !== '') $loadingStatus.innerHTML = '<i class="fas fa-spinner fa-pulse"></i>'
|
87
|
-
|
88
|
-
$resultContent.innerHTML = ''
|
89
|
-
let str = '<div class="search-result-list">'
|
90
|
-
if (keywords.length <= 0) return
|
91
|
-
let count = 0
|
92
|
-
// perform local searching
|
93
|
-
dataObj.then(data => {
|
94
|
-
data.forEach(data => {
|
95
|
-
let isMatch = true
|
96
|
-
let dataTitle = data.title ? data.title.trim().toLowerCase() : ''
|
97
|
-
const dataContent = data.content ? data.content.trim().replace(/<[^>]+>/g, '').toLowerCase() : ''
|
98
|
-
const dataUrl = data.url.startsWith('/') ? data.url : GLOBAL_CONFIG.root + data.url
|
99
|
-
let indexTitle = -1
|
100
|
-
let indexContent = -1
|
101
|
-
let firstOccur = -1
|
102
|
-
// only match articles with not empty titles and contents
|
103
|
-
if (dataTitle !== '' || dataContent !== '') {
|
104
|
-
keywords.forEach((keyword, i) => {
|
105
|
-
indexTitle = dataTitle.indexOf(keyword)
|
106
|
-
indexContent = dataContent.indexOf(keyword)
|
107
|
-
if (indexTitle < 0 && indexContent < 0) {
|
108
|
-
isMatch = false
|
109
|
-
} else {
|
110
|
-
if (indexContent < 0) {
|
111
|
-
indexContent = 0
|
112
|
-
}
|
113
|
-
if (i === 0) {
|
114
|
-
firstOccur = indexContent
|
115
|
-
}
|
116
|
-
}
|
117
|
-
})
|
118
|
-
} else {
|
119
|
-
isMatch = false
|
120
|
-
}
|
121
|
-
|
122
|
-
// show search results
|
123
|
-
if (isMatch) {
|
124
|
-
if (firstOccur >= 0) {
|
125
|
-
// cut out 130 characters
|
126
|
-
// let start = firstOccur - 30 < 0 ? 0 : firstOccur - 30
|
127
|
-
// let end = firstOccur + 50 > dataContent.length ? dataContent.length : firstOccur + 50
|
128
|
-
let start = firstOccur - 30
|
129
|
-
let end = firstOccur + 100
|
130
|
-
let pre = ''
|
131
|
-
let post = ''
|
132
|
-
|
133
|
-
if (start < 0) {
|
134
|
-
start = 0
|
135
|
-
}
|
136
|
-
|
137
|
-
if (start === 0) {
|
138
|
-
end = 100
|
139
|
-
} else {
|
140
|
-
pre = '...'
|
141
|
-
}
|
142
|
-
|
143
|
-
if (end > dataContent.length) {
|
144
|
-
end = dataContent.length
|
145
|
-
} else {
|
146
|
-
post = '...'
|
147
|
-
}
|
148
|
-
|
149
|
-
let matchContent = dataContent.substring(start, end)
|
150
|
-
|
151
|
-
// highlight all keywords
|
152
|
-
keywords.forEach(keyword => {
|
153
|
-
const regS = new RegExp(keyword, 'gi')
|
154
|
-
matchContent = matchContent.replace(regS, '<span class="search-keyword">' + keyword + '</span>')
|
155
|
-
dataTitle = dataTitle.replace(regS, '<span class="search-keyword">' + keyword + '</span>')
|
156
|
-
})
|
157
|
-
|
158
|
-
str += '<div class="local-search__hit-item"><a href="' + dataUrl + '" class="search-result-title">' + dataTitle + '</a>'
|
159
|
-
count += 1
|
160
|
-
|
161
|
-
if (dataContent !== '') {
|
162
|
-
str += '<p class="search-result">' + pre + matchContent + post + '</p>'
|
163
|
-
}
|
164
|
-
}
|
165
|
-
str += '</div>'
|
166
|
-
}
|
167
|
-
})
|
168
|
-
if (count === 0) {
|
169
|
-
str += '<div id="local-search__hits-empty">' + GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/, this.value.trim()) +
|
170
|
-
'</div>'
|
171
|
-
}
|
172
|
-
str += '</div>'
|
173
|
-
$resultContent.innerHTML = str
|
174
|
-
if (keywords[0] !== '') $loadingStatus.innerHTML = ''
|
175
|
-
window.pjax && window.pjax.refresh($resultContent)
|
176
|
-
})
|
177
|
-
})
|
178
|
-
}
|
179
|
-
|
180
|
-
searchClickFn()
|
181
|
-
searchClickFnOnce()
|
182
|
-
|
183
|
-
// pjax
|
184
|
-
window.addEventListener('pjax:complete', () => {
|
185
|
-
!btf.isHidden($searchMask) && closeSearch()
|
186
|
-
searchClickFn()
|
187
|
-
})
|
188
|
-
})
|
1
|
+
window.addEventListener("load",()=>{let g=!1,p=[];const h=document.getElementById("search-mask"),_=()=>{const e=document.body.style;e.width="100%",e.overflow="hidden",btf.animateIn(h,"to_show 0.5s"),btf.animateIn(document.querySelector("#local-search .search-dialog"),"titleScale 0.5s"),setTimeout(()=>{document.querySelector("#local-search-input input").focus()},100),g||(G(),g=!0),document.addEventListener("keydown",function t(s){s.code==="Escape"&&(f(),document.removeEventListener("keydown",t))})},f=()=>{const e=document.body.style;e.width="",e.overflow="",btf.animateOut(document.querySelector("#local-search .search-dialog"),"search_close .5s"),btf.animateOut(h,"to_hide 0.5s")},v=()=>{document.querySelector("#search-button > .search").addEventListener("click",_)},I=()=>{document.querySelector("#local-search .search-close-button").addEventListener("click",f),h.addEventListener("click",f),GLOBAL_CONFIG.localSearch.preload&&(p=O(GLOBAL_CONFIG.localSearch.path))},q=e=>/\.json$/.test(e),O=async e=>{let t=[];const s=await fetch(e);if(q(e))t=await s.json();else{const n=await s.text();t=[...(await await new window.DOMParser().parseFromString(n,"text/xml")).querySelectorAll("entry")].map(o=>({title:o.querySelector("title").textContent,content:o.querySelector("content")&&o.querySelector("content").textContent,url:o.querySelector("url").textContent}))}if(s.ok){const n=document.getElementById("loading-database");n.nextElementSibling.style.display="block",n.remove()}return t},G=()=>{GLOBAL_CONFIG.localSearch.preload||(p=O(GLOBAL_CONFIG.localSearch.path));const e=document.querySelector("#local-search-input input"),t=document.getElementById("local-search-results"),s=document.getElementById("loading-status");e.addEventListener("input",function(){const n=this.value.trim().toLowerCase().split(/[\s]+/);n[0]!==""&&(s.innerHTML='<i class="fas fa-spinner fa-pulse"></i>'),t.innerHTML="";let a='<div class="search-result-list">';if(n.length<=0)return;let y=0;p.then(o=>{o.forEach(c=>{let w=!0,d=c.title?c.title.trim().toLowerCase():"";const r=c.content?c.content.trim().replace(/<[^>]+>/g,"").toLowerCase():"",k=c.url.startsWith("/")?c.url:GLOBAL_CONFIG.root+c.url;let C=-1,u=-1,m=-1;if(d!==""||r!==""?n.forEach((l,i)=>{C=d.indexOf(l),u=r.indexOf(l),C<0&&u<0?w=!1:(u<0&&(u=0),i===0&&(m=u))}):w=!1,w){if(m>=0){let l=m-30,i=m+100,E="",b="";l<0&&(l=0),l===0?i=100:E="...",i>r.length?i=r.length:b="...";let L=r.substring(l,i);n.forEach(S=>{const x=new RegExp(S,"gi");L=L.replace(x,'<span class="search-keyword">'+S+"</span>"),d=d.replace(x,'<span class="search-keyword">'+S+"</span>")}),a+='<div class="local-search__hit-item"><a href="'+k+'" class="search-result-title">'+d+"</a>",y+=1,r!==""&&(a+='<p class="search-result">'+E+L+b+"</p>")}a+="</div>"}}),y===0&&(a+='<div id="local-search__hits-empty">'+GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/,this.value.trim())+"</div>"),a+="</div>",t.innerHTML=a,n[0]!==""&&(s.innerHTML=""),window.pjax&&window.pjax.refresh(t)})})};v(),I(),window.addEventListener("pjax:complete",()=>{!btf.isHidden(h)&&f(),v()})});
|
package/js/settings.js
CHANGED
@@ -1,353 +1,13 @@
|
|
1
|
-
document.addEventListener(
|
2
|
-
document.addEventListener('DOMContentLoaded', tosetting);
|
3
|
-
function tosetting(){
|
4
|
-
$("#settingWindow").hide();
|
5
|
-
if(localStorage.getItem("blur")=="false"){
|
6
|
-
blur=0;
|
7
|
-
}else{
|
8
|
-
blur=1;
|
9
|
-
|
10
|
-
}
|
11
|
-
if(localStorage.getItem("yjjs")=="true"){
|
12
|
-
yjjs=1;
|
13
|
-
}else{
|
14
|
-
yjjs=0;
|
15
|
-
|
16
|
-
}
|
17
|
-
if(localStorage.getItem("fpson")==undefined){
|
18
|
-
localStorage.setItem("fpson","1");
|
19
|
-
}
|
20
|
-
if(!blur){
|
21
|
-
document.getElementById("settingStyle").innerText=`
|
1
|
+
document.addEventListener("pjax:complete",tosetting),document.addEventListener("DOMContentLoaded",tosetting);function tosetting(){$("#settingWindow").hide(),localStorage.getItem("blur")=="false"?blur=0:blur=1,localStorage.getItem("yjjs")=="true"?yjjs=1:yjjs=0,localStorage.getItem("fpson")==null&&localStorage.setItem("fpson","1"),blur?document.getElementById("settingStyle").innerText="":document.getElementById("settingStyle").innerText=`
|
22
2
|
*,*:not(.card-info)::before,*::after{
|
23
3
|
-webkit-backdrop-filter: none!important;
|
24
4
|
backdrop-filter: none!important;
|
25
5
|
-webkit-filter: none!important;
|
26
6
|
filter: none!important;
|
27
|
-
}
|
28
|
-
else{
|
29
|
-
document.getElementById("settingStyle").innerText=''
|
30
|
-
}
|
31
|
-
setBlur=function(){
|
32
|
-
blur=!blur;
|
33
|
-
localStorage.setItem("blur",blur);
|
34
|
-
if(!blur){
|
35
|
-
document.getElementById("settingStyle").innerText=`
|
7
|
+
}`,setBlur=function(){blur=!blur,localStorage.setItem("blur",blur),blur?document.getElementById("settingStyle").innerText="":document.getElementById("settingStyle").innerText=`
|
36
8
|
*{
|
37
9
|
-webkit-backdrop-filter: none!important;
|
38
10
|
backdrop-filter: none!important;
|
39
11
|
-webkit-filter: none!important;
|
40
12
|
filter: none!important;
|
41
|
-
}`}
|
42
|
-
else{
|
43
|
-
document.getElementById("settingStyle").innerText=''
|
44
|
-
}
|
45
|
-
}
|
46
|
-
// if(yjjs){
|
47
|
-
// document.getElementById("yjjs").innerText=`
|
48
|
-
// *:not(#web_bg){
|
49
|
-
// transform:translateZ(0);
|
50
|
-
// backface-visibility: hidden
|
51
|
-
// }`}
|
52
|
-
// else{
|
53
|
-
// document.getElementById("yjjs").innerText=``
|
54
|
-
// }
|
55
|
-
yjjs1=function(){
|
56
|
-
yjjs=!yjjs;
|
57
|
-
localStorage.setItem("yjjs",yjjs)
|
58
|
-
// if(yjjs){
|
59
|
-
// document.getElementById("yjjs").innerText=`
|
60
|
-
// *:not(#web_bg){
|
61
|
-
// transform:translateZ(0);
|
62
|
-
// backface-visibility: hidden
|
63
|
-
// }`}
|
64
|
-
// else{
|
65
|
-
// document.getElementById("yjjs").innerText=``
|
66
|
-
// }
|
67
|
-
}
|
68
|
-
if(localStorage.getItem("blogTheme")=="acrylic"){
|
69
|
-
document.getElementById("css").href="";
|
70
|
-
}
|
71
|
-
switchTheme=function(){
|
72
|
-
if(document.getElementById("css").href==window.location.protocol+"//"+window.location.host+"/css/stylessimple.css"){
|
73
|
-
document.getElementById("css").href=""
|
74
|
-
localStorage.setItem("blogTheme","acrylic");
|
75
|
-
}else{
|
76
|
-
document.getElementById("css").href="/css/stylessimple.css"
|
77
|
-
localStorage.setItem("blogTheme","simple");
|
78
|
-
}
|
79
|
-
}
|
80
|
-
setColor=function(c){
|
81
|
-
document.getElementById("themeColor").innerText=`:root{--lyx-theme:var(--lyx-${c})!important}`;
|
82
|
-
localStorage.setItem("themeColor",c);
|
83
|
-
|
84
|
-
}
|
85
|
-
setFont=function(n){
|
86
|
-
localStorage.setItem("font",n);
|
87
|
-
if(n=="main"){
|
88
|
-
var s=document.querySelectorAll("body,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.aplayer")
|
89
|
-
for(var i = 0; i <s.length; i++) {
|
90
|
-
s[i].style.fontFamily="-apple-system, IBM Plex Mono ,monospace,'微软雅黑', sans-serif"
|
91
|
-
}
|
92
|
-
}
|
93
|
-
else if(n=="HYPailou"){
|
94
|
-
var s=document.querySelectorAll("body,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.aplayer")
|
95
|
-
for(var i = 0; i <s.length; i++) {
|
96
|
-
s[i].style.fontFamily="Fredoka,HYPailou,KyoukashoProL,-apple-system, IBM Plex Mono ,monospace,'微软雅黑', sans-serif"
|
97
|
-
}
|
98
|
-
}
|
99
|
-
else{
|
100
|
-
var s=document.querySelectorAll("body,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.aplayer")
|
101
|
-
for(var i = 0; i <s.length; i++) {
|
102
|
-
s[i].style.fontFamily="var(--global-font),KyoukashoProL,-apple-system, IBM Plex Mono ,monosapce,\"微软雅黑\", sans-serif"
|
103
|
-
}
|
104
|
-
document.body.style.fontFamily="var(--global-font),KyoukashoProL,-apple-system, IBM Plex Mono ,monosapce,'微软雅黑', sans-serif"
|
105
|
-
document.documentElement.style.setProperty('--global-font', n)
|
106
|
-
}
|
107
|
-
}
|
108
|
-
if(localStorage.getItem("themeColor")==undefined){
|
109
|
-
localStorage.setItem("themeColor","pink");
|
110
|
-
}
|
111
|
-
|
112
|
-
setColor(localStorage.getItem("themeColor"));
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
if(localStorage.getItem("hideRightside")==undefined){
|
117
|
-
localStorage.setItem("hideRightside","0");
|
118
|
-
}
|
119
|
-
|
120
|
-
if(localStorage.getItem("hideRightside")=="1"){
|
121
|
-
$("#rightside").toggle()
|
122
|
-
}
|
123
|
-
toggleRightside=function(){
|
124
|
-
$("#rightside").toggle();
|
125
|
-
localStorage.setItem("hideRightside",Math.abs(Number(localStorage.getItem("hideRightside"))-1))
|
126
|
-
}
|
127
|
-
if(localStorage.getItem("font")==undefined){
|
128
|
-
localStorage.setItem("font","HYTMR")
|
129
|
-
}
|
130
|
-
setFont(localStorage.getItem("font"))
|
131
|
-
// 存数据
|
132
|
-
// name:命名 data:数据
|
133
|
-
saveData=function(name, data) {
|
134
|
-
localStorage.setItem(name, JSON.stringify({ 'time': Date.now(), 'data': data }))
|
135
|
-
}
|
136
|
-
|
137
|
-
// 取数据
|
138
|
-
// name:命名 time:过期时长,单位分钟,如传入30,即加载数据时如果超出30分钟返回0,否则返回数据
|
139
|
-
loadData=function(name, time) {
|
140
|
-
let d = JSON.parse(localStorage.getItem(name));
|
141
|
-
// 过期或有错误返回 0 否则返回数据
|
142
|
-
if (d) {
|
143
|
-
let t = Date.now() - d.time
|
144
|
-
if (t < (time * 60 * 1000) && t > -1) return d.data;
|
145
|
-
}
|
146
|
-
return 0;
|
147
|
-
}
|
148
|
-
// 切换背景函数
|
149
|
-
// 此处的flag是为了每次读取时都重新存储一次,导致过期时间不稳定
|
150
|
-
// 如果flag为0则存储,即设置背景. 为1则不存储,即每次加载自动读取背景.
|
151
|
-
changeBg=function(s, flag) {
|
152
|
-
let bg = document.getElementById('web_bg')
|
153
|
-
if (s.charAt(0) == '#') {
|
154
|
-
bg.style.backgroundColor = s
|
155
|
-
bg.style.backgroundImage = 'none'
|
156
|
-
} else bg.style.backgroundImage = s
|
157
|
-
if (!flag) { saveData('blogbg', s) }
|
158
|
-
}
|
159
|
-
// 上面两个函数如果你有其他需要存取数据的功能,也可以直接使用
|
160
|
-
|
161
|
-
// 读取背景
|
162
|
-
try {
|
163
|
-
let data = loadData('blogbg', 1440)
|
164
|
-
if (data) changeBg(data, 1)
|
165
|
-
else localStorage.removeItem('blogbg');
|
166
|
-
} catch (error) { localStorage.removeItem('blogbg'); }
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
fpssw=function(){
|
171
|
-
if(localStorage.getItem("fpson")=="1"){
|
172
|
-
localStorage.setItem("fpson","0");
|
173
|
-
}else{
|
174
|
-
localStorage.setItem("fpson","1");
|
175
|
-
}
|
176
|
-
}
|
177
|
-
$(".asetting").hide();
|
178
|
-
$('#backer').hide();
|
179
|
-
$("#"+localStorage.getItem("themeColor")).attr("checked", true);
|
180
|
-
if(localStorage.getItem("blur")=="false"){
|
181
|
-
document.getElementById("blur").checked=true;
|
182
|
-
}
|
183
|
-
if(localStorage.getItem("yjjs")=="true"){
|
184
|
-
document.getElementById("yjjs").checked=true;
|
185
|
-
}
|
186
|
-
if(localStorage.getItem("fpson")=="1"){
|
187
|
-
document.getElementById("fpson").checked=true;
|
188
|
-
}
|
189
|
-
|
190
|
-
|
191
|
-
if(localStorage.getItem("sakurahide")=="false"){
|
192
|
-
document.getElementById("hideSakura").checked=true;
|
193
|
-
isSakura=1;
|
194
|
-
}
|
195
|
-
else if(localStorage.getItem("sakurahide")==null){
|
196
|
-
localStorage.setItem("sakurahide","false");
|
197
|
-
document.getElementById("hideSakura").checked=true;
|
198
|
-
isSakura=1;
|
199
|
-
}
|
200
|
-
else{
|
201
|
-
setTimeout(
|
202
|
-
stopp,1000);
|
203
|
-
isSakura=0;
|
204
|
-
}
|
205
|
-
if(localStorage.getItem("aplayerhide")=="false"){
|
206
|
-
document.getElementById("hideAplayer").checked=true;
|
207
|
-
}
|
208
|
-
else if(localStorage.getItem("aplayerhide")==null){
|
209
|
-
localStorage.setItem("aplayerhide","false");
|
210
|
-
document.getElementById("hideAplayer").checked=true;
|
211
|
-
}
|
212
|
-
else{
|
213
|
-
doStuff=function() {
|
214
|
-
flag=0;
|
215
|
-
try{
|
216
|
-
ap=aplayers[0];
|
217
|
-
ap.list;
|
218
|
-
flag=1;
|
219
|
-
}catch{
|
220
|
-
setTimeout(doStuff, 50);
|
221
|
-
return;
|
222
|
-
}
|
223
|
-
if(flag){
|
224
|
-
$(".aplayer-fixed").hide()
|
225
|
-
}
|
226
|
-
}
|
227
|
-
doStuff();
|
228
|
-
|
229
|
-
}
|
230
|
-
|
231
|
-
document.getElementsByClassName("reSettings")[0].onclick=function(){
|
232
|
-
localStorage.clear()
|
233
|
-
window.location.reload()
|
234
|
-
}
|
235
|
-
|
236
|
-
toggleWinbox=function(){
|
237
|
-
$("#settingWindow").fadeToggle();
|
238
|
-
if(document.getElementById("settingWindow").style.display!="none"){
|
239
|
-
document.getElementById("settingWindow").style.display="flex";
|
240
|
-
}
|
241
|
-
}
|
242
|
-
fullScreen=function() {
|
243
|
-
if (document.fullscreenElement) document.exitFullscreen()
|
244
|
-
else document.documentElement.requestFullscreen();
|
245
|
-
}
|
246
|
-
toggleAside=function(){
|
247
|
-
const $htmlDom = document.documentElement.classList
|
248
|
-
$htmlDom.contains('hide-aside')
|
249
|
-
? saveToLocal.set('aside-status', 'show', 2)
|
250
|
-
: saveToLocal.set('aside-status', 'hide', 2)
|
251
|
-
$htmlDom.toggle('hide-aside')
|
252
|
-
}
|
253
|
-
toggleAplayer=function(){
|
254
|
-
$(".aplayer-fixed").toggle()
|
255
|
-
if(localStorage.getItem("aplayerhide")=="true"){
|
256
|
-
localStorage.setItem("aplayerhide",false);
|
257
|
-
}
|
258
|
-
else{
|
259
|
-
localStorage.setItem("aplayerhide",true);
|
260
|
-
}
|
261
|
-
}
|
262
|
-
// position = $(window).scrollTop();
|
263
|
-
// $(window).scroll(function () {
|
264
|
-
|
265
|
-
// scroll = $(window).scrollTop();
|
266
|
-
|
267
|
-
// if (scroll > position) {
|
268
|
-
// document.getElementsByTagName("header")[0].style.transform="translateY(58px)";
|
269
|
-
// } else {
|
270
|
-
|
271
|
-
|
272
|
-
// document.getElementsByTagName("header")[0].style.transform="";
|
273
|
-
|
274
|
-
// }
|
275
|
-
|
276
|
-
// position = scroll;
|
277
|
-
// });
|
278
|
-
toggleSakuras=function(){
|
279
|
-
isSakura=!isSakura;
|
280
|
-
stopp(isSakura);
|
281
|
-
if(localStorage.getItem("sakurahide")=="true"){
|
282
|
-
localStorage.setItem("sakurahide",false);
|
283
|
-
}
|
284
|
-
else{
|
285
|
-
localStorage.setItem("sakurahide",true);
|
286
|
-
}
|
287
|
-
}
|
288
|
-
switchAside=function(){
|
289
|
-
if(left){
|
290
|
-
document.getElementById("aside-content").classList.add("right");
|
291
|
-
document.querySelector(".layout > div:first-child").classList.add("left");
|
292
|
-
localStorage.setItem("leftAside","false");
|
293
|
-
}
|
294
|
-
else{
|
295
|
-
document.getElementById("aside-content").className="aside-content";
|
296
|
-
document.querySelector(".layout > div:first-child").className="";
|
297
|
-
try{
|
298
|
-
document.querySelector("#recent-posts").className="recent-posts";
|
299
|
-
}catch(err){}localStorage.setItem("leftAside","true");}
|
300
|
-
left=!left;
|
301
|
-
}
|
302
|
-
left=1;
|
303
|
-
if(localStorage.getItem("leftAside")=="true"||localStorage.getItem("leftAside")==null){
|
304
|
-
|
305
|
-
}else{
|
306
|
-
switchAside();
|
307
|
-
}
|
308
|
-
if(localStorage.getItem("autoTheme")=="true"){
|
309
|
-
document.getElementById("autoTheme").checked=true;
|
310
|
-
$("#con-mode,.rightMenu-item:has(.fa-moon)").hide();
|
311
|
-
var time=new Date();
|
312
|
-
if(time.getHours()<=7||time.getHours()>=19){
|
313
|
-
activateDarkMode()
|
314
|
-
localStorage.removeItem("theme");
|
315
|
-
}
|
316
|
-
else{
|
317
|
-
activateLightMode()
|
318
|
-
localStorage.removeItem("theme");
|
319
|
-
}
|
320
|
-
}
|
321
|
-
if(location.href.indexOf('posts')!=-1){
|
322
|
-
var xhr = new XMLHttpRequest();
|
323
|
-
var url = document.querySelector('#page-header').style.backgroundImage.split('url("')[1].split('")')[0];
|
324
|
-
xhr.open("GET","https://apis.yisous.xyz/api/imageColor?imgurl="+url, true);
|
325
|
-
xhr.send();
|
326
|
-
xhr.onreadystatechange = function () {
|
327
|
-
if (xhr.readyState===4) {
|
328
|
-
if(xhr.status===200) {
|
329
|
-
document.getElementById("themeColor").innerText=`:root{--lyx-theme:${xhr.responseText}!important}`;
|
330
|
-
}
|
331
|
-
}
|
332
|
-
}
|
333
|
-
}
|
334
|
-
toggleAutoTheme=()=>{
|
335
|
-
if(localStorage.getItem("autoTheme")=="true"){
|
336
|
-
localStorage.setItem("autoTheme","false");
|
337
|
-
$("#con-mode,.rightMenu-item:has(.fa-moon)").show();
|
338
|
-
}
|
339
|
-
else{
|
340
|
-
localStorage.setItem("autoTheme","true");
|
341
|
-
var time=new Date();
|
342
|
-
if(time.getHours()<=7||time.getHours()>=19){
|
343
|
-
activateDarkMode()
|
344
|
-
localStorage.removeItem("theme");
|
345
|
-
}
|
346
|
-
else{
|
347
|
-
activateLightMode()
|
348
|
-
localStorage.removeItem("theme");
|
349
|
-
}
|
350
|
-
$("#con-mode,.rightMenu-item:has(.fa-moon)").hide();
|
351
|
-
}
|
352
|
-
}
|
353
|
-
}
|
13
|
+
}`},yjjs1=function(){yjjs=!yjjs,localStorage.setItem("yjjs",yjjs)},localStorage.getItem("blogTheme")=="acrylic"&&(document.getElementById("css").href=""),switchTheme=function(){document.getElementById("css").href==window.location.protocol+"//"+window.location.host+"/css/stylessimple.css"?(document.getElementById("css").href="",localStorage.setItem("blogTheme","acrylic")):(document.getElementById("css").href="/css/stylessimple.css",localStorage.setItem("blogTheme","simple"))},setColor=function(e){document.getElementById("themeColor").innerText=`:root{--lyx-theme:var(--lyx-${e})!important}`,localStorage.setItem("themeColor",e)},setFont=function(e){if(localStorage.setItem("font",e),e=="main")for(var a=document.querySelectorAll("body,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.aplayer"),t=0;t<a.length;t++)a[t].style.fontFamily="-apple-system, IBM Plex Mono ,monospace,'\u5FAE\u8F6F\u96C5\u9ED1', sans-serif";else if(e=="HYPailou")for(var a=document.querySelectorAll("body,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.aplayer"),t=0;t<a.length;t++)a[t].style.fontFamily="Fredoka,HYPailou,KyoukashoProL,-apple-system, IBM Plex Mono ,monospace,'\u5FAE\u8F6F\u96C5\u9ED1', sans-serif";else{for(var a=document.querySelectorAll("body,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.wv-lt-location>a[data-v-4b9dcab4],.wv-lt-location>span[data-v-4b9dcab4],.wv-n-h-now-tmp>span[data-v-5f4c0628],.wv-n-h-now-txt>span[data-v-5f4c0628],.wv-n-h-now-rain>a[data-v-5f4c0628], .wv-n-h-now-rain>span[data-v-5f4c0628],.wv-f-forecast-date>a[data-v-66693262],.wv-f-a,.aplayer"),t=0;t<a.length;t++)a[t].style.fontFamily='var(--global-font),KyoukashoProL,-apple-system, IBM Plex Mono ,monosapce,"\u5FAE\u8F6F\u96C5\u9ED1", sans-serif';document.body.style.fontFamily="var(--global-font),KyoukashoProL,-apple-system, IBM Plex Mono ,monosapce,'\u5FAE\u8F6F\u96C5\u9ED1', sans-serif",document.documentElement.style.setProperty("--global-font",e)}},localStorage.getItem("themeColor")==null&&localStorage.setItem("themeColor","pink"),setColor(localStorage.getItem("themeColor")),localStorage.getItem("hideRightside")==null&&localStorage.setItem("hideRightside","0"),localStorage.getItem("hideRightside")=="1"&&$("#rightside").toggle(),toggleRightside=function(){$("#rightside").toggle(),localStorage.setItem("hideRightside",Math.abs(Number(localStorage.getItem("hideRightside"))-1))},localStorage.getItem("font")==null&&localStorage.setItem("font","HYTMR"),setFont(localStorage.getItem("font")),saveData=function(e,a){localStorage.setItem(e,JSON.stringify({time:Date.now(),data:a}))},loadData=function(e,a){let t=JSON.parse(localStorage.getItem(e));if(t){let n=Date.now()-t.time;if(n<a*60*1e3&&n>-1)return t.data}return 0},changeBg=function(e,a){let t=document.getElementById("web_bg");e.charAt(0)=="#"?(t.style.backgroundColor=e,t.style.backgroundImage="none"):t.style.backgroundImage=e,a||saveData("blogbg",e)};try{let e=loadData("blogbg",1440);e?changeBg(e,1):localStorage.removeItem("blogbg")}catch{localStorage.removeItem("blogbg")}if(fpssw=function(){localStorage.getItem("fpson")=="1"?localStorage.setItem("fpson","0"):localStorage.setItem("fpson","1")},$(".asetting").hide(),$("#backer").hide(),$("#"+localStorage.getItem("themeColor")).attr("checked",!0),localStorage.getItem("blur")=="false"&&(document.getElementById("blur").checked=!0),localStorage.getItem("yjjs")=="true"&&(document.getElementById("yjjs").checked=!0),localStorage.getItem("fpson")=="1"&&(document.getElementById("fpson").checked=!0),localStorage.getItem("sakurahide")=="false"?(document.getElementById("hideSakura").checked=!0,isSakura=1):localStorage.getItem("sakurahide")==null?(localStorage.setItem("sakurahide","false"),document.getElementById("hideSakura").checked=!0,isSakura=1):(setTimeout(stopp,1e3),isSakura=0),localStorage.getItem("aplayerhide")=="false"?document.getElementById("hideAplayer").checked=!0:localStorage.getItem("aplayerhide")==null?(localStorage.setItem("aplayerhide","false"),document.getElementById("hideAplayer").checked=!0):(doStuff=function(){flag=0;try{ap=aplayers[0],ap.list,flag=1}catch{setTimeout(doStuff,50);return}flag&&$(".aplayer-fixed").hide()},doStuff()),document.getElementsByClassName("reSettings")[0].onclick=function(){localStorage.clear(),window.location.reload()},toggleWinbox=function(){$("#settingWindow").fadeToggle(),document.getElementById("settingWindow").style.display!="none"&&(document.getElementById("settingWindow").style.display="flex")},fullScreen=function(){document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()},toggleAside=function(){const e=document.documentElement.classList;e.contains("hide-aside")?saveToLocal.set("aside-status","show",2):saveToLocal.set("aside-status","hide",2),e.toggle("hide-aside")},toggleAplayer=function(){$(".aplayer-fixed").toggle(),localStorage.getItem("aplayerhide")=="true"?localStorage.setItem("aplayerhide",!1):localStorage.setItem("aplayerhide",!0)},toggleSakuras=function(){isSakura=!isSakura,stopp(isSakura),localStorage.getItem("sakurahide")=="true"?localStorage.setItem("sakurahide",!1):localStorage.setItem("sakurahide",!0)},switchAside=function(){if(left)document.getElementById("aside-content").classList.add("right"),document.querySelector(".layout > div:first-child").classList.add("left"),localStorage.setItem("leftAside","false");else{document.getElementById("aside-content").className="aside-content",document.querySelector(".layout > div:first-child").className="";try{document.querySelector("#recent-posts").className="recent-posts"}catch{}localStorage.setItem("leftAside","true")}left=!left},left=1,localStorage.getItem("leftAside")=="true"||localStorage.getItem("leftAside")==null||switchAside(),localStorage.getItem("autoTheme")=="true"){document.getElementById("autoTheme").checked=!0,$("#con-mode,.rightMenu-item:has(.fa-moon)").hide();var l=new Date;l.getHours()<=7||l.getHours()>=19?(activateDarkMode(),localStorage.removeItem("theme")):(activateLightMode(),localStorage.removeItem("theme"))}if(location.href.indexOf("posts")!=-1){var o=new XMLHttpRequest,s=document.querySelector("#page-header").style.backgroundImage.split('url("')[1].split('")')[0];o.open("GET","https://apis.yisous.xyz/api/imageColor?imgurl="+s,!0),o.send(),o.onreadystatechange=function(){o.readyState===4&&o.status===200&&(document.getElementById("themeColor").innerText=`:root{--lyx-theme:${o.responseText}!important}`)}}toggleAutoTheme=()=>{if(localStorage.getItem("autoTheme")=="true")localStorage.setItem("autoTheme","false"),$("#con-mode,.rightMenu-item:has(.fa-moon)").show();else{localStorage.setItem("autoTheme","true");var e=new Date;e.getHours()<=7||e.getHours()>=19?(activateDarkMode(),localStorage.removeItem("theme")):(activateLightMode(),localStorage.removeItem("theme")),$("#con-mode,.rightMenu-item:has(.fa-moon)").hide()}}}
|
package/js/sitetime.js
CHANGED
@@ -1,25 +1 @@
|
|
1
|
-
function siteTime(){
|
2
|
-
window.setTimeout("siteTime()", 500);
|
3
|
-
var seconds = 1000;
|
4
|
-
var minutes = seconds * 60;
|
5
|
-
var hours = minutes * 60;
|
6
|
-
var days = hours * 24;
|
7
|
-
var years = days * 365;
|
8
|
-
var today = new Date();
|
9
|
-
var todayYear = today.getFullYear();
|
10
|
-
var todayMonth = today.getMonth()+1;
|
11
|
-
var todayDate = today.getDate();
|
12
|
-
var todayHour = today.getHours();
|
13
|
-
var todayMinute = today.getMinutes();
|
14
|
-
var todaySecond = today.getSeconds();
|
15
|
-
var t1 = Date.UTC(2022,6,4,12,00,00);
|
16
|
-
var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
|
17
|
-
var diff = t2-t1;
|
18
|
-
var diffYears = Math.floor(diff/years);
|
19
|
-
var diffDays = Math.floor((diff/days)-diffYears*365);
|
20
|
-
var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
|
21
|
-
var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
|
22
|
-
var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
|
23
|
-
document.getElementById("footer_custom_text").innerHTML=" 这个小破站已运行 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 时 "+diffMinutes+" 分 "+diffSeconds+" 秒";
|
24
|
-
}
|
25
|
-
siteTime();
|
1
|
+
function siteTime(){window.setTimeout("siteTime()",500);var i=1e3,v=i*60,o=v*60,t=o*24,s=t*365,a=new Date,u=a.getFullYear(),y=a.getMonth()+1,M=a.getDate(),h=a.getHours(),l=a.getMinutes(),c=a.getSeconds(),g=Date.UTC(2022,6,4,12,0,0),m=Date.UTC(u,y,M,h,l,c),e=m-g,r=Math.floor(e/s),d=Math.floor(e/t-r*365),f=Math.floor((e-(r*365+d)*t)/o),n=Math.floor((e-(r*365+d)*t-f*o)/v),D=Math.floor((e-(r*365+d)*t-f*o-n*v)/i);document.getElementById("footer_custom_text").innerHTML=" \u8FD9\u4E2A\u5C0F\u7834\u7AD9\u5DF2\u8FD0\u884C "+r+" \u5E74 "+d+" \u5929 "+f+" \u65F6 "+n+" \u5206 "+D+" \u79D2"}siteTime();
|