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

              
                <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>

<div class="container">
  <a href="#" class="badge-wrapper">
    <div class="level">
      <span>17</span>
    </div>
    <div class="badge-label front">
      <span>Uther Lightbringer</span>
    </div>
<div  class="badge gold">
  <div class="inner-badge">
    <div class="shade-hover">
      <span>
      
      </span>
    </div>
    <div class="image" style="background-image: url(http://orig13.deviantart.net/7f8f/f/2014/162/7/f/uther_lightbringer_by_jester567-d7lwt2t.jpg);">
      
    </div>
  </div>
  <div class="badge-overlay">
    
  </div>
</div>
    <div class="badge-label back">
      &nbsp;
    </div>
  </a>
</div>

<div class="container">
  <a href="#" class="badge-wrapper">
    <div class="badge-label front">
      mr. Face melt
    </div>
<div  class="badge purple">
  <div class="inner-badge">
    <div class="shade-hover">
      <span>
      
      </span>
    </div>
    <div class="image" style="background-image: url(https://www.heroesfire.com/images/wikibase/icon/talents/face-smelt.png);">
      
    </div>
  </div>
  <div class="badge-overlay">
    
  </div>
</div>
    <div class="badge-label back">
      &nbsp;
    </div>
  </a>
</div>



<div class="container">
  <a href="#" class="badge-wrapper">
    <div class="badge-label front">
      Dragon loot chest
    </div>
<div  class="badge wood">
  <div class="inner-badge">
    <div class="shade-hover">
      <span>
      
      </span>
    </div>
    <div class="image" style="background-image: url(https://game.boom-app.com/files/5853672866d442f767000002);">
      
    </div>
  </div>
  <div class="badge-overlay">
    
  </div>
</div>
    <div class="badge-label back">
      &nbsp;
    </div>
  </a>
</div>

              
            
!

CSS

              
                /** made by: Harm van Schaik **/

body {
  background-color: #777;
}
.container {
  position: relative;
  width: 20%;
  padding-top: 20%;


  float: left;
}
.badge-wrapper {
  display: block;
  width: 100%;
  height: 100%;
  font-family:Montserrat;
}
.level {
  width:12%;
  height:12%;
  padding:2%;
  position:absolute;
  z-index:3;
  background-color:green;
  color:#fff;
  top:15%;
  left:15%;
  text-align:center;
  font-size:1.5vw;
  border-radius:50%;
  border-bottom:2px solid rgba(0,0,0,0.5);
    
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    
background: #cb60b3; /* Old browsers */
background: -moz-linear-gradient(45deg,  #cb60b3 0%, #c146a1 31%, #a80077 60%, #db36a4 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(45deg,  #cb60b3 0%,#c146a1 31%,#a80077 60%,#db36a4 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(45deg,  #cb60b3 0%,#c146a1 31%,#a80077 60%,#db36a4 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cb60b3', endColorstr='#db36a4',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */

}
.level span {
  display:block;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  font-weight:700;
 text-shadow: 
0 2px 1px rgba(0,0,0,0.7);
}
.badge {
  position: absolute;
  top: 15%;
  left: 15%;
  z-index: 1;
  width: 70%;
  height: 70%;
  box-sizing: border-box;
  border-radius: 10%;
  display: block;

  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -webkit-transform-origin: center;

  box-shadow: 0 0 50px rgba(0, 0, 0, 0.25);
  transition: all 0.2s;
  background:#ddd;
  
   border-top: 6px solid #f2f2f2;
  border-left: 6px solid #f2f2f2;
  border-bottom: 6px solid #bbb;
  border-right: 6px solid #bbb;
  overflow:hidden;
}
.badge-label {
  position: absolute;
  bottom: 15%;
  left: 11%;

  width: 75%;
  padding: 4% 2%;
  color: #fff;
  text-align: center;
  font-size: 1.1vw;
  text-transform: uppercase;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  background-color: #207cca;

  transition: all 0.3s;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-label.front {
  overflow: hidden;
  z-index: 2;
}

.badge-label.back {
  z-index: 0;
}
.badge-label.back:before {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  top: -50px;
  width: 0;
  height: 0;
  border-bottom: 50px solid #1E5799;
  border-left: 50px solid transparent;
}
.badge-label.back:after {
  content: "";
  display: block;
  position: absolute;
  right: 0;
  top: -50px;
  width: 0;
  height: 0;
  border-bottom: 50px solid #1E5799;
  border-right: 50px solid transparent;
}

.inner-badge {
  position: absolute;
  top: 7.5%;
  left: 7.5%;
  width: 85%;
  height: 85%;
 
  border-top: 3px solid #bbb;
  border-left: 3px solid #bbb;
  border-bottom: 3px solid #f2f2f2;
  border-right: 3px solid #f2f2f2;

  z-index: 2;
  background-color: #ccc;
  box-sizing: border-box;
  border-radius: 5%;
  overflow: hidden;
}
.badge-overlay {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url(https://www.transparenttextures.com/patterns/asfalt-dark.png);
  opacity: 0.75;
}
.shade-hover {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  -moz-box-shadow: inset 0 0 10px #000000;
  -webkit-box-shadow: inset 0 0 10px #000000;
  box-shadow: inset 0 0 10px #000000;
  background-color: rgba(0, 0, 0, 0.0);
  transition: background-color 0.3s;
}
.shade-hover span {
  position: absolute;
  background: red;
  bottom: -10%;
  right: -30%;
  width: 100%;
  height: 40%;
  -webkit-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  background: -moz-linear-gradient(
    top,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.8) 100%
  ); /* FF3.6-15 */
  background: -webkit-linear-gradient(
    top,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.8) 100%
  ); /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.8) 100%
  ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient(
      startColorstr='#00000000',
      endColorstr='#cc000000',
      GradientType=0
    ); /* IE6-9 */

  text-align: center;
  color: #fff;
}

