Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
31b472e2
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
31b472e2
编写于
1月 06, 2016
作者:
A
afc163
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update toc style
上级
2be1ac90
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
97 addition
and
54 deletion
+97
-54
site/static/script.js
site/static/script.js
+29
-6
site/static/style.css
site/static/style.css
+66
-46
site/templates/demos.html
site/templates/demos.html
+1
-1
site/templates/page.html
site/templates/page.html
+1
-1
未找到文件。
site/static/script.js
浏览文件 @
31b472e2
...
...
@@ -42,10 +42,8 @@ InstantClickChangeFns.push(function() {
});
function
hashChange
()
{
if
(
location
.
hash
.
indexOf
(
'
#demo-
'
)
===
0
)
{
$
(
'
.demos-anchor a
'
).
removeClass
(
'
current
'
);
$
(
'
.demos-anchor a[href="
'
+
location
.
hash
+
'
"]
'
).
addClass
(
'
current
'
);
}
$
(
'
.anchor a
'
).
removeClass
(
'
current
'
);
$
(
'
.anchor a[href="
'
+
decodeURI
(
location
.
hash
)
+
'
"]
'
).
addClass
(
'
current
'
);
}
hashChange
();
...
...
@@ -56,6 +54,31 @@ InstantClickChangeFns.push(function() {
// 移动 API 文档到演示下方
$
(
'
.markdown #api
'
).
nextAll
().
andSelf
().
appendTo
(
'
.api-container
'
);
var
titles
=
$
(
'
.markdown :header:not(h1)
'
);
function
onScroll
()
{
var
doc
=
$
(
document
);
var
top
=
doc
.
scrollTop
(),
i
;
if
(
top
>=
doc
.
height
()
-
$
(
window
).
height
()
-
20
)
{
i
=
titles
.
length
-
1
;
}
else
{
for
(
i
=
0
;
i
<
titles
.
length
;
i
++
)
{
if
(
top
<
titles
.
eq
(
i
).
offset
().
top
-
20
)
{
break
;
}
}
i
--
;
i
=
(
i
<
0
)
?
0
:
i
;
i
=
(
i
>
titles
.
length
-
1
)
?
(
title
.
length
-
1
)
:
i
;
}
$
(
'
.anchor a
'
).
removeClass
(
'
current
'
);
$
(
'
.anchor a
'
).
eq
(
i
).
addClass
(
'
current
'
);
}
onScroll
();
// 滚动高亮
$
(
window
).
on
(
'
scroll
'
,
onScroll
);
// 添加上一页下一页
if
(
$
(
'
.aside-container li > a
'
).
length
>
0
)
{
var
links
=
$
(
'
.aside-container li > a
'
);
...
...
@@ -69,10 +92,10 @@ InstantClickChangeFns.push(function() {
var
prevLink
=
links
[
currentLinkIndex
-
1
];
var
nextLink
=
links
[
currentLinkIndex
+
1
];
if
(
prevLink
)
{
prevNextNavNode
.
append
(
'
<a href="
'
+
prevLink
.
href
+
'
">
'
+
prevLink
.
innerHTML
+
'
</a>
'
);
prevNextNavNode
.
append
(
'
<a
class="prev-page"
href="
'
+
prevLink
.
href
+
'
">
'
+
prevLink
.
innerHTML
+
'
</a>
'
);
}
if
(
nextLink
)
{
prevNextNavNode
.
append
(
'
<a href="
'
+
nextLink
.
href
+
'
">
'
+
nextLink
.
innerHTML
+
'
</a>
'
);
prevNextNavNode
.
append
(
'
<a
class="next-page"
href="
'
+
nextLink
.
href
+
'
">
'
+
nextLink
.
innerHTML
+
'
</a>
'
);
}
prevNextNavNode
.
appendTo
(
'
.main-container
'
);
}
...
...
site/static/style.css
浏览文件 @
31b472e2
...
...
@@ -499,6 +499,7 @@ footer ul li > a {
animation
:
xRightMatrix
.5s
ease-out
;
background
:
#fff
;
min-height
:
500px
;
position
:
relative
;
}
.main-container-center
{
...
...
@@ -656,6 +657,69 @@ footer ul li > a {
margin-left
:
0.5em
;
}
.prev-next-nav
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
overflow
:
hidden
;
border-top
:
1px
solid
#e9e9e9
;
font-size
:
16px
;
}
.prev-next-nav
>
a
{
padding
:
0
24px
;
width
:
50%
;
float
:
left
;
line-height
:
72px
;
height
:
72px
;
}
.prev-next-nav
>
.prev-page
:before
{
font-family
:
'anticon'
;
content
:
'\e601'
;
font-size
:
12px
;
margin-right
:
1em
;
}
.prev-next-nav
>
.next-page
{
text-align
:
right
;
float
:
right
;
}
.prev-next-nav
>
.next-page
:after
{
font-family
:
'anticon'
;
content
:
'\e600'
;
font-size
:
12px
;
margin-left
:
1em
;
}
.toc
{
position
:
sticky
;
top
:
40px
;
float
:
right
;
font-size
:
12px
;
}
.toc
li
>
ul
{
text-indent
:
10px
;
}
.toc
a
{
padding-left
:
10px
;
border-left
:
2px
solid
#eee
;
display
:
block
;
transition
:
all
0.3s
ease
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
max-width
:
120px
;
}
.toc
a
.current
{
border-color
:
#2db7f5
;
}
/****************************动画样式*********************************/
.delay-mode
{
animation-fill-mode
:
backwards
!important
;
...
...
@@ -2121,8 +2185,8 @@ a.entry-link:hover .anticon-smile {
.demos-anchor
{
color
:
#aaa
;
position
:
fixed
;
top
:
1
2
0px
;
right
:
0
;
top
:
1
0
0px
;
right
:
32px
;
z-index
:
100
;
transition
:
all
0.3s
ease
;
background
:
#fff
;
...
...
@@ -2138,47 +2202,3 @@ a.entry-link:hover .anticon-smile {
animation-fill-mode
:
forwards
;
opacity
:
0
;
}
.demos-anchor
li
{
list-style
:
decimal
outside
;
width
:
75px
;
margin-bottom
:
2px
;
}
.demos-anchor
a
{
color
:
#666
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
vertical-align
:
bottom
;
display
:
inline-block
;
width
:
100%
;
}
.demos-anchor
a
>
span
{
position
:
relative
;
}
.demos-anchor
a
.current
>
span
,
.demos-anchor
a
>
span
:hover
{
color
:
#2db7f5
;
}
.demos-anchor
a
>
span
:after
{
text-decoration
:
underline
;
position
:
absolute
;
top
:
auto
;
bottom
:
-1px
;
left
:
0
;
width
:
100%
;
height
:
1px
;
background-color
:
#2db7f5
;
content
:
''
;
transition
:
all
0.2s
;
backface-visibility
:
hidden
;
transform
:
scaleX
(
0
);
}
.demos-anchor
a
>
span
:hover:after
{
transform
:
scaleX
(
1
);
}
site/templates/demos.html
浏览文件 @
31b472e2
...
...
@@ -33,7 +33,7 @@
</div>
{%- endif %}
</div>
<ul
class=
"
demos-
anchor"
>
<ul
class=
"
toc demos-anchor
anchor"
>
{%- for item in items %}
{%- set post = item.meta.filepath|parsePost %}
<li>
...
...
site/templates/page.html
浏览文件 @
31b472e2
...
...
@@ -16,9 +16,9 @@
{% block content %}
<section
class=
"main-container"
>
<div
class=
"toc anchor"
>
{{ post.toc }}
</div>
<article
class=
"markdown"
>
<h1>
{{ post.title }} {{ post.meta.chinese }}
</h1>
<div
class=
"toc"
>
{{ post.toc }}
</div>
{{ post.html|add_anchor }}
</article>
</section>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录