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; padding: 0;
} }
section {
margin: ($gutter * 2) 0;
}
@media screen and (min-width: 426px) { @media screen and (min-width: 426px) {
footer, footer,
main { main {
@ -27,4 +31,9 @@ main {
width: calc(100% * 0.809); width: calc(100% * 0.809);
max-width: 860px; max-width: 860px;
} }
section {
margin: ($gutter * 4) 0;
}
} }

View File

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

View File

@ -3,6 +3,8 @@
img: stock/lake.png img: stock/lake.png
copy: I build web things copy: I build web things
theme: blue theme: blue
# VALUE * 360 / 100
--- ---
<section> <section>
@ -23,23 +25,29 @@
</p> </p>
</section> </section>
<section> <section class="fifty">
<h2>General Proficiency's</h2> <div>
<h2>General Proficiency's</h2>
<div class="fifty">
<p> <p>
Well versed in many web development tool chains, my strengths Well versed in many web development tool chains, my strengths
include Ruby, JavaScript, SCSS, SQL, and PHP. include Ruby, CSS, HTML, JavaScript, and SQL.
</p> </p>
</div>
<div class="pie"> <div class="pie">
<ul> <ul>
<li>Ruby</li> <li class="start-0 value-108 blue"></li>
<li>JavaScript</li> <li class="start-108 value-90 orange"></li>
<li>CSS</li> <li class="start-198 value-36 red"></li>
<li>SQL</li> <li class="start-234 value-54 dark-blue"></li>
<li>PHP</li> <li class="start-288 value-72 yellow"></li>
</ul> </ul>
<div class="key">
<div class="blue"><span>30%</span><span>Ruby</span></div>
<div class="orange"><span>25%</span><span>CSS</span></div>
<div class="red"><span>10%</span><span>HTML</span></div>
<div class="dark-blue"><span>15%</span><span>JavaScript</span></div>
<div class="yellow"><span>20%</span><span>SQL</span></div>
</div> </div>
</div> </div>
</section> </section>