Skip to content

Instantly share code, notes, and snippets.

@kejun
Created September 18, 2013 03:26
Show Gist options
  • Save kejun/6604152 to your computer and use it in GitHub Desktop.
Save kejun/6604152 to your computer and use it in GitHub Desktop.
Untitled
body {
text-align: center;
}
.pyramid {
position: relative;
padding-right: 6px;
width: 28em;
height: 20em;
margin: auto;
overflow: hidden;
font-size: 18px;
border-bottom: 1px solid #eee;
}
.pyramid-inner {
position: absolute;
width: 20em;
height: 20em;
-webkit-transform: rotateZ(45deg) translateX(-1px);
-webkit-transform-origin: 0 100%;
overflow: hidden;
border: 1px solid #eee;
}
.pyramid-inner ul {
position: absolute;
left: -5em;
right: -5em;
top: 0;
bottom: 0;
margin: 0;
padding:0;
text-align: center;
-webkit-transform: rotateZ(-45deg) translateY(-4.2em);
-webkit-transform-origin: 50% 50%;
background-image: -webkit-linear-gradient(top, yellow 0%, #f60 40%, #f00 80%);
}
.pyramid-inner li {
padding: 9px 0;
font-size: 16px;
font-family: arial;
border-bottom: 1px solid #eee;
list-style: none;
}
.pyramid-inner li:first-child {
padding-top: 2.5em;
}
.pyramid-inner li:last-child {
border: none;
padding-bottom: 10em;
}
.pyramid-inner li:hover {
background: rgba(255,255,0,.2);
cursor: default;
}
.pie {
position: relative;
width: 10em;
height: 10em;
margin: 6em auto;
background: #00bbee;
border-radius: 100%;
overflow:hidden;
}
.pie-item{
position: absolute;
left: 50%;
right: -50%;
top: 0;
bottom: 50%;
-webkit-transform-origin: 0 100%;
}
.pie-item span {
position: absolute;
left: 20%;
bottom: 20%;
}
.pie-item i {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: #fd0;
-webkit-transform-origin: 0 100%;
border: 1px solid #fff;
}
.percent-30 i {
-webkit-transform: skewX(18deg);
}
.percent-20 {
-webkit-transform: rotateZ(72deg);
}
.percent-20 i {
-webkit-transform: skewX(-18deg);
background-color: #3a0
}
<h1>Maslow's hierarchy of needs</h1>
<div class="pyramid">
<div class="pyramid-inner">
<ul>
<li>超越個人
<li>自我實現需求
<li>尊嚴需求(尊重/自尊需求)
<li>愛與隸屬需求
<li>安全需求
<li>生理需求
</ul>
</div>
</div>
<div class="pie">
<div class="pie-item percent-30"><i></i><span>30%</span></div>
<div class="pie-item percent-20"><i></i><span>20%</span></div>
</div>
<p>chrome/safari only.
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment