q78kgblog 1.0.0
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/.github/workflows/HexoSeoAutoPush.yml +36 -0
- package/404.html +933 -0
- package/BingSiteAuth.xml +4 -0
- package/CNAME +1 -0
- package/about/index.html +1096 -0
- package/archives/2022/06/index.html +942 -0
- package/archives/2022/index.html +942 -0
- package/archives/2023/02/index.html +942 -0
- package/archives/2023/04/index.html +942 -0
- package/archives/2023/05/index.html +942 -0
- package/archives/2023/08/index.html +942 -0
- package/archives/2023/09/index.html +942 -0
- package/archives/2023/index.html +942 -0
- package/archives/2024/01/index.html +942 -0
- package/archives/2024/02/index.html +942 -0
- package/archives/2024/index.html +942 -0
- package/archives/index.html +942 -0
- package/assets/css/APlayer.min.css +3 -0
- package/assets/douban-loading.gif +0 -0
- package/assets/js/APlayer.min.js +2 -0
- package/assets/js/Meting.min.js +1 -0
- package/atom.xml +311 -0
- package/baidusitemap.xml +43 -0
- package/bangumis/index.html +1247 -0
- package/bigpie/index.html +714 -0
- package/bing.json +1 -0
- package/categories/Hello-World/index.html +954 -0
- package/categories/Hexo/index.html +954 -0
- package/categories/index.html +710 -0
- package/categories//345/271/264/347/273/210/346/200/273/347/273/223/index.html +954 -0
- package/categories//346/201/260/351/245/255/index.html +954 -0
- package/categories//347/264/240/346/235/220/index.html +954 -0
- package/categories//351/227/262/350/201/212/346/235/202/350/260/210/index.html +954 -0
- package/content.json +1 -0
- package/css/404page.css +65 -0
- package/css/ariasakablog.css +5632 -0
- package/css/commentBarrage.css +111 -0
- package/css/danmaku.css +89 -0
- package/css/essay.css +306 -0
- package/css/iconfont.css +55 -0
- package/css/iconfont.ttf +0 -0
- package/css/iconfont.woff +0 -0
- package/css/iconfont.woff2 +0 -0
- package/css/index.css +7006 -0
- package/css/people.css +18 -0
- package/css/stylessimple.css +40 -0
- package/css/swiper.min.css +701 -0
- package/css/swiperstyle.css +567 -0
- package/css/var.css +0 -0
- package/essay/index.html +701 -0
- package/favicon.ico +0 -0
- package/fcircle/index.html +733 -0
- package/fontawesome/index.html +716 -0
- package/google.txt +10 -0
- package/googlebe706248808ee393.html +1 -0
- package/img/144.png +0 -0
- package/img/16.png +0 -0
- package/img/1666416625095-iPhone X.png +0 -0
- package/img/1666416702650-Macbook Pro 2016 (1).png +0 -0
- package/img/1666416764216-Nexus 9.png +0 -0
- package/img/180.png +0 -0
- package/img/192.png +0 -0
- package/img/20200904222157.png +0 -0
- package/img/20200924153652.png +0 -0
- package/img/256.png +0 -0
- package/img/36.png +0 -0
- package/img/48.png +0 -0
- package/img/512.png +0 -0
- package/img/72.png +0 -0
- package/img/72645310.jpg +0 -0
- package/img/8DSTSS20990281646044689944.PNG +0 -0
- package/img/96.png +0 -0
- package/img/O35HOG22090681654187900371.jpg +0 -0
- package/img/a.webp +0 -0
- package/img/ad.png +0 -0
- package/img/apple-touch-icon.png +0 -0
- package/img/avatar.jpg +0 -0
- package/img/buYgVO22990681624844309044.jpg +0 -0
- package/img/comment.png +0 -0
- package/img/favicon.ico +0 -0
- package/img/favicon.jpg +0 -0
- package/img/friend_404.gif +0 -0
- package/img/mqaizf23990681654186719414.jpeg +0 -0
- package/img/nyancat.gif +0 -0
- package/img/siteshot.png +0 -0
- package/img/uTools_1666416859497-iMac.png +0 -0
- package/img-col/index.html +802 -0
- package/index.html +1056 -0
- package/js/aplayersave.js +268 -0
- package/js/baiduhistory.js +76 -0
- package/js/bbtalk.js +11354 -0
- package/js/bbtalklunbo.js +78 -0
- package/js/browser.js +35 -0
- package/js/calendar.js +380 -0
- package/js/cate.js +22 -0
- package/js/commentBarrage.js +240 -0
- package/js/commentsCount.js +43 -0
- package/js/copy.js +23 -0
- package/js/countup.js +209 -0
- package/js/cursor.js +82 -0
- package/js/danmaku.js +106 -0
- package/js/day.js +199 -0
- package/js/dianzan.js +249 -0
- package/js/dis.js +255 -0
- package/js/dist/baiduhistory.dev.js +102 -0
- package/js/dist/bbtalk.dev.js +12876 -0
- package/js/dist/bbtalklunbo.dev.js +45 -0
- package/js/dist/calendar.dev.js +395 -0
- package/js/dist/fixbugpjax.dev.js +8 -0
- package/js/dist/gongnong.dev.js +565 -0
- package/js/dist/heimu.dev.js +19 -0
- package/js/dist/links.dev.js +13 -0
- package/js/dist/main.dev.js +845 -0
- package/js/dist/resizeTop.dev.js +50 -0
- package/js/dist/seo.dev.js +33 -0
- package/js/dist/twikoo.all.min.dev.js +1 -0
- package/js/fixbugpjax.js +7 -0
- package/js/fixed_card_widget.js +46 -0
- package/js/fps.js +58 -0
- package/js/gitalker.js +11 -0
- package/js/gsap.min.js +11 -0
- package/js/heimu.js +16 -0
- package/js/hide.show.js +17 -0
- package/js/jike.js +121 -0
- package/js/jikewater.js +60 -0
- package/js/languages.js +511 -0
- package/js/latest.js +49 -0
- package/js/local-search.js +476 -0
- package/js/lunar.js +1071 -0
- package/js/lyxTalk.js +12 -0
- package/js/main.js +783 -0
- package/js/nav.js +30 -0
- package/js/noie.js +3 -0
- package/js/owo.js +52 -0
- package/js/people.js +175 -0
- package/js/pikaday.js +109 -0
- package/js/random.js +1 -0
- package/js/randomFriend.js +95 -0
- package/js/resizeTop.js +43 -0
- package/js/rightmenu.js +335 -0
- package/js/sakura.js +164 -0
- package/js/search/algolia.js +155 -0
- package/js/search/local-search.js +188 -0
- package/js/settings.js +353 -0
- package/js/sitetime.js +25 -0
- package/js/smooth-scrolling.js +546 -0
- package/js/sw-toolbox.js +16 -0
- package/js/swiperinit.js +23 -0
- package/js/tw_cn.js +100 -0
- package/js/twikoo.all.min.js +2 -0
- package/js/utils.js +278 -0
- package/js/welcome.js +107 -0
- package/js/welcomeconsole.js +23 -0
- package/links/index.html +842 -0
- package/live2d-widget/LICENSE +674 -0
- package/live2d-widget/README.md +188 -0
- package/live2d-widget/assets/screenshot-1.png +0 -0
- package/live2d-widget/assets/screenshot-2.png +0 -0
- package/live2d-widget/assets/screenshot-3.png +0 -0
- package/live2d-widget/autoload.js +63 -0
- package/live2d-widget/demo/demo.html +34 -0
- package/live2d-widget/demo/login.html +271 -0
- package/live2d-widget/live2d.min.js +1 -0
- package/live2d-widget/package.json +31 -0
- package/live2d-widget/rollup.config.js +38 -0
- package/live2d-widget/src/index.js +178 -0
- package/live2d-widget/src/message.js +22 -0
- package/live2d-widget/src/model.js +75 -0
- package/live2d-widget/src/tools.js +78 -0
- package/live2d-widget/src/utils.js +5 -0
- package/live2d-widget/src/waifu-tips.js +3 -0
- package/live2d-widget/waifu-tips.js +5 -0
- package/live2d-widget/waifu-tips.json +255 -0
- package/live2d-widget/waifu.css +310 -0
- package/manifest.json +1 -0
- package/noie.html +69 -0
- package/othersite/index.html +779 -0
- package/owo.json +1 -0
- package/package.json +1 -0
- package/people.html +24 -0
- package/posts/164ef646/index.html +1027 -0
- package/posts/228c2ef8/index.html +1014 -0
- package/posts/4a17b156/index.html +1010 -0
- package/posts/6f3c565b/index.html +1013 -0
- package/posts/7da7c3f6/index.html +1070 -0
- package/posts/a9a6c1fb/index.html +1041 -0
- package/posts/c262e439/index.html +1002 -0
- package/posts/c81531cf/index.html +1080 -0
- package/posts/da2093a1/index.html +1022 -0
- package/posts/e54f7476/index.html +1052 -0
- package/projects.html +424 -0
- package/random.html +32 -0
- package/robots.txt +17 -0
- package/search.xml +309 -0
- package/sitemap.txt +62 -0
- package/sitemap.xml +488 -0
- package/sw.js +190 -0
- package/swReg.js +29 -0
- package/tags/AI/index.html +955 -0
- package/tags/Butterfly/index.html +955 -0
- package/tags/Cloudflare/index.html +955 -0
- package/tags/DiffSinger/index.html +955 -0
- package/tags/Hexo/index.html +955 -0
- package/tags/Next/index.html +955 -0
- package/tags/RAID/index.html +955 -0
- package/tags/VPS/index.html +955 -0
- package/tags/Vercel/index.html +955 -0
- package/tags/Workers/index.html +955 -0
- package/tags/hello-world/index.html +955 -0
- package/tags/index.html +710 -0
- package/tags//344/270/273/351/242/230/index.html +955 -0
- package/tags//344/272/221/346/234/215/345/212/241/345/231/250/index.html +955 -0
- package/tags//344/276/277/345/256/234/index.html +955 -0
- package/tags//345/206/231/344/275/234/index.html +955 -0
- package/tags//345/245/263/346/200/247/346/204/217/350/257/206/index.html +955 -0
- package/tags//345/255/246/344/271/240/index.html +955 -0
- package/tags//345/256/266/351/207/214/344/272/221/index.html +955 -0
- package/tags//345/271/264/347/273/210/346/200/273/347/273/223/index.html +955 -0
- package/tags//346/200/247/344/273/267/346/257/224/index.html +955 -0
- package/tags//346/212/230/350/205/276/index.html +955 -0
- package/tags//346/217/220/344/276/233/345/225/206/index.html +955 -0
- package/tags//346/227/245/345/270/270/index.html +955 -0
- package/tags//346/234/215/345/212/241/345/231/250/index.html +955 -0
- package/tags//346/265/252/346/275/256/index.html +955 -0
- package/tags//347/256/200/347/210/261/index.html +955 -0
- package/tags//350/207/252/345/212/250/346/240/207/346/263/250/index.html +955 -0
- package/tags//350/256/272/346/226/207/index.html +955 -0
- package/tags//350/260/267/346/255/214/347/277/273/350/257/221/index.html +955 -0
- package/tags//350/264/237/350/275/275/345/235/207/350/241/241/index.html +955 -0
- package/tags//351/207/221/345/217/245/index.html +955 -0
- package/tags//351/255/224/346/224/271/index.html +955 -0
package/js/utils.js
ADDED
@@ -0,0 +1,278 @@
|
|
1
|
+
const btf = {
|
2
|
+
debounce: function (func, wait, immediate) {
|
3
|
+
let timeout
|
4
|
+
return function () {
|
5
|
+
const context = this
|
6
|
+
const args = arguments
|
7
|
+
const later = function () {
|
8
|
+
timeout = null
|
9
|
+
if (!immediate) func.apply(context, args)
|
10
|
+
}
|
11
|
+
const callNow = immediate && !timeout
|
12
|
+
clearTimeout(timeout)
|
13
|
+
timeout = setTimeout(later, wait)
|
14
|
+
if (callNow) func.apply(context, args)
|
15
|
+
}
|
16
|
+
},
|
17
|
+
|
18
|
+
throttle: function (func, wait, options) {
|
19
|
+
let timeout, context, args
|
20
|
+
let previous = 0
|
21
|
+
if (!options) options = {}
|
22
|
+
|
23
|
+
const later = function () {
|
24
|
+
previous = options.leading === false ? 0 : new Date().getTime()
|
25
|
+
timeout = null
|
26
|
+
func.apply(context, args)
|
27
|
+
if (!timeout) context = args = null
|
28
|
+
}
|
29
|
+
|
30
|
+
const throttled = function () {
|
31
|
+
const now = new Date().getTime()
|
32
|
+
if (!previous && options.leading === false) previous = now
|
33
|
+
const remaining = wait - (now - previous)
|
34
|
+
context = this
|
35
|
+
args = arguments
|
36
|
+
if (remaining <= 0 || remaining > wait) {
|
37
|
+
if (timeout) {
|
38
|
+
clearTimeout(timeout)
|
39
|
+
timeout = null
|
40
|
+
}
|
41
|
+
previous = now
|
42
|
+
func.apply(context, args)
|
43
|
+
if (!timeout) context = args = null
|
44
|
+
} else if (!timeout && options.trailing !== false) {
|
45
|
+
timeout = setTimeout(later, remaining)
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
return throttled
|
50
|
+
},
|
51
|
+
|
52
|
+
sidebarPaddingR: () => {
|
53
|
+
const innerWidth = window.innerWidth
|
54
|
+
const clientWidth = document.body.clientWidth
|
55
|
+
const paddingRight = innerWidth - clientWidth
|
56
|
+
if (innerWidth !== clientWidth) {
|
57
|
+
document.body.style.paddingRight = paddingRight + 'px'
|
58
|
+
}
|
59
|
+
},
|
60
|
+
|
61
|
+
snackbarShow: (text, showAction = false, duration = 2000) => {
|
62
|
+
const { position, bgLight, bgDark } = GLOBAL_CONFIG.Snackbar
|
63
|
+
const bg = document.documentElement.getAttribute('data-theme') === 'light' ? bgLight : bgDark
|
64
|
+
Snackbar.show({
|
65
|
+
text: text,
|
66
|
+
backgroundColor: bg,
|
67
|
+
showAction: showAction,
|
68
|
+
duration: duration,
|
69
|
+
pos: position,
|
70
|
+
customClass: 'snackbar-css'
|
71
|
+
})
|
72
|
+
},
|
73
|
+
|
74
|
+
diffDate: (d, more = false) => {
|
75
|
+
const dateNow = new Date()
|
76
|
+
const datePost = new Date(d)
|
77
|
+
const dateDiff = dateNow.getTime() - datePost.getTime()
|
78
|
+
const minute = 1000 * 60
|
79
|
+
const hour = minute * 60
|
80
|
+
const day = hour * 24
|
81
|
+
const month = day * 30
|
82
|
+
|
83
|
+
let result
|
84
|
+
if (more) {
|
85
|
+
const monthCount = dateDiff / month
|
86
|
+
const dayCount = dateDiff / day
|
87
|
+
const hourCount = dateDiff / hour
|
88
|
+
const minuteCount = dateDiff / minute
|
89
|
+
|
90
|
+
if (monthCount > 12) {
|
91
|
+
result = datePost.toLocaleDateString().replace(/\//g, '-')
|
92
|
+
} else if (monthCount >= 1) {
|
93
|
+
result = parseInt(monthCount) + ' ' + GLOBAL_CONFIG.date_suffix.month
|
94
|
+
} else if (dayCount >= 1) {
|
95
|
+
result = parseInt(dayCount) + ' ' + GLOBAL_CONFIG.date_suffix.day
|
96
|
+
} else if (hourCount >= 1) {
|
97
|
+
result = parseInt(hourCount) + ' ' + GLOBAL_CONFIG.date_suffix.hour
|
98
|
+
} else if (minuteCount >= 1) {
|
99
|
+
result = parseInt(minuteCount) + ' ' + GLOBAL_CONFIG.date_suffix.min
|
100
|
+
} else {
|
101
|
+
result = GLOBAL_CONFIG.date_suffix.just
|
102
|
+
}
|
103
|
+
} else {
|
104
|
+
result = parseInt(dateDiff / day)
|
105
|
+
}
|
106
|
+
return result
|
107
|
+
},
|
108
|
+
|
109
|
+
loadComment: (dom, callback) => {
|
110
|
+
if ('IntersectionObserver' in window) {
|
111
|
+
const observerItem = new IntersectionObserver((entries) => {
|
112
|
+
if (entries[0].isIntersecting) {
|
113
|
+
callback()
|
114
|
+
observerItem.disconnect()
|
115
|
+
}
|
116
|
+
}, { threshold: [0] })
|
117
|
+
observerItem.observe(dom)
|
118
|
+
} else {
|
119
|
+
callback()
|
120
|
+
}
|
121
|
+
},
|
122
|
+
|
123
|
+
scrollToDest: (pos, time = 500) => {
|
124
|
+
const currentPos = window.pageYOffset
|
125
|
+
if (currentPos > pos) pos = pos - 70
|
126
|
+
|
127
|
+
if ('scrollBehavior' in document.documentElement.style) {
|
128
|
+
window.scrollTo({
|
129
|
+
top: pos,
|
130
|
+
behavior: 'smooth'
|
131
|
+
})
|
132
|
+
return
|
133
|
+
}
|
134
|
+
|
135
|
+
let start = null
|
136
|
+
pos = +pos
|
137
|
+
window.requestAnimationFrame(function step (currentTime) {
|
138
|
+
start = !start ? currentTime : start
|
139
|
+
const progress = currentTime - start
|
140
|
+
if (currentPos < pos) {
|
141
|
+
window.scrollTo(0, ((pos - currentPos) * progress / time) + currentPos)
|
142
|
+
} else {
|
143
|
+
window.scrollTo(0, currentPos - ((currentPos - pos) * progress / time))
|
144
|
+
}
|
145
|
+
if (progress < time) {
|
146
|
+
window.requestAnimationFrame(step)
|
147
|
+
} else {
|
148
|
+
window.scrollTo(0, pos)
|
149
|
+
}
|
150
|
+
})
|
151
|
+
},
|
152
|
+
|
153
|
+
animateIn: (ele, text) => {
|
154
|
+
ele.style.display = 'block'
|
155
|
+
ele.style.animation = text
|
156
|
+
},
|
157
|
+
|
158
|
+
animateOut: (ele, text) => {
|
159
|
+
ele.addEventListener('animationend', function f () {
|
160
|
+
ele.style.display = ''
|
161
|
+
ele.style.animation = ''
|
162
|
+
ele.removeEventListener('animationend', f)
|
163
|
+
})
|
164
|
+
ele.style.animation = text
|
165
|
+
},
|
166
|
+
|
167
|
+
getParents: (elem, selector) => {
|
168
|
+
for (; elem && elem !== document; elem = elem.parentNode) {
|
169
|
+
if (elem.matches(selector)) return elem
|
170
|
+
}
|
171
|
+
return null
|
172
|
+
},
|
173
|
+
|
174
|
+
siblings: (ele, selector) => {
|
175
|
+
return [...ele.parentNode.children].filter((child) => {
|
176
|
+
if (selector) {
|
177
|
+
return child !== ele && child.matches(selector)
|
178
|
+
}
|
179
|
+
return child !== ele
|
180
|
+
})
|
181
|
+
},
|
182
|
+
|
183
|
+
/**
|
184
|
+
* @param {*} selector
|
185
|
+
* @param {*} eleType the type of create element
|
186
|
+
* @param {*} options object key: value
|
187
|
+
*/
|
188
|
+
wrap: (selector, eleType, options) => {
|
189
|
+
const creatEle = document.createElement(eleType)
|
190
|
+
for (const [key, value] of Object.entries(options)) {
|
191
|
+
creatEle.setAttribute(key, value)
|
192
|
+
}
|
193
|
+
selector.parentNode.insertBefore(creatEle, selector)
|
194
|
+
creatEle.appendChild(selector)
|
195
|
+
},
|
196
|
+
|
197
|
+
unwrap: el => {
|
198
|
+
const elParentNode = el.parentNode
|
199
|
+
if (elParentNode !== document.body) {
|
200
|
+
elParentNode.parentNode.insertBefore(el, elParentNode)
|
201
|
+
elParentNode.parentNode.removeChild(elParentNode)
|
202
|
+
}
|
203
|
+
},
|
204
|
+
|
205
|
+
isHidden: ele => ele.offsetHeight === 0 && ele.offsetWidth === 0,
|
206
|
+
|
207
|
+
getEleTop: ele => {
|
208
|
+
let actualTop = ele.offsetTop
|
209
|
+
let current = ele.offsetParent
|
210
|
+
|
211
|
+
while (current !== null) {
|
212
|
+
actualTop += current.offsetTop
|
213
|
+
current = current.offsetParent
|
214
|
+
}
|
215
|
+
|
216
|
+
return actualTop
|
217
|
+
},
|
218
|
+
|
219
|
+
loadLightbox: ele => {
|
220
|
+
const service = GLOBAL_CONFIG.lightbox
|
221
|
+
|
222
|
+
if (service === 'mediumZoom') {
|
223
|
+
const zoom = mediumZoom(ele)
|
224
|
+
zoom.on('open', e => {
|
225
|
+
const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff'
|
226
|
+
zoom.update({
|
227
|
+
background: photoBg
|
228
|
+
})
|
229
|
+
})
|
230
|
+
}
|
231
|
+
|
232
|
+
if (service === 'fancybox') {
|
233
|
+
ele.forEach(i => {
|
234
|
+
if (i.parentNode.tagName !== 'A') {
|
235
|
+
const dataSrc = i.dataset.lazySrc || i.src
|
236
|
+
const dataCaption = i.title || i.alt || ''
|
237
|
+
btf.wrap(i, 'a', { href: dataSrc, 'data-fancybox': 'gallery', 'data-caption': dataCaption, 'data-thumb': dataSrc })
|
238
|
+
}
|
239
|
+
})
|
240
|
+
|
241
|
+
if (!window.fancyboxRun) {
|
242
|
+
Fancybox.bind('[data-fancybox]', {
|
243
|
+
Hash: false,
|
244
|
+
Thumbs: {
|
245
|
+
autoStart: false
|
246
|
+
}
|
247
|
+
})
|
248
|
+
window.fancyboxRun = true
|
249
|
+
}
|
250
|
+
}
|
251
|
+
},
|
252
|
+
|
253
|
+
initJustifiedGallery: function (selector) {
|
254
|
+
selector.forEach(function (i) {
|
255
|
+
if (!btf.isHidden(i)) {
|
256
|
+
fjGallery(i, {
|
257
|
+
itemSelector: '.fj-gallery-item',
|
258
|
+
rowHeight: 220,
|
259
|
+
gutter: 4,
|
260
|
+
onJustify: function () {
|
261
|
+
this.$container.style.opacity = '1'
|
262
|
+
}
|
263
|
+
})
|
264
|
+
}
|
265
|
+
})
|
266
|
+
},
|
267
|
+
|
268
|
+
updateAnchor: (anchor) => {
|
269
|
+
if (anchor !== window.location.hash) {
|
270
|
+
if (!anchor) anchor = location.pathname
|
271
|
+
const title = GLOBAL_CONFIG_SITE.title
|
272
|
+
window.history.replaceState({
|
273
|
+
url: location.href,
|
274
|
+
title: title
|
275
|
+
}, title, anchor)
|
276
|
+
}
|
277
|
+
}
|
278
|
+
}
|
package/js/welcome.js
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
if ('serviceWorker' in window.navigator && navigator.serviceWorker.controller) {
|
2
|
+
// 发送更新指令到sw
|
3
|
+
// 'update'改为'refresh'即可触发缓存刷新
|
4
|
+
navigator.serviceWorker.controller.postMessage('update')
|
5
|
+
navigator.serviceWorker.addEventListener('message', event => {
|
6
|
+
const data = event.data
|
7
|
+
switch (data.type) {
|
8
|
+
case 'update':
|
9
|
+
// 这里写更新后的操作
|
10
|
+
break
|
11
|
+
case 'refresh':
|
12
|
+
// 这里写强刷缓存后的操作
|
13
|
+
break
|
14
|
+
default:
|
15
|
+
console.error(`未知事件:${data.type}`)
|
16
|
+
}
|
17
|
+
})
|
18
|
+
}
|
19
|
+
|
20
|
+
if (localStorage.getItem("popWelcomeWindow") != "0") {
|
21
|
+
if(document.referrer==undefined||document.referrer.indexOf("anjiurine.top")!=-1||document.referrer.indexOf("ariasaka.top")!=-1){
|
22
|
+
Snackbar.show({
|
23
|
+
pos: "top-right",
|
24
|
+
showAction: false,
|
25
|
+
text: '欢迎访问本站!'
|
26
|
+
})
|
27
|
+
}else{
|
28
|
+
Snackbar.show({
|
29
|
+
pos: "top-right",
|
30
|
+
showAction: false,
|
31
|
+
text: `欢迎来自${document.referrer.split("://")[1].split("/")[0]}的童鞋访问本站!`
|
32
|
+
})
|
33
|
+
localStorage.setItem("popWelcomeWindow", "0");
|
34
|
+
}
|
35
|
+
}
|
36
|
+
if (sessionStorage.getItem("popCookieWindow") != "0") {
|
37
|
+
setTimeout(function () {
|
38
|
+
Snackbar.show({
|
39
|
+
text: '本站使用Cookie和本地/会话存储保证浏览体验和网站统计',
|
40
|
+
pos: 'bottom-right',
|
41
|
+
actionText: "查看博客声明",
|
42
|
+
onActionClick: function (element) {
|
43
|
+
window.open("/license")
|
44
|
+
},
|
45
|
+
})
|
46
|
+
}, 3000)
|
47
|
+
}
|
48
|
+
sessionStorage.setItem("popCookieWindow", "0");
|
49
|
+
|
50
|
+
function browserTC() {
|
51
|
+
btf.snackbarShow("");
|
52
|
+
Snackbar.show({
|
53
|
+
text: '浏览器版本较低,网站样式可能错乱',
|
54
|
+
actionText: '关闭',
|
55
|
+
duration: '6000',
|
56
|
+
pos: 'bottom-right'
|
57
|
+
});
|
58
|
+
}
|
59
|
+
function browserVersion() {
|
60
|
+
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
|
61
|
+
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
|
62
|
+
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
|
63
|
+
var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //Edge浏览器
|
64
|
+
var isFirefox = userAgent.indexOf("Firefox") > -1; //Firefox浏览器
|
65
|
+
var isOpera = userAgent.indexOf("Opera")>-1 || userAgent.indexOf("OPR")>-1 ; //Opera浏览器
|
66
|
+
var isChrome = userAgent.indexOf("Chrome")>-1 && userAgent.indexOf("Safari")>-1 && userAgent.indexOf("Edge")==-1 && userAgent.indexOf("OPR")==-1; //Chrome浏览器
|
67
|
+
var isSafari = userAgent.indexOf("Safari")>-1 && userAgent.indexOf("Chrome")==-1 && userAgent.indexOf("Edge")==-1 && userAgent.indexOf("OPR")==-1; //Safari浏览器
|
68
|
+
if(isEdge) {
|
69
|
+
if(userAgent.split('Edge/')[1].split('.')[0]<90){
|
70
|
+
browserTC()
|
71
|
+
}
|
72
|
+
} else if(isFirefox) {
|
73
|
+
if(userAgent.split('Firefox/')[1].split('.')[0]<90){
|
74
|
+
browserTC()
|
75
|
+
}
|
76
|
+
} else if(isOpera) {
|
77
|
+
if(userAgent.split('OPR/')[1].split('.')[0]<80){
|
78
|
+
browserTC()
|
79
|
+
}
|
80
|
+
} else if(isChrome) {
|
81
|
+
if(userAgent.split('Chrome/')[1].split('.')[0]<90){
|
82
|
+
browserTC()
|
83
|
+
}
|
84
|
+
} else if(isSafari) {
|
85
|
+
//不知道Safari哪个版本是该淘汰的老旧版本
|
86
|
+
}
|
87
|
+
}
|
88
|
+
//2022-10-29修正了一个错误:过期时间应使用toGMTString(),而不是toUTCString(),否则实际过期时间在中国差了8小时
|
89
|
+
function setCookies(obj, limitTime) {
|
90
|
+
let data = new Date(new Date().getTime() + limitTime * 24 * 60 * 60 * 1000).toGMTString()
|
91
|
+
for (let i in obj) {
|
92
|
+
document.cookie = i + '=' + obj[i] + ';expires=' + data
|
93
|
+
}
|
94
|
+
}
|
95
|
+
function getCookie(name) {
|
96
|
+
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
97
|
+
if (arr = document.cookie.match(reg))
|
98
|
+
return unescape(arr[2]);
|
99
|
+
else
|
100
|
+
return null;
|
101
|
+
}
|
102
|
+
if(getCookie('browsertc')!=1){
|
103
|
+
setCookies({
|
104
|
+
browsertc: 1,
|
105
|
+
}, 1);
|
106
|
+
browserVersion();
|
107
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// console.clear()
|
2
|
+
// window.onerror=()=>{
|
3
|
+
// console.clear()
|
4
|
+
// console.log(`Hexo-theme-Acryple based on Butterfly 4.2.2
|
5
|
+
|
6
|
+
// 欢迎访问本站!等了这么久总算等到你啦!
|
7
|
+
// 如果有功能喜欢的欢迎扒走,Github上面也已开源。
|
8
|
+
// 速度有点慢请见谅`)
|
9
|
+
// }
|
10
|
+
// setInterval(() => {
|
11
|
+
// console.clear()
|
12
|
+
// console.log(`Hexo-theme-Acryple based on Butterfly 4.2.2
|
13
|
+
|
14
|
+
// 欢迎访问本站!等了这么久总算等到你啦!
|
15
|
+
// 如果有功能喜欢的欢迎扒走,Github上面也已开源。
|
16
|
+
// 速度有点慢请见谅`)
|
17
|
+
// }, 500);
|
18
|
+
document.querySelector('.home .category-list').onmousewheel = function(e){
|
19
|
+
if(e.deltaY>=0){
|
20
|
+
this.scrollLeft+=20;
|
21
|
+
}else{
|
22
|
+
this.scrollLeft-=20;
|
23
|
+
}return false;}
|