hexo-theme-shokax 0.0.3 → 0.0.4-alpha
Sign up to get free protection for your applications and to get access to all the features.
- package/CONTRIBUTING.md +4 -0
- package/README.md +30 -4
- package/layout/_mixin/breadcrumb.pug +3 -3
- package/layout/_mixin/card.pug +5 -4
- package/layout/_mixin/comment.pug +2 -1
- package/layout/_mixin/postmeta.pug +3 -3
- package/layout/_mixin/segment.pug +2 -2
- package/layout/_mixin/sidebar.pug +4 -4
- package/layout/_mixin/widgets.pug +1 -1
- package/layout/_partials/footer.pug +2 -2
- package/layout/_partials/head/head.pug +1 -0
- package/layout/_partials/header.pug +2 -2
- package/layout/_partials/layout.pug +1 -1
- package/layout/_partials/pagination.pug +1 -1
- package/layout/_partials/post/copyright.pug +2 -2
- package/layout/_partials/post/footer.pug +2 -2
- package/layout/_partials/post/nav.pug +1 -1
- package/layout/_partials/post/post.pug +1 -1
- package/layout/_partials/post/reward.pug +1 -1
- package/layout/archive.pug +1 -1
- package/layout/category.pug +1 -1
- package/layout/page.pug +1 -1
- package/layout/post.pug +1 -1
- package/layout/tag.pug +1 -1
- package/package.json +1 -1
- package/source/css/_common/scaffolding/base.styl +25 -0
- package/source/js/_app/global.js +1 -6
- package/source/js/_app/library.js +26 -2
package/CONTRIBUTING.md
CHANGED
@@ -25,6 +25,10 @@
|
|
25
25
|
2. 您愿意接受长时间的等待(一般不超过15天)
|
26
26
|
3. 您能够接受因代码质量等问题而提出的疑问,并愿意讨论是否接受更改
|
27
27
|
|
28
|
+
有关issues的说明:
|
29
|
+
1. 如果您愿意开发某 issues 的提议功能或修复 bug,建议在对应 issue 下评论说明一下,避免闭门造车和重复造轮子的惨剧
|
30
|
+
2. 您应该在对应 PR 提交时绑定对应 issue,以便进行统计
|
31
|
+
|
28
32
|
## Github PR
|
29
33
|
此处为在使用 Github PR 提交时应注意的事:
|
30
34
|
- 默认你对 Git、GitHub 已经有了一定的了解,并且懂得使用 PR(此方面问题可以去讨论区发起 Q&A)
|
package/README.md
CHANGED
@@ -9,16 +9,33 @@
|
|
9
9
|
诞生原因是目前shoka已经两年没有更新了,积压了大量BUG和功能请求。\
|
10
10
|
本项目处于高强度开发期,但github仓库版本已基本可用 \
|
11
11
|
二次开发与常见问题请看wiki \
|
12
|
-
`0.0.2-alpha2`开始,`lantern`和`qweather`已迁移为插件
|
13
|
-
插件系统已完工,食用方法见[awesome-shokaX](https://github.com/zkz098/awesome-shokaX)
|
12
|
+
`0.0.2-alpha2`开始,`lantern`和`qweather`已迁移为插件
|
14
13
|
|
15
|
-
|
14
|
+
shokaX的社区资源导航和插件仓库为[awesome-shokaX](https://github.com/zkz098/awesome-shokaX)
|
15
|
+
|
16
|
+
## 💬 和shoka的区别
|
16
17
|
原先shoka使用了javascript+Native+nunjucks的技术 \
|
17
18
|
而shokaX则使用了typescript+Vue 3+Pug的技术搭配 \
|
18
19
|
图标库可能会更换为Font Awesome 6 \
|
19
20
|
更改了大量难以访问的CDN链接
|
20
21
|
|
21
|
-
##
|
22
|
+
## ✨ 功能清单
|
23
|
+
|
24
|
+
| 功能名称 | 实现状态 | 功能名称 | 实现状态 |
|
25
|
+
|:--------:|:----:|:------------:|:----:|
|
26
|
+
| PWA支持 | ✅ | JSD拆分 | ✅ |
|
27
|
+
| 注入API | ✅ | 社区插件系统 | ✅ |
|
28
|
+
| 自定义字体 | ✅* | 自定义样式 | ✅* |
|
29
|
+
| 多种评论系统支持 | ✅ | 用户行为分析支持 | ✅ |
|
30
|
+
| 底部备案号 | ✅ | 自定义页尾 | ✅* |
|
31
|
+
| CSS渐变封面 | ✅ | typescript支持 | ✅^ |
|
32
|
+
|
33
|
+
备注:
|
34
|
+
- *: 需要使用注入API实现
|
35
|
+
- ^: 仅page js部分,hexo script未实现
|
36
|
+
|
37
|
+
|
38
|
+
## 🔧 如何安装?
|
22
39
|
建议使用[ShokaX-CLI](https://github.com/zkz098/shokaX-CLI) ,执行下列命令即可:
|
23
40
|
```bash
|
24
41
|
npm i shokax-cli --location=global
|
@@ -27,6 +44,15 @@ SXC install shokaX
|
|
27
44
|
```
|
28
45
|
后续配置请点[这里](https://www.kaitaku.xyz/webbuild/shokaX/) 查看
|
29
46
|
|
47
|
+
releases及npm的版本号区别如下:
|
48
|
+
- x.x.x-alpha版本是早期测试版,部分未经测试环境测试,不能保证正常运行
|
49
|
+
- x.x.x-beta(目前还没有)是测试版,可以保证正常生成,但可能存在bug
|
50
|
+
- x.x.x是相对稳定的版本,基本上不存在严重BUG
|
51
|
+
|
52
|
+
github仓库建议通过右边的 releases 下载,步骤为:
|
53
|
+
- 点击 Releases 的 Latest 版本
|
54
|
+
- 下载 Assets 中的 `Source code(zip)`
|
55
|
+
- 解压即可作为主题使用
|
30
56
|
# 许可证
|
31
57
|
许可证: BSD-3-Clause \
|
32
58
|
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX?ref=badge_large)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
mixin BCRender(post, home)
|
2
2
|
if home
|
3
3
|
!= '<div class="breadcrumb" itemListElement itemscope itemtype="https://schema.org/BreadcrumbList">'
|
4
|
-
i(class="
|
4
|
+
i(class="fa fa-solid fa-house")
|
5
5
|
span
|
6
6
|
a(href=url_for(site.path))
|
7
7
|
!= __('menu.home')
|
@@ -10,7 +10,7 @@ mixin BCRender(post, home)
|
|
10
10
|
if post.categories && post.categories.length
|
11
11
|
- var cat_length = post.categories.length
|
12
12
|
if home
|
13
|
-
i(class="
|
13
|
+
i(class="fa fa-solid fa-angle-right")
|
14
14
|
each cat,index in post.categories.toArray()
|
15
15
|
if home
|
16
16
|
if index===cat_length
|
@@ -29,5 +29,5 @@ mixin BCRender(post, home)
|
|
29
29
|
a(href=url_for(cat.path) title=__('post.in')+cat.name)
|
30
30
|
!= cat.name
|
31
31
|
if cat_length > 1 && index !== cat_length
|
32
|
-
i(class="
|
32
|
+
i(class="fa fa-solid fa-angle-right")
|
33
33
|
!= '</div>'
|
package/layout/_mixin/card.pug
CHANGED
@@ -12,10 +12,11 @@ mixin CardRender(item)
|
|
12
12
|
!= item.top.name
|
13
13
|
div(class="info")
|
14
14
|
if item.link
|
15
|
-
- var postTitleIcon = '<i class="
|
15
|
+
- var postTitleIcon = '<i class="fa fa-solid fa-up-right-from-square"></i>'
|
16
16
|
- var postText = itemname || item.link || __('post.untitled')
|
17
|
+
- var tempI = postText + (postTitleIcon || '')
|
17
18
|
div(class="ribbon")
|
18
|
-
!= _url(item.link ,
|
19
|
+
!= _url(item.link , tempI , {itemprop: 'url', title: postText})
|
19
20
|
div(class="inner")
|
20
21
|
- var len = ''
|
21
22
|
if item.child
|
@@ -30,8 +31,8 @@ mixin CardRender(item)
|
|
30
31
|
div(class="meta footer")
|
31
32
|
if item.top
|
32
33
|
span
|
33
|
-
!= _url(item.top.path, '<i class="
|
34
|
+
!= _url(item.top.path, '<i class="fa fa-solid fa-flag"></i>'+item.top.name, {itemprop: 'url', title: item.top.name})
|
34
35
|
span
|
35
|
-
i(class="
|
36
|
+
i(class="fa fa-solid fa-file")
|
36
37
|
!= len
|
37
38
|
!= _url(item.path, 'more...', {itemprop: 'url', title: itemname, class: 'btn'})
|
@@ -33,6 +33,7 @@ mixin CommentRender()
|
|
33
33
|
else if gt
|
34
34
|
div(class="warp" id="gtcomments")
|
35
35
|
script(type="text/javascript" data-pjax).
|
36
|
+
const gproxy = theme.gitalk.proxy || undefined
|
36
37
|
const gitalk = new Gitalk({
|
37
38
|
clientID: '#{theme.gitalk.clientID}',
|
38
39
|
clientSecret: '#{theme.gitalk.clientSecret}',
|
@@ -41,7 +42,7 @@ mixin CommentRender()
|
|
41
42
|
admin: #{theme.gitalk.admin},
|
42
43
|
id: location.pathname, // Ensure uniqueness and length less than 50
|
43
44
|
distractionFreeMode: false, // Facebook-like distraction free mode
|
44
|
-
proxy: "#{
|
45
|
+
proxy: "#{gproxy}"
|
45
46
|
});
|
46
47
|
gitalk.render("gtcomments")
|
47
48
|
else if gs
|
@@ -5,7 +5,7 @@ mixin PMRender(item, full)
|
|
5
5
|
- var create_title = __('post.created') + __('symbol.colon') + full_date(item.date)
|
6
6
|
span(class="item" title=create_title)
|
7
7
|
span(class="icon")
|
8
|
-
i(class="
|
8
|
+
i(class="fa fa-solid fa-calendar-days")
|
9
9
|
if full
|
10
10
|
span(class="text")
|
11
11
|
!= __('post.posted')
|
@@ -14,7 +14,7 @@ mixin PMRender(item, full)
|
|
14
14
|
if theme.post.count
|
15
15
|
span(class="item" title=__('symbols_count_time.count'))
|
16
16
|
span(class="icon")
|
17
|
-
i(class="
|
17
|
+
i(class="fa fa-solid fa-pen-nib")
|
18
18
|
if full
|
19
19
|
span(class="text")
|
20
20
|
!= __('symbols_count_time.count')
|
@@ -23,7 +23,7 @@ mixin PMRender(item, full)
|
|
23
23
|
!= __('symbols_count_time.word')
|
24
24
|
span(class="item" title=__('symbols_count_time.time'))
|
25
25
|
span(class="icon")
|
26
|
-
i(class="
|
26
|
+
i(class="fa fa-solid fa-clock")
|
27
27
|
if full
|
28
28
|
span(class="text")
|
29
29
|
!= __('symbols_count_time.time')
|
@@ -4,7 +4,7 @@ mixin SMRender(item)
|
|
4
4
|
- var link1 = item.link || item.path
|
5
5
|
- var gradient = theme?.experiments?.gradient
|
6
6
|
if item.link
|
7
|
-
- var postTitleIcon = '<i class="
|
7
|
+
- var postTitleIcon = '<i class="fa fa-solid fa-up-right-from-square"></i>'
|
8
8
|
- var postText = item.title || item.link || __('post.untitled')
|
9
9
|
article(class="item")
|
10
10
|
if gradient
|
@@ -27,6 +27,6 @@ mixin SMRender(item)
|
|
27
27
|
div(class="meta footer")
|
28
28
|
span
|
29
29
|
- var lastcat = item.categories.last()
|
30
|
-
!= _url(lastcat.path, '<i class="
|
30
|
+
!= _url(lastcat.path, '<i class="fa fa-solid fa-flag"></i>' + lastcat.name, {itemprop: 'url', title: lastcat.name})
|
31
31
|
!= _url(link1, 'more...', {itemprop: 'url', title: postText, class: 'btn'})
|
32
32
|
|
@@ -25,12 +25,12 @@ mixin sidebarRender(display_toc)
|
|
25
25
|
li(class="prev pjax")
|
26
26
|
if page && page.prev
|
27
27
|
if prevlink
|
28
|
-
!= _url(prevlink, '<i class="
|
28
|
+
!= _url(prevlink, '<i class="fa fa-solid fa-chevron-left"></i>', {rel: 'prev', title: __('post.prev')})
|
29
29
|
li(class="up")
|
30
|
-
i(class="
|
30
|
+
i(class="fa fa-solid fa-arrow-up")
|
31
31
|
li(class="down")
|
32
|
-
i(class="
|
32
|
+
i(class="fa fa-solid fa-arrow-down")
|
33
33
|
li(class="next pjax")
|
34
34
|
if nextlink
|
35
|
-
!= _url(nextlink, '<i class="
|
35
|
+
!= _url(nextlink, '<i class="fa fa-solid fa-chevron-right"></i>', {rel: 'next', title: __('post.next')})
|
36
36
|
li(class="percent")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
mixin field(item)
|
2
2
|
if item.link
|
3
|
-
- var postTitleIcon = '<i class="
|
3
|
+
- var postTitleIcon = '<i class="fa fa-solid fa-up-right-from-square"></i>'
|
4
4
|
li(class="item")
|
5
5
|
+BCRender(item, false)
|
6
6
|
- var postText = item.title || item.link || __('post.untitled')
|
@@ -11,12 +11,12 @@ div(class="status")
|
|
11
11
|
if theme.footer.count
|
12
12
|
div(class="count")
|
13
13
|
span(class="post-meta-item-icon")
|
14
|
-
i(class="
|
14
|
+
i(class="fa fa-solid fa-chart-area")
|
15
15
|
span(title=__('symbols_count_time.count_total'))
|
16
16
|
!= `${ symbolsCountTotal(site) } ${__('symbols_count_time.word')}`
|
17
17
|
span(class="post-meta-divider") |
|
18
18
|
span(class="post-meta-item-icon")
|
19
|
-
i(class="
|
19
|
+
i(class="fa fa-solid fa-coffee")
|
20
20
|
span(title=__('symbols_count_time.time_total'))
|
21
21
|
!= symbolsTimeTotal(site, config.symbols_count_time.awl, config.symbols_count_time.wpm, __('symbols_count_time.time_minutes'))
|
22
22
|
//- span(id="timeDate")
|
@@ -33,6 +33,7 @@ link(rel="alternate" type="application/json" title=siteTitle href=feedLink)
|
|
33
33
|
if fontConfig
|
34
34
|
!= _vendor_font()
|
35
35
|
!= _css('app.css')
|
36
|
+
link(rel="stylesheet" type="text/css" href="https://cdn.staticfile.org/font-awesome/6.2.1/css/all.min.css")
|
36
37
|
- var debugVue = theme?.experiments?.debug
|
37
38
|
if debugVue
|
38
39
|
script(src="https://cdn.staticfile.org/vue/3.2.45/vue.global.js")
|
@@ -11,8 +11,8 @@ nav(id="nav")
|
|
11
11
|
!= alternate || title
|
12
12
|
ul(class="right" id="rightNav")
|
13
13
|
li(class="item theme" @click="changeThemeByBtn")
|
14
|
-
i(class="
|
14
|
+
i(class="fa fa-solid fa-sunrise")
|
15
15
|
li(class="item search")
|
16
|
-
i(class="
|
16
|
+
i(class="fa fa-solid fa-magnifying-glass")
|
17
17
|
!= shokax_inject('rightNav')
|
18
18
|
|
@@ -65,7 +65,7 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
65
65
|
div(class="widgets")
|
66
66
|
+WRender
|
67
67
|
!= partial('_partials/footer.pug', {}, {cache: true})
|
68
|
-
- var ccIcon = '<i class="
|
68
|
+
- var ccIcon = '<i class="fa fa-solid fa-creative-commons"></i>'
|
69
69
|
- var ccText = theme.creative_commons.license.toUpperCase()
|
70
70
|
<script data-config type="text/javascript" >
|
71
71
|
| var LOCAL = {
|
@@ -1,4 +1,4 @@
|
|
1
1
|
if page.prev || page.next
|
2
2
|
nav(class="pagination")
|
3
3
|
div(class="inner")
|
4
|
-
!= paginator({prev_text: '<i class="
|
4
|
+
!= paginator({prev_text: '<i class="fa fa-solid fa-angle-left" aria-label="' + __('accessibility.prev_page') + '"></i>',next_text: '<i class="fa fa-solid fa-angle-right" aria-label="' + __('accessibility.next_page') + '"></i>',mid_size : 1,escape : false})
|
@@ -1,5 +1,5 @@
|
|
1
1
|
if page.copyright !== false
|
2
|
-
- var ccIcon = '<i class="
|
2
|
+
- var ccIcon = '<i class="fa fa-brands fa-creative-commons"><em>(CC)</em></i>'
|
3
3
|
- var ccText = theme.creative_commons.license.toUpperCase()
|
4
4
|
div(id="copyright")
|
5
5
|
ul
|
@@ -7,7 +7,7 @@ if page.copyright !== false
|
|
7
7
|
strong
|
8
8
|
!= __('post.copyright.author') + __('symbol.colon')
|
9
9
|
!= page.author || author
|
10
|
-
i(class="
|
10
|
+
i(class="fa fa-solid fa-at")
|
11
11
|
em @
|
12
12
|
!= title
|
13
13
|
li(class="link")
|
@@ -1,12 +1,12 @@
|
|
1
1
|
div(class="meta")
|
2
2
|
if date(post.date) != date(post.updated) || time(post.date) != time(post.updated)
|
3
3
|
span(class="icon")
|
4
|
-
i(class="
|
4
|
+
i(class="fa fa-solid fa-eye")
|
5
5
|
span 此文章已被阅读次数:
|
6
6
|
span(id="twikoo_visitors" class="waline-pageview-count" data-path=post.path) 正在加载...
|
7
7
|
span(class="item")
|
8
8
|
span(class="icon")
|
9
|
-
i(class="
|
9
|
+
i(class="fa fa-solid fa-calendar-check")
|
10
10
|
span(class="text")
|
11
11
|
!= __('post.edited')
|
12
12
|
time(title=__('post.modified') + __('symbol.colon') + full_date(post.updated) itemprop="dateModified" datetime=moment(post.updated).format())
|
@@ -1,7 +1,7 @@
|
|
1
1
|
mixin navpost(item, type)
|
2
2
|
- var postText = item.title || item.link || __('post.untitled')
|
3
3
|
- var lastcat = item.categories.last()
|
4
|
-
- var itemlink=`<span class="type">${__('post.' + type)}</span><span class="category"><i class="
|
4
|
+
- var itemlink=`<span class="type">${__('post.' + type)}</span><span class="category"><i class="fa fa-solid fa-flag"></i>${lastcat?.name}</span><h3>${ postText }</h3>`
|
5
5
|
!= _url(item.path, itemlink, {itemprop: 'url', rel: type, 'data-background-image': _cover(item), title: postText})
|
6
6
|
|
7
7
|
div(class="post-nav")
|
@@ -17,7 +17,7 @@ article(itemscope itemtype="http://schema.org/Article" class="post block" lang=t
|
|
17
17
|
div(class="tags")
|
18
18
|
each tag in post.tags.toArray()
|
19
19
|
a(href!=url_for(tag.path) rel="tag")
|
20
|
-
i(class="
|
20
|
+
i(class="fa fa-solid fa-tag")
|
21
21
|
!= tag.name
|
22
22
|
footer
|
23
23
|
!= partial('_partials/post/footer.pug')
|
package/layout/archive.pug
CHANGED
@@ -103,7 +103,7 @@ block content
|
|
103
103
|
a(href=url_for(cat.path)) #{cat.name}
|
104
104
|
div(class="title")
|
105
105
|
if post.link
|
106
|
-
- var postTitleIcon = '<i class="
|
106
|
+
- var postTitleIcon = '<i class="fa fa-solid fa-up-right-from-square"></i>'
|
107
107
|
- var postText = post.title || post.link
|
108
108
|
!= _url(post.link, postText + postTitleIcon, {class: 'external', itemprop: 'url'})
|
109
109
|
else
|
package/layout/category.pug
CHANGED
@@ -53,7 +53,7 @@ block content
|
|
53
53
|
) #{date(post.date, 'MM-DD')}
|
54
54
|
div(class="title")
|
55
55
|
if post.link
|
56
|
-
- var postTitleIcon = '<i class="
|
56
|
+
- var postTitleIcon = '<i class="fa fa-solid fa-up-right-from-square"></i>'
|
57
57
|
- var postText = post.title || post.link
|
58
58
|
!= _url(post.link, postText + postTitleIcon, {class: 'external', itemprop: 'url'})
|
59
59
|
else
|
package/layout/page.pug
CHANGED
@@ -16,7 +16,7 @@ block title
|
|
16
16
|
block header
|
17
17
|
h1(itemprop="name headline")
|
18
18
|
if page.link
|
19
|
-
- var postTitleIcon = '<i class="
|
19
|
+
- var postTitleIcon = '<i class="fa fa-solid fa-up-right-from-square"></i>'
|
20
20
|
- var postText = page.title || page.link
|
21
21
|
!= _url(page.link, postText + postTitleIcon, {class: 'link external', itemprop: 'url'})
|
22
22
|
else
|
package/layout/post.pug
CHANGED
@@ -17,7 +17,7 @@ block title
|
|
17
17
|
block header
|
18
18
|
h1(itemprop="name headline")
|
19
19
|
if page.link
|
20
|
-
- var postTitleIcon = '<i class="
|
20
|
+
- var postTitleIcon = '<i class="fa fa-solid fa-up-right-from-square"></i>'
|
21
21
|
- var postText = page.title || page.link
|
22
22
|
!= _url(page.link, postText + postTitleIcon, {class: 'link external', itemprop: 'url'})
|
23
23
|
else
|
package/layout/tag.pug
CHANGED
@@ -33,7 +33,7 @@ block content
|
|
33
33
|
!= cat.name
|
34
34
|
div(class="title")
|
35
35
|
if post.link
|
36
|
-
- var postTitleIcon = '<i class="
|
36
|
+
- var postTitleIcon = '<i class="fa fa-solid fa-up-right-from-square"></i>'
|
37
37
|
- var postText = post.title || post.link
|
38
38
|
!= _url(post.link, postText + postTitleIcon, {class: 'external', itemprop: 'url'})
|
39
39
|
else
|
package/package.json
CHANGED
@@ -145,6 +145,7 @@ input, textarea {
|
|
145
145
|
src: url("https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono@2.242/fonts/webfonts/JetBrainsMono-Regular.woff2") format("woff2");
|
146
146
|
}
|
147
147
|
|
148
|
+
// TODO
|
148
149
|
.ic {
|
149
150
|
font-family: "ic" !important;
|
150
151
|
-webkit-font-smoothing: antialiased;
|
@@ -158,15 +159,39 @@ input, textarea {
|
|
158
159
|
line-height: 1;
|
159
160
|
}
|
160
161
|
|
162
|
+
.fa {
|
163
|
+
-webkit-font-smoothing: antialiased;
|
164
|
+
-moz-osx-font-smoothing: grayscale;
|
165
|
+
text-align: center;
|
166
|
+
width: 1.25em;
|
167
|
+
display: inline-block;
|
168
|
+
font-style: normal;
|
169
|
+
font-variant: normal;
|
170
|
+
text-rendering: auto;
|
171
|
+
line-height: 1;
|
172
|
+
}
|
173
|
+
|
174
|
+
// TODO
|
161
175
|
.ic em {
|
162
176
|
font-size: 0;
|
163
177
|
}
|
164
178
|
|
179
|
+
.fa em {
|
180
|
+
font-size: 0;
|
181
|
+
}
|
182
|
+
|
183
|
+
// TODO
|
165
184
|
.ic-lg {
|
166
185
|
font-size: 1.33333em;
|
167
186
|
line-height: .75em;
|
168
187
|
vertical-align: -.0667em;
|
169
188
|
}
|
189
|
+
|
190
|
+
.fa-lg {
|
191
|
+
font-size: 1.33333em;
|
192
|
+
line-height: .75em;
|
193
|
+
vertical-align: -.0667em;
|
194
|
+
}
|
170
195
|
//.weather {
|
171
196
|
// color: var(--text-color) !important;
|
172
197
|
//}
|
package/source/js/_app/global.js
CHANGED
@@ -149,7 +149,7 @@ const getScript = function (url, callback, condition) {
|
|
149
149
|
else {
|
150
150
|
let script = document.createElement('script');
|
151
151
|
script.onload = function (_, isAbort) {
|
152
|
-
if (isAbort || !script.readyState
|
152
|
+
if (isAbort || !script.readyState) {
|
153
153
|
console.log("abort!");
|
154
154
|
script.onload = null;
|
155
155
|
script = undefined;
|
@@ -288,7 +288,7 @@ const pjaxScript = function (element) {
|
|
288
288
|
}
|
289
289
|
parent.appendChild(script);
|
290
290
|
};
|
291
|
-
const
|
291
|
+
const pageScrollOld = function (target, offset, complete) {
|
292
292
|
const opt = {
|
293
293
|
targets: typeof offset === 'number' ? target.parentNode : document.scrollingElement,
|
294
294
|
duration: 500,
|
@@ -300,3 +300,27 @@ const pageScroll = function (target, offset, complete) {
|
|
300
300
|
};
|
301
301
|
anime(opt);
|
302
302
|
};
|
303
|
+
const pageScroll = (target, offset, complete) => {
|
304
|
+
const opt = {
|
305
|
+
left: 0,
|
306
|
+
behavior: "smooth"
|
307
|
+
};
|
308
|
+
if (typeof target === "number") {
|
309
|
+
opt.top = target;
|
310
|
+
}
|
311
|
+
else {
|
312
|
+
if (typeof target === 'number') {
|
313
|
+
opt.top = offset || target;
|
314
|
+
}
|
315
|
+
else {
|
316
|
+
if (offset || target) {
|
317
|
+
opt.top = target.top() + document.documentElement.scrollTop - siteNavHeight;
|
318
|
+
}
|
319
|
+
else {
|
320
|
+
opt.top = 0;
|
321
|
+
}
|
322
|
+
}
|
323
|
+
}
|
324
|
+
scrollTo(opt);
|
325
|
+
complete && complete();
|
326
|
+
};
|