Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <input id="slider" name="slider" type="range" value=0>
<label for="slider">0</label>




<a class="twitter-link" href="https://twitter.com/phil_osophie" target="_blank" >by @phil_osophie</a>
              
            
!

CSS

              
                html, body {
  margin: 0
  height: 100%
}

body
  display: flex
  justify-content: center
  align-items: center
  background-color: #a9cbee
  
track()
  width: 100%
  height: 20px
  background: #eee
  border-radius: 10px
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4)
  cursor: pointer
  
thumb()
  border: none
  height: 50px
  width: 50px
  background-color: transparent
  background-image: url(https://storage.googleapis.com/pw-stuff/thumbs-sprite.png)
  background-position: 0 0
  background-size: cover
  transform: scale(1.9) rotateZ(var(--thumb-rotate, 10deg))
  cursor: pointer

thumbActive()
  background-position: 100% 0px
  transform: scale(2.0) rotateZ(var(--thumb-rotate, 10deg))

input[type="range"]
  -webkit-appearance: none
  background: transparent
  width: 90%
  max-width: 500px
  outline: none

  &:focus,
  &:active,
  &::-moz-focus-inner,
  &::-moz-focus-outer
    border: 0
    outline: none

  &::-moz-range-thumb
    thumb()
    
  &::-moz-range-thumb:active
    thumbActive()
    
  &::-moz-range-track
    track()
  
  &::-moz-range-progress
    height: 20px
    background: #4685d7
    border-radius: 10px
    cursor: pointer
    
  &::-webkit-slider-thumb
    thumb()
    margin-top: -15px
    -webkit-appearance: none
    
  &::-webkit-slider-thumb:active
    thumbActive()
    
  &::-webkit-slider-runnable-track
    track()
    -webkit-appearance: none
   
label
  background: #eee
  border-radius: 50%
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4)
  padding: 14px
  margin-left: 10px
  font-family: Roboto, 'Helvetica Neue', Arial
  font-size: 20px
  width: 25px
  text-align: center
  color: darken(#4685d7, 20%)
  font-weight: bold
  content: ''
  
  
  
.twitter-link
  position: absolute
  bottom: 4px
  margin: auto
  font-family: sans-serif
  font-size: 12px
  color: rgba(0, 0, 0, 0.6)
              
            
!

JS

              
                const input = document.querySelector("input");
const label = document.querySelector("label");

input.addEventListener("input", event => {
  const value = Number(input.value) / 100;
  input.style.setProperty("--thumb-rotate", `${value * 720}deg`);
  label.innerHTML = Math.round(value * 50);
});

              
            
!
999px

Console