initial pie chart

This commit is contained in:
2017-08-19 18:55:15 -05:00
committed by Mark Moser
parent 83acf3e641
commit 54f83bb231
5 changed files with 208 additions and 13 deletions

View File

@ -0,0 +1,15 @@
.fifty {
display: flex;
flex-wrap: wrap;
> * { flex: 1 1 auto; }
@media screen and (min-width: 425px) {
> * { width: 50%; }
}
@media screen and (min-width: 768px) {
flex-wrap: nowrap;
}
}

View File

@ -0,0 +1,161 @@
.pie {
display: flex;
align-content: center;
align-items: center;
justify-content: center;
padding: $gutter;
.key {
margin-left: calc(#{$gutter} + 1em);
div {
position: relative;
padding-left: 0.33em;
line-height: 1.4em;
&::before {
position: absolute;
bottom: 0.2em;
left: -1em;
width: 1em;
height: 1em;
content: '';
}
span {
&:first-of-type {
position: absolute;
left: -99999px;
}
}
}
}
ul {
@include slim-ul;
position: relative;
margin: 0;
width: 100px;
height: 100px;
}
li {
position: absolute;
left: 50px;
width: 50px;
height: 100px;
overflow: hidden;
transform-origin: left center;
&::before {
position: absolute;
left: -50px;
z-index: -1;
border-radius: 100px 0 0 100px;
width: 50px;
height: 100px;
content: "";
transform-origin: right center;
}
@for $i from 0 through 360 {
&.start-#{$i} {
transform: rotate(#{$i}deg);
}
}
@for $i from 0 through 360 {
&.value-#{$i}::before {
transform: rotate(#{$i + 1 }deg);
}
}
// @for $i from 181 through 360 {
// &.value-#{$i} {
// width: 200px;
// height: 200px;
// transform-origin: center center;
//
// &::before {
// left: -100px;
// width: 100px;
// height: 200px;
// }
//
// &::after {
// position: absolute;
// left: -100px;
// border-radius: 0 100px 100px 0;
// width: 100px;
// height: 200px;
// content: "";
// }
// }
// }
}
.blue {
&::before,
&::after {
background-color: $blue;
}
}
.dark-blue {
&::before,
&::after {
background-color: $dark-blue;
}
}
.orange {
&::before,
&::after {
background-color: $orange;
}
}
.red {
&::before,
&::after {
background-color: $red;
}
}
.yellow {
&::before,
&::after {
background-color: $yellow;
}
}
.dark-grey {
&::before,
&::after {
background-color: $dark-grey;
}
}
}
@media screen and (min-width: 768px) {
.pie {
justify-content: flex-start;
ul {
width: 200px;
height: 200px;
}
li {
left: 100px;
width: 100px;
height: 200px;
&::before {
left: -100px;
width: 100px;
height: 200px;
}
}
}
}

View File

@ -13,6 +13,10 @@ main {
padding: 0;
}
section {
margin: ($gutter * 2) 0;
}
@media screen and (min-width: 426px) {
footer,
main {
@ -27,4 +31,9 @@ main {
width: calc(100% * 0.809);
max-width: 860px;
}
section {
margin: ($gutter * 4) 0;
}
}

View File

@ -15,3 +15,5 @@
@import 'components/styleguide';
@import 'components/hero';
@import 'components/fifty';
@import 'components/pie';