Created
May 31, 2012 04:11
-
-
Save jonathansampson/2840966 to your computer and use it in GitHub Desktop.
CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson
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
/* CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson */ | |
.die.one .dot { | |
box-shadow: 0 .2em 0 #FFF | |
} | |
.die.two .dot { | |
background: transparent; | |
box-shadow: -2.3em -2.3em 0 #345, | |
2.3em 2.3em 0 #345, | |
-2.3em -2.3em 0 #FFF, | |
2.3em 2.4em 0 #FFF | |
} | |
.die.three .dot { | |
box-shadow: -2.3em -2.3em 0 #345, | |
2.3em 2.3em 0 #345, | |
-2.3em -2.3em 0 #FFF, | |
2.3em 2.4em 0 #FFF, | |
0 .2em 0 #FFF | |
} | |
.die.four .dot { | |
background: transparent; | |
box-shadow: -2.3em -2.3em 0 #345, | |
2.3em 2.3em 0 #345, | |
-2.3em 2.3em 0 #345, | |
2.3em -2.3em 0 #345, | |
-2.3em -2.3em 0 #FFF, | |
2.3em 2.4em 0 #FFF, | |
-2.3em 2.4em 0 #FFF, | |
2.3em -2.3em 0 #FFF | |
} | |
.die.five .dot { | |
box-shadow: -2.3em -2.3em 0 #345, | |
2.3em 2.3em 0 #345, | |
-2.3em 2.3em 0 #345, | |
2.3em -2.3em 0 #345, | |
-2.3em -2.2em 0 #FFF, | |
2.3em -2.2em 0 #FFF, | |
2.3em 2.4em 0 #FFF, | |
-2.3em 2.4em 0 #FFF, | |
0 .2em 0 #FFF | |
} | |
.die.six .dot { | |
background: transparent; | |
box-shadow: -2.3em -2.3em 0 #345, | |
-2.3em 0 0 #345, | |
-2.3em 2.3em 0 #345, | |
2.3em -2.3em 0 #345, | |
2.3em 0 0 #345, | |
2.3em 2.3em 0 #345, | |
-2.3em -2.1em 0 #FFF, | |
-2.3em .2em 0 #FFF, | |
-2.3em 2.4em 0 #FFF, | |
2.3em 2.4em 0 #FFF, | |
2.3em .2em 0 #FFF, | |
2.3em -2.1em 0 #FFF | |
} | |
.die { | |
border-top: 1px solid #f1f1f1; | |
width: 50px; height: 50px; | |
border-radius: 10px; | |
position: relative; | |
margin: 10px; | |
font-size: 6px; | |
display: inline-block; | |
box-shadow: 0px 5px 0 #CCC, 0 6px 3px #444, 0 10px 5px #999; | |
background-image: linear-gradient(top, #fefefe, #f1f1f1 80%) | |
} | |
.dot { | |
width: 20%; | |
height: 20%; | |
left: 50%; | |
top: 50%; | |
margin: -10%; | |
background: #345; | |
border-radius: 50%; | |
display: block; | |
position: absolute; | |
} | |
body { text-align: center } |
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="die one"> <span class="dot"></span></div> | |
<div class="die two"> <span class="dot"></span></div> | |
<div class="die three"><span class="dot"></span></div> | |
<div class="die four"> <span class="dot"></span></div> | |
<div class="die five"> <span class="dot"></span></div> | |
<div class="die six"> <span class="dot"></span></div> | |
<p>Pure CSS Dice. An experiment by <a href="http://twitter.com/jonathansampson">@jonathansampson</a></p> |
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":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment