hexo-theme-shokax 0.3.12 → 0.4.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +10 -3
- package/README_en.MD +13 -5
- package/_config.yml +19 -16
- package/layout/_mixin/comment.pug +4 -4
- package/layout/_mixin/segment.pug +1 -1
- package/layout/_partials/head/head.pug +0 -1
- package/layout/_partials/post/post.pug +1 -1
- package/layout/_partials/post/reward.pug +1 -1
- package/layout/_partials/sidebar/overview.pug +1 -1
- package/package.json +11 -11
- package/scripts/filters/locals.d.ts +1 -0
- package/scripts/filters/locals.ts +59 -0
- package/scripts/filters/post.d.ts +0 -0
- package/scripts/filters/post.js +1 -1
- package/scripts/filters/post.ts +6 -0
- package/scripts/generaters/archive.d.ts +1 -0
- package/scripts/generaters/archive.ts +144 -0
- package/scripts/generaters/config.d.ts +1 -0
- package/scripts/generaters/config.ts +52 -0
- package/scripts/generaters/images.d.ts +1 -0
- package/scripts/generaters/images.ts +26 -0
- package/scripts/generaters/index.d.ts +1 -0
- package/scripts/generaters/index.ts +110 -0
- package/scripts/generaters/pages.d.ts +0 -0
- package/scripts/generaters/pages.ts +16 -0
- package/scripts/generaters/script.d.ts +1 -0
- package/scripts/generaters/script.js +25 -6
- package/scripts/generaters/script.ts +110 -0
- package/scripts/helpers/asset.d.ts +1 -0
- package/scripts/helpers/asset.ts +158 -0
- package/scripts/helpers/engine.d.ts +1 -0
- package/scripts/helpers/engine.ts +171 -0
- package/scripts/helpers/list_categories.d.ts +1 -0
- package/scripts/helpers/list_categories.ts +104 -0
- package/scripts/helpers/summary_ai.d.ts +1 -0
- package/scripts/helpers/summary_ai.js +1 -1
- package/scripts/helpers/summary_ai.ts +100 -0
- package/scripts/helpers/symbols_count_time.d.ts +1 -0
- package/scripts/helpers/symbols_count_time.ts +76 -0
- package/scripts/plugin/check.d.ts +1 -0
- package/scripts/plugin/check.ts +35 -0
- package/scripts/plugin/index.d.ts +6 -0
- package/scripts/plugin/index.ts +52 -0
- package/scripts/plugin/lib/injects-point.d.ts +5 -0
- package/scripts/plugin/lib/injects-point.ts +20 -0
- package/scripts/plugin/lib/injects.d.ts +2 -0
- package/scripts/plugin/lib/injects.ts +101 -0
- package/scripts/tags/links.d.ts +1 -0
- package/scripts/tags/links.ts +75 -0
- package/scripts/tags/media.d.ts +1 -0
- package/scripts/tags/media.ts +19 -0
- package/source/css/_common/components/tags/tabs.styl +3 -1
- package/source/css/_common/scaffolding/base.styl +6 -6
- package/source/css/_iconfont.styl +4 -0
- package/source/js/_app/components/sidebar.ts +237 -0
- package/source/js/_app/globals/globalVars.ts +98 -0
- package/source/js/_app/globals/handles.ts +122 -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 +74 -0
- package/source/js/_app/library/anime.ts +109 -0
- package/source/js/_app/library/declare.d.ts +117 -0
- package/source/js/_app/library/dom.ts +26 -0
- package/source/js/_app/library/libtype.d.ts +4 -0
- package/source/js/_app/library/loadFile.ts +41 -0
- package/source/js/_app/library/proto.ts +143 -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 +60 -0
- package/source/js/_app/page/common.ts +42 -0
- package/source/js/_app/page/fancybox.ts +70 -0
- package/source/js/_app/page/post.ts +265 -0
- package/source/js/_app/page/search.ts +129 -0
- package/source/js/_app/page/tab.ts +59 -0
- package/source/js/_app/pjax/domInit.ts +95 -0
- package/source/js/_app/pjax/refresh.ts +75 -0
- package/source/js/_app/pjax/siteInit.ts +67 -0
- package/source/js/_app/player.ts +798 -0
- package/source/css/twikoo.css +0 -2002
- package/source/js/_app/components/sidebar.js +0 -210
- 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 -138
- package/source/js/_app/globals/themeColor.js +0 -62
- package/source/js/_app/globals/thirdparty.js +0 -71
- package/source/js/_app/globals/tools.js +0 -92
- package/source/js/_app/library/anime.js +0 -109
- 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 -53
- package/source/js/_app/pjax/siteInit.js +0 -49
- package/source/js/_app/player.js +0 -774
@@ -0,0 +1,67 @@
|
|
1
|
+
import domInit from './domInit'
|
2
|
+
import { pjaxReload, siteRefresh } from './refresh'
|
3
|
+
import { cloudflareInit } from '../library/scriptPjax'
|
4
|
+
import { algoliaSearch } from '../page/search'
|
5
|
+
import { pjax, setPjax } from '../globals/globalVars'
|
6
|
+
import { autoDarkmode, themeColorListener } from '../globals/themeColor'
|
7
|
+
import { resizeHandle, scrollHandle, visibilityListener } from '../globals/handles'
|
8
|
+
import { pagePosition } from '../globals/tools'
|
9
|
+
import Pjax from 'theme-shokax-pjax'
|
10
|
+
import { initVue } from '../library/vue'
|
11
|
+
import { lazyLoad } from 'unlazy'
|
12
|
+
import firework from 'mouse-firework'
|
13
|
+
|
14
|
+
const siteInit = () => {
|
15
|
+
domInit()
|
16
|
+
initVue()
|
17
|
+
|
18
|
+
setPjax(new Pjax({
|
19
|
+
selectors: [
|
20
|
+
'head title',
|
21
|
+
'.languages',
|
22
|
+
'.twikoo',
|
23
|
+
'.pjax',
|
24
|
+
'.leancloud-recent-comment',
|
25
|
+
'script[data-config]'
|
26
|
+
],
|
27
|
+
cacheBust: false
|
28
|
+
}))
|
29
|
+
|
30
|
+
CONFIG.quicklink.ignores = LOCAL.ignores
|
31
|
+
quicklink.listen(CONFIG.quicklink)
|
32
|
+
autoDarkmode()
|
33
|
+
|
34
|
+
if (__shokax_VL__) {
|
35
|
+
visibilityListener()
|
36
|
+
}
|
37
|
+
themeColorListener()
|
38
|
+
if (__shokax_search__) {
|
39
|
+
algoliaSearch(pjax)
|
40
|
+
}
|
41
|
+
|
42
|
+
if (__shokax_fireworks__) {
|
43
|
+
firework(CONFIG.fireworks)
|
44
|
+
}
|
45
|
+
lazyLoad()
|
46
|
+
|
47
|
+
window.addEventListener('scroll', scrollHandle)
|
48
|
+
|
49
|
+
window.addEventListener('resize', resizeHandle)
|
50
|
+
|
51
|
+
window.addEventListener('pjax:send', pjaxReload)
|
52
|
+
|
53
|
+
window.addEventListener('pjax:success', siteRefresh) // 默认会传入一个event参数
|
54
|
+
|
55
|
+
window.addEventListener('beforeunload', () => {
|
56
|
+
pagePosition()
|
57
|
+
})
|
58
|
+
siteRefresh(1)
|
59
|
+
}
|
60
|
+
|
61
|
+
cloudflareInit()
|
62
|
+
|
63
|
+
window.addEventListener('DOMContentLoaded', siteInit, {
|
64
|
+
passive: true
|
65
|
+
})
|
66
|
+
|
67
|
+
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;')
|