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

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.

HTML

              
                <!-- More info: http://rosel.li/010115 -->

<div id="RingWrapper">
<div id="Ring"><div id="Inner"><div id="Groove"></div></div></div>
</div>


<div id="Form">
<p>
<label for="Size">Choose ring size:</label>
<input type="number" maxlength="2" id="Size" value="8" onblur="ChangeSize(this.value);">
</p>

<p>
<label for="Temp">Choose temperature:</label>
<select id="Temp" onchange="ChangeTemp(this.value);">
  <option value="rgba(0, 0, 0, 1)">Off</option>
  <option value="rgba(255, 0, 0, 1)" selected>Warm</option>
  <option value="rgba(255, 153, 0, 1)">Warmer</option>
  <option value="rgba(255, 255, 0, 1)">Hot</option>
  <option value="rgba(255, 255, 255, 1)">Hottest</option>
</select>
</p>
</div>

              
            
!

CSS

              
                body {
  background-color: #000;
  color: #fff;
  font: 1em Arial, Helvetica;
  padding: 4em 0 0 0;
}

#RingWrapper {
  width: 80%;
  height:12em;
  margin: 2em auto;
}

#Ring, #Inner {
  margin: 2em auto;
  padding: 0;
  width: 8em;
  height: 8em;
  /*border: 2px solid #fff;*/
  border-radius: 100%;
  box-shadow: 0 0 1.5em 1em rgba(255, 0, 0, 1);
  transition: all 1s ease-in;
}

#Ring {
  -webkit-animation: rotation 2s infinite linear;
  animation: rotation 2s infinite linear;
}

#Inner {
  margin: 0;
  /*border: none;*/
  /*margin: -4px -4px 0 0;*/
  box-shadow: inset 0 0 1.5em 1em rgba(255, 0, 0, 1);
}


#Groove {
  position: absolute;
  z-index: 3;
  top: 25%;
  margin: 0 0 0 0;
  padding: 0;
  width: 10px;
  height: 10px;
  border-radius: 100% 50%;
  /*border: 1px solid #fff;*/
  background: #fff;
  box-shadow: 0 0 1.5em 1em rgba(255, 255, 255, 1);
  transition: all 1.5s ease-in;
}

#Form {
  /*border: 1px solid #ccc;*/
  margin: 1em auto;
  width: 10em;
}


#Size {
  width: 3em;
}

@-webkit-keyframes rotation {
  from {
    -webkit-transform: rotate(0deg);
    -webkit-animation-timing-function: linear;
  }
  to {
    -webkit-transform: rotate(360deg);
  }
}

@keyframes rotation {
  from {
    transform: rotate(0deg);
    animation-timing-function: linear;
  }
  to {
    transform: rotate(360deg);
  }
}

              
            
!

JS

              
                function ChangeSize(num) {
  var Ring = document.getElementById('Ring');
  var Inner = document.getElementById('Inner');
  Ring.style.width = num + 'em';
  Ring.style.height = num + 'em';
  Inner.style.width = num + 'em';
  Inner.style.height = num + 'em';
}
function ChangeTemp(color) {
  var Ring = document.getElementById('Ring');
  var Inner = document.getElementById('Inner');
  Ring.style.boxShadow = '0 0 1.5em 1em ' + color;
  Inner.style.boxShadow = 'inset 0 0 1.5em 1em ' + color;
  if (color == 'rgba(0, 0, 0, 1)') {
    TurnOff();
  } else {
    TurnOn();
  }
}
function TurnOff() {
  var Cylon = document.getElementById('Groove');
  Cylon.style.opacity = '0';
}
function TurnOn() {
  var Cylon = document.getElementById('Groove');
  Cylon.style.opacity = '1';
}
              
            
!
999px

Console