Created
November 14, 2018 18:55
-
-
Save scinetic/8f92c9377f44ccbaff778e75ff4ad292 to your computer and use it in GitHub Desktop.
brightness fish slider
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body { | |
font-family: Arial, Helvetica, sans-serif; | |
} | |
.slidecontainer { | |
width: 100%; | |
} | |
.slider { | |
-webkit-appearance: none; | |
width: 100%; | |
height: 10px; | |
border-radius: 5px; | |
background: #d3d3d3; | |
outline: none; | |
opacity: 0.7; | |
-webkit-transition: .2s; | |
transition: opacity .2s; | |
} | |
.slider:hover { | |
opacity: 1; | |
} | |
.slider::-webkit-slider-thumb { | |
-webkit-appearance: none; | |
appearance: none; | |
width: 55px; | |
height: 55px; | |
border: 0; | |
background: url('https://cdn2.iconfinder.com/data/icons/metro-uinvert-dock/256/Brightness.png'); | |
background-size: 55px 55px; | |
} | |
cursor: pointer; | |
} | |
.slider::-moz-range-thumb { | |
width: 23px; | |
height: 24px; | |
border: 0; | |
background: url('contrasticon.png'); | |
cursor: pointer; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Slider for adjusting fish lights</h1> | |
<div class="slidecontainer"> | |
<input type="range" min="1" max="100" value="50" class="slider" id="myRange"> | |
<p>Brightness: <span style="font-weight:bold" id="demo"></span>%</p> | |
</div> | |
<script> | |
var slider = document.getElementById("myRange"); | |
var output = document.getElementById("demo"); | |
output.innerHTML = slider.value; | |
slider.oninput = function() { | |
output.innerHTML = this.value; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment