Created
December 15, 2013 05:25
-
-
Save huang47/7969259 to your computer and use it in GitHub Desktop.
A Pen by Huge.
This file contains 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 id="body"> | |
<input id="mdxRatings" type="range" class="ratings" min="1" max="5" value="1" onchange="mdxRatings.dataset.value=value;" /> | |
</div> |
This file contains 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
body, div, input { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
} | |
#body { | |
position: relative; | |
left: 100px; | |
top: 100px; | |
} | |
.ratings { | |
-webkit-appearance: none; | |
background: url(http://cdn-0.nflximg.com/us/ffe/mobileui/ratingUI_emptystar.png) 0 0 repeat; | |
width: 260px; | |
height: 50px; | |
} | |
.ratings::-webkit-slider-thumb { | |
-webkit-appearance: none; | |
position: absolute; | |
left: 0; | |
top: 0; | |
background: url(http://cdn-0.nflximg.com/us/ffe/mobileui/ratingUI_fullstar.png) 0 0 no-repeat; | |
width: 52px; | |
height: 50px; | |
} | |
.ratings:after { | |
position: absolute; | |
content: ''; | |
left: 0; | |
background: url(http://cdn-0.nflximg.com/us/ffe/mobileui/ratingUI_fullstar.png) 0 0 repeat-x; | |
height: 52px; | |
} | |
.ratings[data-value="1"]:after { width: 52px; } | |
.ratings[data-value="2"]:after { width: 104px; } | |
.ratings[data-value="3"]:after { width: 156px; } | |
.ratings[data-value="4"]:after { width: 208px; } | |
.ratings[data-value="5"]:after { width: 260px; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment