A Pie Chart in Pure CSS by Guangming Mao on CodePen.
Last active
October 18, 2019 03:54
-
-
Save maogm12/bf57b51713d6a6e814d6 to your computer and use it in GitHub Desktop.
Pie Chart in Pure CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="skills"> | |
<div id="part1" class="circle animate"></div> | |
<div id="part2" class="circle animate"></div> | |
<div id="part3" class="circle animate"></div> | |
<div id="part4" class="circle animate"></div> | |
<div id="part5" class="circle animate"></div> | |
<div id="part6" class="circle animate"></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#skills { | |
position: relative; | |
width: 300px; | |
height: 300px; | |
margin: 30px auto; | |
} | |
.circle { | |
width: 100%; | |
height: 100%; | |
border-radius: 50%; | |
position: absolute; | |
} | |
.animate { | |
-webkit-transition: 0.2s cubic-bezier(.74,1.13,.83,1.2); | |
-moz-transition: 0.2s cubic-bezier(.74,1.13,.83,1.2); | |
-o-transition: 0.2s cubic-bezier(.74,1.13,.83,1.2); | |
transition: 0.2s cubic-bezier(.74,1.13,.83,1.2); | |
} | |
.animate:hover { | |
transform: scale(1.1); | |
transform-origin: center center; | |
} | |
#part1 { | |
background-color: #E64C65; | |
-webkit-clip-path: polygon(50% 0, 50% 50%, 100% 41.2%, 100% 0); | |
clip-path: polygon(50% 0, 50% 50%, 100% 41.2%, 100% 0); | |
} | |
#part2 { | |
background-color: #11A8AB; | |
-webkit-clip-path: polygon(50% 50%, 100% 41.2%, 100% 100%, 63.4% 100%); | |
clip-path: polygon(50% 50%, 100% 41.2%, 100% 100%, 63.4% 100%); | |
} | |
#part3 { | |
background-color: #4FC4F6; | |
-webkit-clip-path: polygon(50% 50%, 36.6% 100%, 63.4% 100%); | |
clip-path: polygon(50% 50%, 36.6% 100%, 63.4% 100%); | |
} | |
#part4 { | |
background-color: #FFED0D; | |
-webkit-clip-path: polygon(50% 50%, 0 100%, 36.6% 100%); | |
clip-path: polygon(50% 50%, 0 100%, 36.6% 100%); | |
} | |
#part5 { | |
background-color: #F46FDA; | |
-webkit-clip-path: polygon(50% 50%, 0 36.6%, 0 100%); | |
clip-path: polygon(50% 50%, 0 36.6%, 0 100%); | |
} | |
#part6 { | |
background-color: #15BFCC; | |
-webkit-clip-path: polygon(50% 50%, 0 36.6%, 0 0, 50% 0); | |
clip-path: polygon(50% 50%, 0 36.6%, 0 0, 50% 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hy there! Really really nice work :). Still, I have some questions:
Thank you!