cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="shubox--container">
  <div class="avatar-container">
    <div
    id="avatar"
    class="avatar"
    data-shubox-transform="avatar-demo"></div>
  </div>
</div>
            
          
!
            
              $avatar-size: 9rem

.dz
  &-progress
    position: absolute
    top: 0
    left: 0
    right: 0
    display: block
    width: 100%
    bottom: 0
    border-radius: 50%
    overflow: hidden
    
  &-upload
    opacity: .6
    position: absolute
    top: 0
    left: 0
    height: 100%
    background: #bf9de0

  &-error-message
  &-filename,
  &-size,
  &-success-mark,
  &-error-mark
    display: none

// When complete: show success/error state & √ or x mark
.dz-complete.dz-success .dz-success-mark,
.dz-complete.dz-error .dz-error-mark
  display: block
  position: absolute
  top: 0
  font-size: $avatar-size / 2
  text-align: center
  width: 100%
  line-height: $avatar-size
.dz-error .dz-error-mark
  color: white
.dz-success .dz-success-mark
  color: white

  
// Avatar-specific
.avatar-container
  background-color: #bf9de0
  margin-left: -1 * $avatar-size / 2
  margin-top: -1 * $avatar-size / 2
  width: $avatar-size
  height: $avatar-size
  border-radius: 50%
  border: $avatar-size/15 solid #7c5cd1
  position: absolute
  top: 50%
  left: 50%
.avatar
  cursor: pointer
  color: red
  width: $avatar-size
  height: $avatar-size
  border-radius: 50%
  background: url(https://i.imgur.com/kOTbAwq.png) center center no-repeat
  background-size: $avatar-size / 2
  overflow: hidden
  
  img
    width: 100%
    height: 100%
            
          
!
            
              // easy peasy. Most of the work
// is done by styling the default
// elements in the generated
// `previewsContainer`
new Shubox("#avatar")
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console