Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.





  overflow-x: hidden
  margin: 0
  padding: 0

  width: 100vw
  height: 500vh
  background: linear-gradient(rgba(74,42,71, .9), rgba(231,131,82, .9))
  width: 0
  height: 10px
  position: fixed
  transition: all .2s ease
  top: 0
  left: 0
    image: linear-gradient(to right, rgba(74,42,71,1) 0%,rgba(231,131,82,1) 22%,rgba(146,146,146,1) 35%,rgba(100,181,163,1) 53%,rgba(100,181,163,1) 53%,rgba(74,42,71,1) 76%,rgba(146,146,146,1) 95%)
  float: left
  position: fixed
  top: 20px
  left: 10px
  width: 10vw
  height: 5vh
  font-size: 2em
  color: rgba(74,42,71,1)


                var load = document.querySelector('.load');
var loadText = document.querySelector('.load-text');

// get all document height
var scrollHeight = Math.max(
  document.body.scrollHeight, document.documentElement.scrollHeight,
  document.body.offsetHeight, document.documentElement.offsetHeight,
  document.body.clientHeight, document.documentElement.clientHeight

// get viwport height
var vHeight = document.documentElement.clientHeight;

var stopPosition = scrollHeight - vHeight;

// convert window.pageYOffset, and stopPosition
// return percent vale
function getProcent(stopPos, curPos){
  var percent = stopPos / 100;
  var curPercent = curPos / percent;
  return curPercent;

window.addEventListener('scroll', function(){
  var curPosition = window.pageYOffset;
  var w = Math.round(getProcent(stopPosition, curPosition)) + '%'; = w;
 loadText.innerHTML = w;