Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大白技术控
yanglr2010
提交
c05223ad
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 搜索 >>
提交
c05223ad
编写于
11月 04, 2019
作者:
EvanOne(文一)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: Add the icon that prompt to scroll down in the header of site
上级
7933d468
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
65 addition
and
0 deletion
+65
-0
_config.yml
_config.yml
+4
-0
layout/_partials/config.pug
layout/_partials/config.pug
+8
-0
layout/_partials/header/header.pug
layout/_partials/header/header.pug
+4
-0
layout/_third-party/pjax.pug
layout/_third-party/pjax.pug
+1
-0
source/css/_common/components/header/index.styl
source/css/_common/components/header/index.styl
+35
-0
source/js/header.js
source/js/header.js
+13
-0
未找到文件。
_config.yml
浏览文件 @
c05223ad
...
...
@@ -101,6 +101,10 @@ header:
enable
:
false
# Opacity of mask (value: 0 ~ 1).
opacity
:
0.5
# The icon that prompt to scroll down.
scroll_down_icon
:
enable
:
false
animation
:
true
# Creative Commons 4.0 International License.
creative_commons
:
...
...
layout/_partials/config.pug
浏览文件 @
c05223ad
...
...
@@ -38,6 +38,13 @@
});
}
var header = "undefined";
if (theme.header) {
header = JSON.stringify({
scrollDownIcon: theme.header.scroll_down_icon.enable,
});
}
var gallery_waterfall = "undefined";
if (theme.gallery_waterfall.enable) {
gallery_waterfall = JSON.stringify(theme.gallery_waterfall);
...
...
@@ -88,6 +95,7 @@ script.
algolia: !{ algolia },
fontawesome: !{ fontawesome },
sidebar: !{ sidebar },
header: !{ header },
back2top: !{ back2top },
reward: !{ theme.reward.enable },
fancybox: !{ theme.fancybox },
...
...
layout/_partials/header/header.pug
浏览文件 @
c05223ad
...
...
@@ -22,3 +22,7 @@ div.header-info(style=`${
div.header-info-inner
div.header-info-title= config.title
div.header-info-subtitle= config.subtitle
if theme.header.scroll_down_icon && theme.header.scroll_down_icon.enable
div.header-info-scrolldown
i.fa.fa-angle-down.header-info-scrolldown__icon
layout/_third-party/pjax.pug
浏览文件 @
c05223ad
...
...
@@ -97,6 +97,7 @@ script.
Stun.utils.pjaxReloadBoot();
Stun.utils.pjaxReloadScroll();
Stun.utils.pjaxReloadHeader();
Stun.utils.pjaxReloadSidebar();
}, false);
}, false);
source/css/_common/components/header/index.styl
浏览文件 @
c05223ad
...
...
@@ -180,5 +180,40 @@ if (hexo-config('header.nav_height') && match('%', hexo-config('header.nav_heigh
font-weight: $font-weight-normal;
color: $white-light;
}
if (hexo-config('header.scroll_down_icon') && hexo-config('header.scroll_down_icon.enable')) {
&-scrolldown {
position: absolute;
bottom: 0;
left: 50%;
z-index: $z-index2;
transform: translate3d(-50%, -.5rem, 0);
cursor: pointer;
if (hexo-config('header.scroll_down_icon.animation')) {
animation: arrowUpDown 1.5s infinite;
@keyframes arrowUpDown {
0%,
100% {
opacity: .8;
transform: translate3d(-50%, -.5rem, 0);
}
50% {
opacity: .4;
transform: translate3d(-50%, -1.5rem, 0);
}
}
}
&__icon {
font-size: 2rem;
font-weight: $font-weight-bolder;
text-align: center;
color: #fff;
}
}
}
}
}
source/js/header.js
浏览文件 @
c05223ad
...
...
@@ -98,4 +98,17 @@ $(document).ready(function () {
$submenu
.
length
&&
$submenu
.
css
(
'
display
'
,
'
none
'
);
});
Stun
.
utils
.
pjaxReloadHeader
=
function
()
{
if
(
CONFIG
.
header
.
scrollDownIcon
)
{
$
(
'
.header-info-scrolldown
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#container
'
).
velocity
(
'
scroll
'
,
{
offset
:
$
(
'
#header
'
).
height
()
});
});
}
};
// Initializaiton
Stun
.
utils
.
pjaxReloadHeader
();
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录