Created
February 12, 2013 13:46
-
-
Save davidhund/4769979 to your computer and use it in GitHub Desktop.
A Happy Little™ Flower Accident with CSS
This file contains hidden or 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
/** | |
* A Happy Little™ Flower Accident with CSS | |
*/ | |
body { | |
background: #f06; | |
background: linear-gradient(45deg, #CFF, #3FF); | |
color: #FFF; | |
min-height: 100%; | |
} | |
.flower, | |
.flower__inner { | |
width: 300px; | |
height: 300px; | |
padding: 0; | |
text-align: center; | |
line-height: 300px; | |
font-size: 64px; | |
border-radius: 50%; | |
transition: border-radius 1s; | |
} | |
body:hover .flower, | |
body:hover .flower__inner { | |
border-radius: 0%; | |
} | |
.flower { | |
margin: 2em auto; | |
position: relative; | |
transform-style: preserve-3d; | |
transform: rotate(-90deg) rotateY(45deg) rotateX(45deg); | |
background-color: rgba(250,200,0,0.5); | |
z-index: -1; | |
} | |
.flower:before { | |
content: " "; | |
display: block; | |
width: 300px; | |
height:3px; | |
background-color: green; | |
transform: translateX(-450px) translateY(152px); | |
} | |
.flower:after { | |
content: " "; | |
display: block; | |
border: 1px solid green; | |
border-radius: 50%; | |
width: 20px; | |
height:150px; | |
background-color: green; | |
transform: rotate(75deg) translateX(-30px) translateY(320px); | |
} | |
.flower__inner { | |
display: block; | |
content: ""; | |
position: absolute; | |
text-indent: -90em; /* 'hide' text for now */ | |
overflow: hidden; | |
//border-radius: 50%; | |
} | |
.flower__inner.one { | |
-webkit-transform: rotateY(90deg) translateZ(150px); | |
background: rgba(255,0,0,0.5); | |
} | |
.flower__inner.two { | |
-webkit-transform: translateZ(150px); | |
background: rgba(255,0,0,0.5); | |
} | |
.flower__inner.three { | |
-webkit-transform: rotateX(90deg) translateZ(150px); | |
background: rgba(255,0,0,0.7); | |
} | |
.flower__inner.four { | |
-webkit-transform: translateZ(-150px); | |
background: rgba(255,0,0,0.7); | |
} | |
.flower__inner.five { | |
-webkit-transform: rotateY(90deg) translateZ(-150px); | |
background: rgba(255,0,0,0.5); | |
} | |
.flower__inner.six { | |
-webkit-transform: rotateX(90deg) translateZ(-150px); | |
background: rgba(255,0,0,0.5); | |
} | |
This file contains hidden or 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 class="flower"> | |
<div class="flower__inner one">1</div> | |
<div class="flower__inner two">2</div> | |
<div class="flower__inner three">3</div> | |
<div class="flower__inner four">4</div> | |
<div class="flower__inner five">5</div> | |
<div class="flower__inner six">6</div> | |
</div> | |
This file contains hidden or 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
{"view":"split-vertical","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