.image {
  position: absolute;
  z-index: 1;
  top: -20%;
  left: -20%;
  right: -20%;
  bottom: -20%;
  background-size: cover;
  background-position: center;

  background-color: red;
  width: 140%;
  height: 140%;

  -ms-transform: rotate(-45deg);
  -webkit-transform: rotate(-45deg);
  -webkit-transform-origin: center;
}
.badge-wrapper:hover .inner-badge .shade-hover {
  background-color: rgba(0, 0, 0, 0.3);
}
.badge-wrapper:hover .badge-label {
  bottom:18%;
}
.badge-wrapper:hover .badge {
  top: 14%;
  
}

.gold {
  border-top: 3px solid #fceabb;
  border-left: 3px solid #fceabb;
  border-bottom: 3px solid #f8b500;
  border-right: 3px solid #f8b500;
  border-width: 6px;
  background: rgb(252, 234, 187); /* Old browsers */
  background: -moz-linear-gradient(
    -45deg,
    rgba(252, 234, 187, 1) 0%,
    rgba(252, 205, 77, 1) 50%,
    rgba(248, 181, 0, 1) 51%,
    rgba(251, 223, 147, 1) 100%
  ); /* FF3.6-15 */
  background: -webkit-linear-gradient(
    -45deg,
    rgba(252, 234, 187, 1) 0%,
    rgba(252, 205, 77, 1) 50%,
    rgba(248, 181, 0, 1) 51%,
    rgba(251, 223, 147, 1) 100%
  ); /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(
    135deg,
    rgba(252, 234, 187, 1) 0%,
    rgba(252, 205, 77, 1) 50%,
    rgba(248, 181, 0, 1) 51%,
    rgba(251, 223, 147, 1) 100%
  ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient(
      startColorstr='#fceabb',
      endColorstr='#fbdf93',
      GradientType=1
    ); /* IE6-9 fallback on horizontal gradient */
}
.gold .inner-badge {
   border-top: 3px solid #f8b500;
  border-left: 3px solid #f8b500;
  border-bottom: 3px solid #fceabb;
  border-right: 3px solid #fceabb;
}

.wood {
  border-top: 3px solid #c19e67;
  border-left: 3px solid #c19e67;
  border-bottom: 3px solid #bf8a5b;
  border-right: 3px solid #bf8a5b;

  /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#bf8a5b+0,c19e67+30,b68d4c+61,b77650+100 */
background: #bf8a5b; /* Old browsers */
background: -moz-linear-gradient(45deg,  #bf8a5b 0%, #c19e67 30%, #b68d4c 61%, #b77650 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(45deg,  #bf8a5b 0%,#c19e67 30%,#b68d4c 61%,#b77650 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(45deg,  #bf8a5b 0%,#c19e67 30%,#b68d4c 61%,#b77650 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bf8a5b', endColorstr='#b77650',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
  
}
.wood .badge-overlay {
  background-image:url(https://t6.rbxcdn.com/f62c5681a108d3839e0e5cf0583667c5);
  opacity:1;
  background-size:cover;
}
.wood .inner-badge {
   border-top: 3px solid #b77650;
  border-left: 3px solid #b77650;
  border-bottom: 3px solid #c19e67;
  border-right: 3px solid #c19e67;
}
              
            
!

JS

              
                
              
            
!
999px

Console