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

              
                <!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="background_styles.css">
        <link rel="stylesheet" href="styles.css">
        <title>Animated Loading Spinner</title>
    </head>
    <body>
      <div class="spinner">
        <div class="spinner-text">Loading</div>
        <div class="spinner-sector spinner-sector-red"></div>
        <div class="spinner-sector spinner-sector-blue"></div>
        <div class="spinner-sector spinner-sector-green"></div>
      </div>
      
      
     
      
      
      
      
      
      
      
      
      
      
      <!-- Side Links Only -->
      <div class="side-links">
        <a href="https://youtu.be/7Hl2qa7-Bfc" target="_blank" class="side-link side-link-youtube">
          <i class="fab fa-youtube-square side-link-icon"></i>
          <span class="side-link-text">View Tutorial</span>
        </a>
        <a href="https://github.com/WebDevSimplified" target="_blank" class="side-link side-link-github side-link-icon">
          <i class="fab fa-github-square"></i>
          <span class="side-link-text">View GitHub</span>
        </a>
        <a href="https://twitter.com/DevSimplified" target="_blank" class="side-link side-link-twitter">
          <i class="fab fa-twitter-square side-link-icon"></i>
          <span class="side-link-text">View Twitter</span>
        </a>
      </div>
    </body>
</html>
              
            
!

CSS

              
                * {
    box-sizing: border-box;
}

.spinner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 300px;
}

.spinner-sector {
    border-radius: 50%;
    position: absolute;
    width: 100%;
    height: 100%;
    border: 15px solid transparent;
    mix-blend-mode: overlay;
}

.spinner-text {
    animation: loading-opacity 3s ease-in-out infinite;
    font-size: 2em;
}

.spinner-sector-blue {
    animation: rotate 2s ease-out infinite;
    border-top: 15px solid lightblue;
}

.spinner-sector-red {
    animation: rotate 2.5s ease-in infinite;
    border-top: 15px solid lightcoral;
}

.spinner-sector-green {
    animation: rotate 1.5s ease-in-out infinite;
    border-top: 15px solid lightgreen;
}

@keyframes rotate {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}

@keyframes loading-opacity {
    0%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: .5;
    }
    50% {
        opacity: .1;
    }
}














/* Background Styles Only */

@import url('https://fonts.googleapis.com/css?family=Raleway');

* {
    font-family: Raleway;
}

html {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #DFDFDF;
}

.side-links {
  position: absolute;
  top: 15px;
  right: 15px;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-bottom: 10px;
  color: white;
  width: 180px;
  padding: 10px 0;
  border-radius: 10px;
}

.side-link-youtube {
  background-color: red;
}

.side-link-twitter {
  background-color: #1DA1F2;
}

.side-link-github {
  background-color: #6e5494;
}

.side-link-text {
  margin-left: 10px;
  font-size: 18px;
}

.side-link-icon {
  color: white;
  font-size: 30px;
}
              
            
!

JS

              
                
              
            
!
999px

Console