Skip to content

Instantly share code, notes, and snippets.

@juice49
Created June 13, 2012 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juice49/2924204 to your computer and use it in GitHub Desktop.
Save juice49/2924204 to your computer and use it in GitHub Desktop.
Untitled
.level-meter {
height:20px;
margin:0;
padding:0;
font-size:0;
color:transparent;
list-style-type:none;
}
.level-meter li {
width:20px;
height:20px;
margin:0 5px 0 0;
padding:0;
float:left;
border-radius:50%;
box-shadow:inset 0 1px 2px 1px rgba(0,0,0,0.2);
}
.level-meter[data-level^='1'] li:first-child,
.level-meter[data-level^='2'] li:nth-last-child(n+5),
.level-meter[data-level^='3'] li:nth-last-child(n+4),
.level-meter[data-level^='4'] li:nth-last-child(n+3),
.level-meter[data-level^='5'] li:nth-last-child(n+2),
.level-meter[data-level^='6'] li {
background:#2665ac;
}
.level-meter[data-level='0.5'] li:first-child,
.level-meter[data-level='1.5'] li:nth-last-child(5),
.level-meter[data-level='2.5'] li:nth-last-child(4),
.level-meter[data-level='3.5'] li:nth-last-child(3),
.level-meter[data-level='4.5'] li:nth-last-child(2),
.level-meter[data-level='5.5'] li:last-child {
background:linear-gradient(left, #2665ac, #2665ac 50%, #fff 50%);
}
<ul class="level-meter" data-level="4.5">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
{"view":"split","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