Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
K
kpp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Veselov
kpp
Commits
e96790ce
Commit
e96790ce
authored
Apr 29, 2016
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил кнопку прокрутки вверх
parent
5c5f5b47
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
0 deletions
+66
-0
to-up.svg
src/blocks/to-top/img_to_bg/to-up.svg
+1
-0
to-top.html
src/blocks/to-top/to-top.html
+8
-0
to-top.js
src/blocks/to-top/to-top.js
+29
-0
to-top.less
src/blocks/to-top/to-top.less
+25
-0
blocks_library.html
src/blocks_library.html
+2
-0
style.less
src/less/style.less
+1
-0
No files found.
src/blocks/to-top/img_to_bg/to-up.svg
0 → 100644
View file @
e96790ce
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 17 11"
width=
"17"
height=
"11"
><path
fill=
"#fff"
d=
"M.202 1.97L1.956.204A.61.61 0 0 1 2.43 0a.61.61 0 0 1 .47.204L8.5 5.84 14.1.204A.61.61 0 0 1 14.57 0a.61.61 0 0 1 .474.204l1.754 1.766a.618.618 0 0 1 .202.473.62.62 0 0 1-.202.476l-7.826 7.875A.61.61 0 0 1 8.5 11a.61.61 0 0 1-.472-.204L.202 2.92A.618.618 0 0 1 0 2.444c0-.203.067-.34.202-.475z"
/></svg>
src/blocks/to-top/to-top.html
0 → 100644
View file @
e96790ce
<!--DEV
Нужно убрать пробел между @-ами:
@ @include('blocks/to-top/to-top.html')
-->
<div
class=
"to-top"
>
content
</div>
src/blocks/to-top/to-top.js
0 → 100644
View file @
e96790ce
$
(
document
).
ready
(
function
()
{
var
t0
;
$
(
'#toTop'
).
hide
().
on
(
'click'
,
function
(
event
){
event
.
preventDefault
();
$
(
'body'
).
animate
({
scrollTop
:
0
},
300
);
});
$
(
window
).
on
(
'scroll'
,
function
(){
clearTimeout
(
t0
);
t0
=
setTimeout
(
function
()
{
showScrollTopButton
();
console
.
log
(
'scroll'
);
},
50
);
});
showScrollTopButton
();
function
showScrollTopButton
(){
if
(
$
(
document
).
scrollTop
()
>=
500
)
{
$
(
'#toTop'
).
fadeIn
();
}
else
{
$
(
'#toTop'
).
fadeOut
();
}
}
});
src/blocks/to-top/to-top.less
0 → 100644
View file @
e96790ce
// Для импорта в диспетчер подключений: @import './src/blocks/to-top/to-top.less';
@import '../../less/variables.less'; // только для удобства обращения к переменным
.to-top {
position: fixed;
right: 2rem;
bottom: 2rem;
z-index: 1;
width: 4rem;
height: 4rem;
border-radius: 50%;
background-color: #000;
color: transparent;
font: 0/0 a;
background-image: data-uri('image/svg+xml;charset=UTF-8', './src/blocks/to-top/img_to_bg/to-up.svg');
background-repeat: no-repeat;
background-position: center;
transform: rotate(180deg);
.js & {
display: none;
}
}
src/blocks_library.html
View file @
e96790ce
...
@@ -4666,6 +4666,8 @@
...
@@ -4666,6 +4666,8 @@
</section>
</section>
<a
href=
"#"
class=
"to-top"
id=
"toTop"
>
↑
</a>
@@include('blocks/page-footer/page-footer.html')
@@include('blocks/page-footer/page-footer.html')
@@include('_include/page_bottom.html')
@@include('_include/page_bottom.html')
<script>
hljs
.
initHighlightingOnLoad
();
</script>
<script>
hljs
.
initHighlightingOnLoad
();
</script>
...
...
src/less/style.less
View file @
e96790ce
...
@@ -70,3 +70,4 @@
...
@@ -70,3 +70,4 @@
@import './src/blocks/code/code.less';
@import './src/blocks/code/code.less';
@import './src/blocks/collapse/collapse.less';
@import './src/blocks/collapse/collapse.less';
@import './src/blocks/toggler-burger/toggler-burger.less';
@import './src/blocks/toggler-burger/toggler-burger.less';
@import './src/blocks/to-top/to-top.less';
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment