Pen Settings

HTML

CSS

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

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