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

              
                <head>
  <!--Put the three links-->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> 
  <script type="text/javascript" src="https://spin.js.org/spin.min.js"></script>
  <script type="text/javascript" src="https://spin.js.org/spin.js"></script>
</head>

<!--show div when loading-->
<div class="loadcover">
  <!--set a div id="foo" show spin.js's loading bar-->
  <div id="foo"></div>
</div>
<h1>done!</h1>

<!--set loading function-->
<script>
$(window).load(function(){
  $('.loadcover').fadeOut(3000); // Set fade out time when load done
});
  
//load bar style setting
var opts = {
  lines: 13, // The number of lines to draw
  length: 0, // The length of each line
  width: 13, // The line thickness
  radius: 45, // The radius of the inner circle
  scale: 1, // Scales overall size of the spinner
  corners: 1, // Corner roundness (0..1)
  color: '#ffffff', // CSS color or array of colors
  fadeColor: 'transparent', // CSS color or array of colors
  opacity: 0.25, // Opacity of the lines
  rotate: 0, // The rotation offset
  direction: 1, // 1: clockwise, -1: counterclockwise
  speed: 1, // Rounds per second
  trail: 60, // Afterglow percentage
  fps: 20, // Frames per second when using setTimeout() as a fallback in IE 9
  zIndex: 2e9, // The z-index (defaults to 2000000000)
  className: 'spinner', // The CSS class to assign to the spinner
  top: '50%', // Top position relative to parent
  left: '50%', // Left position relative to parent
  shadow: none, // Box-shadow for the lines
  position: 'absolute' // Element positioning
};

var target = document.getElementById('foo');
var spinner = new Spinner(opts).spin(target);
</script>

              
            
!

CSS

              
                
.loadcover{
    background-color: #00a7f1;
    z-index: 999999;
    width: 100%;
    height: 100%;
    position: fixed;
}

/*Extra CSS*/

h1 {
    font-family: sans-serif;
    font-size: 80px;
    color: cornflowerblue;
    margin: 0;
    padding-top:2.5em;
}
html, body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  text-align: center;
}
              
            
!

JS

              
                
              
            
!
999px

Console