hexo-theme-shokax 0.3.13 → 0.4.0-alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- package/_config.yml +16 -9
- package/layout/_mixin/comment.pug +4 -4
- package/layout/_partials/footer.pug +1 -1
- package/layout/_partials/head/head.pug +7 -1
- package/layout/_partials/header.pug +1 -1
- package/layout/_partials/layout.pug +0 -10
- package/layout/_partials/post/footer.pug +1 -2
- package/package.json +10 -5
- package/scripts/generaters/archive.js +1 -1
- package/scripts/generaters/script.js +64 -42
- package/scripts/helpers/asset.js +1 -1
- package/scripts/helpers/list_categories.js +0 -4
- package/scripts/plugin/lib/injects.js +1 -1
- package/source/js/_app/components/comments.ts +33 -0
- package/source/js/_app/components/sidebar.ts +239 -0
- package/source/js/_app/globals/globalVars.ts +99 -0
- package/source/js/_app/globals/handles.ts +123 -0
- package/source/js/_app/globals/themeColor.ts +64 -0
- package/source/js/_app/globals/thirdparty.ts +63 -0
- package/source/js/_app/globals/tools.ts +75 -0
- package/source/js/_app/library/anime.ts +110 -0
- package/source/js/_app/library/declare.d.ts +126 -0
- package/source/js/_app/library/dom.ts +26 -0
- package/source/js/_app/library/loadFile.ts +43 -0
- package/source/js/_app/library/proto.ts +141 -0
- package/source/js/_app/library/scriptPjax.ts +72 -0
- package/source/js/_app/library/storage.ts +12 -0
- package/source/js/_app/library/vue.ts +50 -0
- package/source/js/_app/page/common.ts +42 -0
- package/source/js/_app/page/fancybox.ts +71 -0
- package/source/js/_app/page/post.ts +266 -0
- package/source/js/_app/page/search.ts +135 -0
- package/source/js/_app/page/tab.ts +60 -0
- package/source/js/_app/pjax/domInit.ts +96 -0
- package/source/js/_app/pjax/refresh.ts +78 -0
- package/source/js/_app/pjax/siteInit.ts +72 -0
- package/source/js/_app/player.ts +799 -0
- package/source/assets/beian.webp +0 -0
- package/source/js/_app/components/sidebar.js +0 -209
- package/source/js/_app/fireworks.js +0 -10
- package/source/js/_app/globals/globalVars.js +0 -80
- package/source/js/_app/globals/handles.js +0 -98
- package/source/js/_app/globals/themeColor.js +0 -62
- package/source/js/_app/globals/thirdparty.js +0 -62
- package/source/js/_app/globals/tools.js +0 -66
- package/source/js/_app/library/anime.js +0 -106
- package/source/js/_app/library/dom.js +0 -34
- package/source/js/_app/library/loadFile.js +0 -36
- package/source/js/_app/library/proto.js +0 -163
- package/source/js/_app/library/scriptPjax.js +0 -70
- package/source/js/_app/library/storage.js +0 -12
- package/source/js/_app/library/vue.js +0 -53
- package/source/js/_app/page/comment.js +0 -23
- package/source/js/_app/page/common.js +0 -41
- package/source/js/_app/page/fancybox.js +0 -65
- package/source/js/_app/page/post.js +0 -244
- package/source/js/_app/page/search.js +0 -118
- package/source/js/_app/page/tab.js +0 -53
- package/source/js/_app/pjax/domInit.js +0 -76
- package/source/js/_app/pjax/refresh.js +0 -52
- package/source/js/_app/pjax/siteInit.js +0 -51
- package/source/js/_app/player.js +0 -771
@@ -0,0 +1,72 @@
|
|
1
|
+
import domInit from './domInit'
|
2
|
+
import { pjaxReload, siteRefresh } from './refresh'
|
3
|
+
import { cloudflareInit } from '../library/scriptPjax'
|
4
|
+
import { CONFIG, pjax, setPjax } from '../globals/globalVars'
|
5
|
+
import { autoDarkmode, themeColorListener } from '../globals/themeColor'
|
6
|
+
import { resizeHandle, scrollHandle, visibilityListener } from '../globals/handles'
|
7
|
+
import { pagePosition } from '../globals/tools'
|
8
|
+
import Pjax from 'theme-shokax-pjax'
|
9
|
+
import { initVue } from '../library/vue'
|
10
|
+
import { lazyLoad } from 'unlazy'
|
11
|
+
|
12
|
+
const siteInit = () => {
|
13
|
+
initVue()
|
14
|
+
domInit()
|
15
|
+
|
16
|
+
setPjax(new Pjax({
|
17
|
+
selectors: [
|
18
|
+
'head title',
|
19
|
+
'.languages',
|
20
|
+
'.twikoo',
|
21
|
+
'.pjax',
|
22
|
+
'.leancloud-recent-comment',
|
23
|
+
'script[data-config]'
|
24
|
+
],
|
25
|
+
cacheBust: false
|
26
|
+
}))
|
27
|
+
|
28
|
+
CONFIG.quicklink.ignores = LOCAL.ignores
|
29
|
+
import('quicklink').then(({ listen }) => {
|
30
|
+
listen(CONFIG.quicklink)
|
31
|
+
})
|
32
|
+
|
33
|
+
autoDarkmode()
|
34
|
+
|
35
|
+
if (__shokax_VL__) {
|
36
|
+
visibilityListener()
|
37
|
+
}
|
38
|
+
themeColorListener()
|
39
|
+
if (__shokax_search__) {
|
40
|
+
import('../page/search').then(({ algoliaSearch }) => {
|
41
|
+
algoliaSearch(pjax)
|
42
|
+
})
|
43
|
+
}
|
44
|
+
|
45
|
+
if (__shokax_fireworks__) {
|
46
|
+
import('mouse-firework').then((firework) => {
|
47
|
+
firework.default(CONFIG.fireworks)
|
48
|
+
})
|
49
|
+
}
|
50
|
+
lazyLoad()
|
51
|
+
|
52
|
+
window.addEventListener('scroll', scrollHandle)
|
53
|
+
|
54
|
+
window.addEventListener('resize', resizeHandle)
|
55
|
+
|
56
|
+
window.addEventListener('pjax:send', pjaxReload)
|
57
|
+
|
58
|
+
window.addEventListener('pjax:success', siteRefresh) // 默认会传入一个event参数
|
59
|
+
|
60
|
+
window.addEventListener('beforeunload', () => {
|
61
|
+
pagePosition()
|
62
|
+
})
|
63
|
+
siteRefresh(1)
|
64
|
+
}
|
65
|
+
|
66
|
+
cloudflareInit()
|
67
|
+
|
68
|
+
window.addEventListener('DOMContentLoaded', siteInit, {
|
69
|
+
passive: true
|
70
|
+
})
|
71
|
+
|
72
|
+
console.log('%c Theme.ShokaX v' + CONFIG.version + ' %c https://github.com/theme-shoka-x/hexo-theme-shokaX ', 'color: white; background: #e9546b; padding:5px 0;', 'padding:4px;border:1px solid #e9546b;')
|