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
714694d2
Commit
714694d2
authored
Mar 20, 2017
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил to-top
parent
5e23a9d3
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
29 deletions
+51
-29
package.json
package.json
+2
-1
blocks-demo.html
src/blocks-demo.html
+21
-0
btn.scss
src/blocks/btn/btn.scss
+0
-1
to-top.html
src/blocks/to-top/to-top.html
+1
-1
to-top.js
src/blocks/to-top/to-top.js
+1
-1
to-top.less
src/blocks/to-top/to-top.less
+0
-25
to-top.scss
src/blocks/to-top/to-top.scss
+26
-0
No files found.
package.json
View file @
714694d2
...
...
@@ -24,7 +24,8 @@
"code"
:
[],
"thumb"
:
[],
"alert"
:
[],
"btn"
:
[]
"btn"
:
[],
"to-top"
:
[]
},
"addCssBefore"
:
[
"./src/scss/variables.scss"
,
...
...
src/blocks-demo.html
View file @
714694d2
...
...
@@ -539,6 +539,25 @@
</section>
<section
class=
"blocks-library__item"
id=
"btn"
data-name=
".btn"
>
<h2
class=
"blocks-library__item-title"
>
Кнопка скролла вверх
</h2>
<p>
Кнопка появляется, если вертикальный скролл более 900 пикс.
</p>
<p
class=
"alert alert--warning"
>
Зависит от
<a
href=
"https://jquery.com/"
>
jQuery
</a>
(включен в сборку по умолчанию).
</p>
<div
class=
"blocks-library__code-wrapper"
>
<span
class=
"blocks-library__code-show-trigger"
title=
"Показать код"
><i
class=
"blocks-library__code-icon"
></i></span>
<div
class=
"blocks-library__code"
>
<pre
class=
"code"
>
<code>
<
a href="#" class="to-top" id="toTop">↑
<
/a>
</code>
</pre>
</div>
</div>
</section>
</div>
<style>
...
...
@@ -550,6 +569,8 @@
}
</style>
<a
href=
"#"
class=
"to-top"
id=
"toTop"
>
↑
</a>
@@include('_include/page_bottom.html')
</body>
</html>
src/blocks/btn/btn.scss
View file @
714694d2
...
...
@@ -2,7 +2,6 @@
// модификаторов, псевдоселекторов, псевдоэлементов, $media-условий...
// Не пишите здесь другие селекторы.
$gray-lighter
:
hsl
(
0
,
0%
,
80%
);
$gray-lightest
:
hsl
(
0
,
0%
,
90%
);
$text-color
:
hsl
(
0
,
0%
,
10%
);
...
...
src/blocks/to-top/to-top.html
View file @
714694d2
...
...
@@ -5,4 +5,4 @@
@ @include('blocks/to-top/to-top.html')
-->
<
div
class=
"to-top"
>
content
</div
>
<
a
href=
"#"
class=
"to-top"
id=
"toTop"
>
↑
</a
>
src/blocks/to-top/to-top.js
View file @
714694d2
...
...
@@ -17,7 +17,7 @@ $( document ).ready(function() {
showScrollTopButton
();
function
showScrollTopButton
(){
if
(
$
(
document
).
scrollTop
()
>=
5
00
)
{
if
(
$
(
document
).
scrollTop
()
>=
9
00
)
{
$
(
'#toTop'
).
fadeIn
();
}
else
{
...
...
src/blocks/to-top/to-top.less
deleted
100644 → 0
View file @
5e23a9d3
// Для импорта в диспетчер подключений: @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/to-top/to-top.scss
0 → 100644
View file @
714694d2
// В этом файле должны быть стили только для БЭМ-блока alert, его элементов,
// модификаторов, псевдоселекторов, псевдоэлементов, $media-условий...
// Не пишите здесь другие селекторы.
.to-top
{
position
:
fixed
;
right
:
1rem
;
bottom
:
1rem
;
z-index
:
1
;
width
:
4rem
;
height
:
4rem
;
border-radius
:
50%
;
background-color
:
#000
;
color
:
transparent
;
font
:
0
/
0
a
;
// см. img_to_bg/to-up.svg
// http://yoksel.github.io/url-encoder/ru/
background-image
:
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11' width='17' height='11'%3E%3Cpath fill='%23fff' 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'/%3E%3C/svg%3E")
;
background-repeat
:
no-repeat
;
background-position
:
center
;
transform
:
rotate
(
180deg
);
.js
&
{
display
:
none
;
}
}
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