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

              
                <div class="wrap">
  <div class="cube notrans">
    <div class="front">
      <div class="progress">&nbsp;Loading ...</div>
    </div>
    
    <div class="back">
      <div class="progress">&nbsp;Loading ...</div>
    </div>
    
    <div class="top">
      <div class="progress">&nbsp;Loading ...</div>
    </div>
    
    <div class="bottom">
      <div class="progress">&nbsp;Loading ...</div>
    </div>
    
    <div class="left"></div>
    
    <div class="right"></div>
  </div>
</div>

<div style="text-align:center;margin-top:50px;">
  <input id="moveTo" style="width:40px;" value="55" /> %&nbsp;
  <button onclick="setProgress();return false;">Set new value</button> 
  <label><input id="trans" onchange="setTransparent();" type="checkbox" /> Transparent!</label> 
  <label><input id="randomm" onchange="setRandom();" type="checkbox" /> Random values.</label>
</div>
              
            
!

CSS

              
                body {
  background-color:#191919;
  color: #eee;
}
.wrap {
  margin-top:60px;
  perspective:1000px;
  overflow:hidden;
  perspective-origin:50% 50%;
  
/* Change this to adjust the 3d bar tilting */
  transform:rotateZ(-0.01turn) rotateY(-0.01turn);
}
.progress {
  height:100%;
  width:0%;
  padding:0;
  transition:width 2s ease;
  overflow:visible;
  text-align:center;
  color:#000;
  font-family:verdana;
  font-size:20px;
  white-space:nowrap;
  line-height:45px;
  text-shadow:1px 1px 2px #fff;
  border-right:solid 2px #444;
  background-size:50px 50px;
  
/* Blue stripes */
  background-image:linear-gradient(135deg,#3399ff 25%,#99ccff 25%,#99ccff 50%,#3399ff 50%,#3399ff 75%,#99ccff 75%,#99ccff 100%);
  animation:bganim 1s linear 2s infinite;
}
@keyframes bganim {
  to {
    background-position:50px;
  }
}
.cube {
  margin:auto;
  position:relative;
  height:50px;
  width:500px;
  transform-style:preserve-3d;
  animation:rotate 20s infinite linear;
}
.cube > div {
  position:absolute;
  box-sizing:border-box;
  height:100%;
  width:100%;
  
/*opacity:0.98;
  */
  border:solid 1px #eee;
}
.cube.notrans > div {
  background-size:50px 50px;
  
/* Grey stripes */
  background-image:linear-gradient(135deg,#ddd 25%,#eee 25%,#eee 50%,#ddd 50%,#ddd 75%,#eee 75%,#eee 100%);
  animation:bganim 1s linear 2s infinite;
}
.cube > .left,
.cube > .right {
  height:50px;
  width:50px;
}
.front {
  transform:translateZ(25px);
}
.back {
  transform:translateZ(-25px) rotateX(180deg);
}
.top {
  transform:rotateX(-270deg) translateY(-25px);
  transform-origin:top center;
}
.bottom {
  transform:rotateX(270deg) translateY(25px);
  transform-origin:bottom center;
}
.left {
  transform:rotateY(270deg) translateX(-25px);
  transform-origin:center left;
}
.right {
  transform:rotateY(-270deg) translateX(25px) translateZ(450px);
  transform-origin:top right;
}
@keyframes rotate {
  100% {
    transform:rotateX(1turn);
  }
}
              
            
!

JS

              
                /*
  Just share :D
  Original article here: http://www.codicode.com/art/3d_progress_bar_css3.aspx
*/

var tOut;

function randomVals() {
    var ff = Math.floor(Math.random() * 100);
    $('.progress').css({
        width: ff + "%"
    });
    $("#moveTo").val(ff);
    tOut = setTimeout("randomVals()", 2500);
}

function setRandom() {
    if ($('#randomm').is(':checked')) {
        randomVals();
    } else {
        clearTimeout(tOut);
    }
}


function setProgress() {
    clearTimeout(tOut);
    $('#randomm').attr('checked', false);
    $('.progress').css({
        width: $("#moveTo").val() + "%"
    });
}

function setTransparent() {
    if ($('#trans').is(':checked')) {
        $(".cube").removeClass("notrans");
    } else {
        $(".cube").addClass("notrans");
    }
}
//$(document).ready(function() {
$(window).load(function () {
    setProgress();
    setRandom();
    setTransparent();
});
              
            
!
999px

Console