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

              
                onlineonline<div class="sidebar">
  <div id="avatar-frame" class="online">
    <span class="gloss"></span>
    <img width="100px" height="100px" src="https://yequari.com/images/avatar.jpg"/>
    
  </div>
  <form name="online-status">
    <input type="radio" name="status" value="online" checked>Online</input>
  <input type="radio" name="status" value="busy">Busy</input>
  </form>
</div>
              
            
!

CSS

              
                .sidebar #avatar-frame {
    width: fit-content;
    height: 100px;
    margin: 0 auto;
    padding: 8px 8px;
    border: 1px solid #cccccf;
    border-radius: 16px/24px;
    position: relative;
}

.online {
  background: linear-gradient(#D6FFDB00 0%, #D6FFDB 30%, #66FF00 100%);
  box-shadow: 0 5px 10px #66FF00;
}

.busy {
  background: linear-gradient(#FF9A0000 0%, #D8820055 30%,  #fca30d 100%);
  box-shadow: 0 5px 10px #fca30d;
}

.sidebar #avatar-frame img {
    max-width: 100px;
    border: 1px solid grey;
    border-radius: 5px;
   
}

.gloss {
  width: 100%;
  height: 100%;
/*   background: red; */
  background: radial-gradient(ellipse 200px 140px at 50% 0%, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.25) 50%,
  rgba(255,255,255,0) 51%);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  border-radius: 16px/24px;
}
              
            
!

JS

              
                let online = 'linear-gradient(#D6FFDB 0%, #66FF00 100%)'
let busy = 'linear-gradient(#fca30d 0%, #FF9A00 100%);'

const frame = document.querySelector('#avatar-frame');

const f = document.querySelectorAll('input[name=\'status\']').forEach((radio) => {
  radio.addEventListener('click', (event) => {
    switch(event.target.value) {
      case 'online':
        frame.className = 'online'
        break;
      case 'busy':
        frame.className = 'busy'
        break;
    }
  });
});

              
            
!
999px

Console