Skip to content

Instantly share code, notes, and snippets.

@hucklesby
Created April 16, 2013 18:50
Show Gist options
  • Save hucklesby/5398505 to your computer and use it in GitHub Desktop.
Save hucklesby/5398505 to your computer and use it in GitHub Desktop.
A serrated circle
/**
* A serrated circle
*/
* {
box-sizing: border-box;
}
html {
font-size: 100%;
overflow-y: scroll;
}
body {
width: 80%;
margin: 0 auto;
font: normal 1em/1.4 sans-serif;
color: black;
background-color: #ccc;
}
.circle {
position: relative;
width: 9em;
height: 9em;
margin: 3em;
text-align: center;
-webkit-filter: drop-shadow(0 0 6px gray);
transform: rotate(45deg);
transition: transform 1s;
}
.circle > p {
margin: 0;
line-height: 9;
transform: rotate(-45deg);
}
.circle,
.circle:before,
.circle:after,
.circle > p,
.circle > p:before,
.circle > p:after {
background-color: gold;
}
.circle:before,
.circle:after,
.circle > p:before,
.circle > p:after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
}
.circle:before,
.circle > p:before {
transform: rotate(15deg);
}
.circle:after,
.circle > p:after {
transform: rotate(30deg);
}
/* Rotate the circle another 360˚ on :hover */
.circle:hover {
transform: rotate(405deg);
}
<!-- content to be placed inside <body>…</body> -->
<h1>A serrated circle</h1>
<div class="circle circle--1">
<p>Hover me!</p>
</div>
// alert('Hello world!');
{"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