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
ce339541
Commit
ce339541
authored
Nov 17, 2017
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил круговые диаграммы
parent
6a71c404
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
3 deletions
+105
-3
projectConfig.json
projectConfig.json
+3
-2
blocks-demo.html
src/blocks-demo.html
+22
-1
pie-chart.html
src/blocks/pie-chart/pie-chart.html
+14
-0
pie-chart.js
src/blocks/pie-chart/pie-chart.js
+16
-0
pie-chart.scss
src/blocks/pie-chart/pie-chart.scss
+50
-0
No files found.
projectConfig.json
View file @
ce339541
...
@@ -55,7 +55,8 @@
...
@@ -55,7 +55,8 @@
"close"
:
[],
"close"
:
[],
"tabs"
:
[],
"tabs"
:
[],
"object-fit-polyfill"
:
[],
"object-fit-polyfill"
:
[],
"embed-responsive"
:
[]
"embed-responsive"
:
[],
"pie-chart"
:
[]
},
},
"addCssBefore"
:
[
"addCssBefore"
:
[
"./src/scss/variables.scss"
,
"./src/scss/variables.scss"
,
...
@@ -93,4 +94,4 @@
...
@@ -93,4 +94,4 @@
"buildPath"
:
"./build/"
,
"buildPath"
:
"./build/"
,
"blocksDirName"
:
"blocks"
"blocksDirName"
:
"blocks"
}
}
}
}
\ No newline at end of file
src/blocks-demo.html
View file @
ce339541
...
@@ -1431,7 +1431,7 @@
...
@@ -1431,7 +1431,7 @@
</section>
</section>
<section
class=
"blocks-library__item
blocks-library__item--menusep
"
id=
"embed-responsive"
data-name=
".embed-responsive"
>
<section
class=
"blocks-library__item"
id=
"embed-responsive"
data-name=
".embed-responsive"
>
<h2
class=
"blocks-library__item-title"
>
Адаптирующийся медиаконтент
</h2>
<h2
class=
"blocks-library__item-title"
>
Адаптирующийся медиаконтент
</h2>
...
@@ -1454,6 +1454,27 @@
...
@@ -1454,6 +1454,27 @@
</section>
</section>
<section
class=
"blocks-library__item blocks-library__item--menusep"
id=
"pie-chart"
data-name=
".pie-chart"
>
<h2
class=
"blocks-library__item-title"
>
Круговые диаграммы
</h2>
<div
class=
"pie-chart"
>
0%
</div>
<div
class=
"pie-chart"
>
20%
</div>
<div
class=
"pie-chart"
>
40%
</div>
<div
class=
"pie-chart"
>
90%
</div>
<div
class=
"pie-chart"
>
80%
</div>
<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>
<
div class="">20%
<
/div>
</code>
</pre>
</div>
</div>
</section>
...
...
src/blocks/pie-chart/pie-chart.html
0 → 100644
View file @
ce339541
<!--DEV
Для использования этого файла как шаблона:
@ @include('blocks/pie-chart/pie-chart.html')
(Нужно убрать пробел между символами @)
Подробнее: https://www.npmjs.com/package/gulp-file-include
<div class="pie-chart">20%</div>
-->
src/blocks/pie-chart/pie-chart.js
0 → 100644
View file @
ce339541
document
.
addEventListener
(
'DOMContentLoaded'
,
function
(){
// Автор кода — Лия Веру
function
$$
(
selector
,
context
)
{
context
=
context
||
document
;
var
elements
=
context
.
querySelectorAll
(
selector
);
return
Array
.
prototype
.
slice
.
call
(
elements
);
}
$$
(
'.pie-chart'
).
forEach
(
function
(
pie
)
{
var
p
=
pie
.
textContent
;
pie
.
style
.
animationDelay
=
'-'
+
parseFloat
(
p
)
+
's'
;
});
});
src/blocks/pie-chart/pie-chart.scss
0 → 100644
View file @
ce339541
// В этом файле должны быть стили для БЭМ-блока pie-chart, его элементов,
// модификаторов, псевдоселекторов, псевдоэлементов, @media-условий...
// Очередность: http://nicothin.github.io/idiomatic-pre-CSS/#priority
$gray-light
:
hsl
(
0
,
0%
,
60%
)
!
default
;
$gray-lighter
:
hsl
(
0
,
0%
,
80%
)
!
default
;
.pie-chart
{
$block-name
:
&
;
// #{$block-name}__element
display
:
inline-block
;
position
:
relative
;
width
:
100px
;
line-height
:
100px
;
border-radius
:
50%
;
background
:
$gray-lighter
;
background-image
:
linear-gradient
(
to
right
,
transparent
50%
,
$gray-light
0
);
color
:
transparent
;
text-align
:
center
;
&
:before
{
content
:
''
;
position
:
absolute
;
top
:
0
;
left
:
50%
;
width
:
50%
;
height
:
100%
;
border-radius
:
0
100%
100%
0
/
50%
;
background-color
:
inherit
;
transform-origin
:
left
;
animation
:
pie-chart-spin
50s
linear
infinite
,
pie-chart-bg
100s
step-end
infinite
;
animation-play-state
:
paused
;
animation-delay
:
inherit
;
}
@keyframes
pie-chart-spin
{
to
{
transform
:
rotate
(
0
.5turn
);
}
}
@keyframes
pie-chart-bg
{
50
%
{
background
:
$gray-light
;
}
}
}
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