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.

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

              
                <div class="badge">
  <div class="badge__label">+10</div>
</div>
              
            
!

CSS

              
                $base-color: #0071f6;

html,
body {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
}

body {
  box-sizing: border-box;

  *,
  *:before,
  *:after {
    box-sizing: inherit;
  }
}

@keyframes introduceBadge {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes pulseBadge {
  0% {
    transform: scale(1)
  }
  
  50% {
    transform: scale(1.05)
  }
  
  100% {
    transform: scale(1)
  }
}

@keyframes pulseBadge2 {
  0% {
    transform: scale(1)
  }
  
  50% {
    transform: scale(1.1)
  }
  
  100% {
    transform: scale(1)
  }
}

.badge {
  animation: introduceBadge 1s linear 0s 1 both;
  background: rgba($base-color, 0.2);
  border-radius: 50%;
  height: 136px;
  perspective: 600px;
  position: relative;
  width: 136px;

  &:before,
  &:after {
    animation: pulseBadge 3s cubic-bezier(0.860, 0.000, 0.070, 1.000) 0s infinite both;
    border: 2px dashed $base-color;
    border-radius: inherit;
    bottom: -16px;
    content: "";
    left: -16px;
    opacity: 0.2;
    position: absolute;
    right: -16px;
    top: -16px;
  }

  &:after {
    animation-name: pulseBadge2;
    bottom: -32px;
    left: -32px;
    opacity: 0.1;
    right: -32px;
    top: -32px;
  }
}

@keyframes introduceLabel {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotateY(-1800deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotateY(20deg);
  }
}

@keyframes rotateLabel {
  0% {
    transform: translate(-50%, -50%) rotateY(20deg);
  }

  50% {
    transform: translate(-50%, -50%) rotateY(-20deg);
  }

  100% {
    transform: translate(-50%, -50%) rotateY(20deg);
  }
}

.badge__label {
  animation: introduceLabel 2s cubic-bezier(0.19, 1, 0.22, 1) 1s 1 both,
    rotateLabel 5s linear 3s infinite;
  color: $base-color;
  font: 900 88px/1 -apple-system, BlinkMacSystemFont;
  left: 50%;
  position: absolute;
  text-align: center;
  text-shadow: 0px 4px 8px rgba($base-color, 0.2);
  top: 50%;
  transform: translate(-50%, -50%);
}

              
            
!

JS

              
                
              
            
!
999px

Console