Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大白技术控
yanglr2010
提交
296b4242
Y
yanglr2010
项目概览
大白技术控
/
yanglr2010
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yanglr2010
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
296b4242
编写于
9月 11, 2019
作者:
EvanOne(文一)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: Modify animation of heading
上级
a01c8cc7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
13 deletion
+18
-13
source/css/_common/components/sidebar/index.styl
source/css/_common/components/sidebar/index.styl
+7
-0
source/css/_common/outline/macro.styl
source/css/_common/outline/macro.styl
+0
-7
source/css/_variables/index.styl
source/css/_variables/index.styl
+1
-1
source/js/scroll.js
source/js/scroll.js
+4
-1
source/js/sidebar.js
source/js/sidebar.js
+6
-4
未找到文件。
source/css/_common/components/sidebar/index.styl
浏览文件 @
296b4242
.sidebar {
.sidebar {
width: convert(hexo-config('sidebar.width') || '$sidebar-width');
width: convert(hexo-config('sidebar.width') || '$sidebar-width');
&.sticky {
position: fixed;
top: convert(hexo-config('sidebar.offsetTop') || '30px');
z-index: $z-index0;
transform: translateZ(0);
}
.hide {
.hide {
display: none;
display: none;
}
}
...
...
source/css/_common/outline/macro.styl
浏览文件 @
296b4242
...
@@ -29,13 +29,6 @@
...
@@ -29,13 +29,6 @@
if (hexo-config('sidebar.enable')) {
if (hexo-config('sidebar.enable')) {
.sidebar {
.sidebar {
float: convert(hexo-config('sidebar.position'));
float: convert(hexo-config('sidebar.position'));
&.sticky {
position: fixed;
top: convert(hexo-config('sidebar.offsetTop') || '30px');
z-index: $z-index0;
transform: translateZ(0);
}
}
}
}
}
...
...
source/css/_variables/index.styl
浏览文件 @
296b4242
...
@@ -131,7 +131,7 @@ $category-list-dot-color = $blue-light
...
@@ -131,7 +131,7 @@ $category-list-dot-color = $blue-light
$category-list-dot-hover-color = $orange-dark
$category-list-dot-hover-color = $orange-dark
$category-post-count-color = #99a9bf
$category-post-count-color = #99a9bf
$category-link-color = $blue-light
$category-link-color = $blue-light
$category-link-hover-color = $
blue-light
$category-link-hover-color = $
orange-dark
// Tag page
// Tag page
$tag-hover-color = $orange-dark
$tag-hover-color = $orange-dark
...
...
source/js/scroll.js
浏览文件 @
296b4242
...
@@ -45,7 +45,10 @@ $(document).ready(function () {
...
@@ -45,7 +45,10 @@ $(document).ready(function () {
function
scrollHeadingToTop
(
anchor
)
{
function
scrollHeadingToTop
(
anchor
)
{
$
(
anchor
)
$
(
anchor
)
.
velocity
(
'
stop
'
)
.
velocity
(
'
stop
'
)
.
velocity
(
'
scroll
'
,
{
easing
:
'
easeOutSine
'
});
.
velocity
(
'
scroll
'
,
{
easing
:
'
ease-in-out
'
,
duration
:
600
});
}
}
var
isBack2topShow
=
false
;
var
isBack2topShow
=
false
;
...
...
source/js/sidebar.js
浏览文件 @
296b4242
...
@@ -83,19 +83,21 @@ $(document).ready(function () {
...
@@ -83,19 +83,21 @@ $(document).ready(function () {
// Distance from sidebar to top.
// Distance from sidebar to top.
var
SIDEBAR_STICKY_TOP
=
parseInt
(
CONFIG
.
sidebar
.
offsetTop
);
var
SIDEBAR_STICKY_TOP
=
parseInt
(
CONFIG
.
sidebar
.
offsetTop
);
var
isSidebarSticky
=
false
;
var
isSidebarSticky
=
false
;
// Sticky the sidebar when it arrived the top.
// Sticky the sidebar when it arrived the top.
function
sidebarSticky
()
{
function
sidebarSticky
()
{
var
targetY
=
$
(
'
#main
'
)[
0
].
getBoundingClientRect
().
top
;
var
$sidebar
=
$
(
'
#sidebar
'
);
var
targetY
=
document
.
getElementById
(
'
main
'
).
getBoundingClientRect
().
top
;
if
(
targetY
<
SIDEBAR_STICKY_TOP
)
{
if
(
targetY
<
SIDEBAR_STICKY_TOP
)
{
if
(
!
isSidebarSticky
)
{
if
(
!
isSidebarSticky
)
{
$
(
'
#sidebar
'
)
.
addClass
(
'
sticky
'
);
$
sidebar
.
addClass
(
'
sticky
'
);
isSidebarSticky
=
true
;
isSidebarSticky
=
true
;
}
}
}
else
{
}
else
{
if
(
isSidebarSticky
)
{
if
(
isSidebarSticky
)
{
$
(
'
#sidebar
'
)
.
removeClass
(
'
sticky
'
);
$
sidebar
.
removeClass
(
'
sticky
'
);
isSidebarSticky
=
false
;
isSidebarSticky
=
false
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录