Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ 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.


Save Automatically?

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.




                .container {
  width: 1024px;
  height: 700px;
.bar {
  height: 35px;
  border: 1px solid #000;
  margin-left: 15%;
  margin-top: 20%;
  margin-right: 0;
.bar__progress {
  background: pink;
  height: 100%;
  width: 75%;
  transition: all .5s;
  position: relative;
.bar__count {
  position: absolute;
  top: -20px;
  transition: all .5s;


                const bar = document.querySelector('.bar')
const barW = window.getComputedStyle(bar, null).getPropertyValue('width')
// Get bar progress
const barP = document.querySelector('.bar__progress')
// Get bar__count
const barC = document.querySelector('.bar__count')

// FInd px in barW
let ind = barW.indexOf('p')
// Remove px from barW
ind = barW.slice(0, ind)
// Divide by 100
ind = ind / 100
// Define multiplier
let mult = 1

// Function that sets width for .bar__progress
function set_progress_width(q) { = `${ind * q}px`

// Function outputs percentage for .bar__count
function output_percentage(percent) {
  barC.innerHTML = `${percent}%`

// Function moves percentage
function move_percentage(q) { = `${(ind * q) - 4}px`

// Initial set bar__progress width

// Function increases multiplier
function increase_multiplier() {
  if (mult < 100) {
  } else {
    mult = 1

// Add one percent every second
setInterval(increase_multiplier, 100)