Pen Settings

HTML

CSS

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

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

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.

HTML

              
                #shell
  #bg
   #bar
#real-loader
 div This is the "Penultimate Progress Loader of Infinite Frustration" 
 div Visit the 
   a(href="https://codepen.io/raurir/pen/NGwOzz" target="_blank") "The Ultimate Progress Loader of Infinite Frustration"
              
            
!

CSS

              
                #real-loader
  position absolute
  bottom 10px
  width 100%
  line-height 20px
  text-align center
  color rgba(255,255,255,0.5)
  a, a:visited
    color rgba(255,255,255,0.8)
    
makeTransition()
  -webkit-transition arguments
  -moz-transition arguments
  -o-transition arguments
  transition arguments

html
  height 100%
  font-family sans-serif

col1 = #506590
col2 = #323368

body
  height 100%
  margin 0
  padding 0
  background-repeat no-repeat
  background-attachment fixed
  background-image -moz-radial-gradient(center, ellipse cover, col1 0%, col2 100%)
  background-image -webkit-radial-gradient(center, ellipse cover, col1 0%, col2 100%)
  background-image -o-radial-gradient(center, ellipse cover, col1 0%, col2 100%)
  background-image -ms-radial-gradient(center, ellipse cover, col1 0%, col2 100%)
  background-image radial-gradient(center, ellipse cover, col1 0%, col2 100%)

#shell
  position absolute
  top 50%
  left 50%
  
  #bg
    makeTransition all 0.15s ease-in-out
    width 100px
    margin-left -50px
    height 10px
    background rgba(0,0,0,0.5)
    position relative
    
    #bar
      makeTransition all 0.15s ease-in-out
      position absolute
      top 2px
      left 2px
      background rgba(255,255,255,0.5)
      height 6px
      width 0px
      line-height 196px
      text-align center
      font-size 30px

      color rgba(0,0,0,0.5)

              
            
!

JS

              
                var d = 'horizontal', c = 0, s = 100, m = 200;
setInterval(function() {
  function dim() {
    c += Math.random() * 5;
    if (s - c < Math.random() * 5) s += Math.random() * 15;
    if (s > m) s = m;
    if (c > s) c = s;
    
    var barSize = (c - 4) + "px", bgSize = s + "px", bgMargin = (s * -0.5) + "px";
    if (d == "horizontal") {
      bar.style.width = barSize;
      bg.style.width = bgSize;
      bg.style.marginLeft = bgMargin;
    } else if (d == "vertical") {
      bar.style.height = barSize;
      bg.style.height = bgSize;
      bg.style.marginTop = bgMargin;
    }
    return c == s && c == m;
  }
  
  if (d == "horizontal" && dim()) {
    c = 0; s = 100; d = "vertical";
  } else if (d == "vertical" && dim()) {
    c = 6; s = 100; d = "text";
  } else if (d =="text") {
     dim();
     bar.innerHTML = (Math.round(c / m * 99) + Math.round(Math.random() * 9) / 10) + "%";
  }
  
}, 200);
              
            
!
999px

Console