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

              
                
// Based on: https://dribbble.com/shots/4883028-Profile-Stats

.layout

  .profile
  
    .profile__picture
      img(src='http://i.pravatar.cc/250?img=58' alt='ananddavis')
      
    .profile__header
      .profile__account
        h4.profile__username ananddavis
        
      .profile__edit
        a.profile__button(href='#') Edit Profile
        
    .profile__stats
    
      .profile__stat
        .profile__icon.profile__icon--gold
          i.fas.fa-wallet
          
        .profile__value 47
          .profile__key Wallet
          
      .profile__stat
        .profile__icon.profile__icon--blue
          i.fas.fa-signal
          
        .profile__value 357
          .profile__key Ranking
          
      .profile__stat
        .profile__icon.profile__icon--pink
          i.fas.fa-heart
          
        .profile__value 4
          .profile__key Lives
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Montserrat:400,600,700')

$montserrat: 'Montserrat', sans-serif
$base-font: $montserrat

$black: #000000
$blue: #8faae8
$gold: #eab100
$grey: #f9fafb
$pink: #ff86af
$white: #ffffff

$profile-picture-size: 125px

*
  box-sizing: border-box
html, body
  background: $grey
  height: 100vh
  position: relative
  z-index: -2
.layout
  align-items: center
  display: flex
  justify-content: center
  height: 100vh
 
@keyframes popUp
  from
    transform: scale(0)
    opacity: 0
  to
    transform: scale(1)
    opacity: 1
@keyframes slideUp
  from
    transform: translateY(5px)
    opacity: 0
  to
    transform: translateY(0px)
    opacity: 1

.profile
  animation: popUp ease-in-out 350ms
  background: $white
  border-radius: 25px
  box-shadow: 0 0 40px 0px rgba($black, 0.17)
  margin-top: 40px
  padding: 28px 30px 30px 35px
  position: relative
  width: 500px
  
  &__account
    align-self: center
    display: flex
    flex: 1
    justify-content: flex-end
    padding-left: $profile-picture-size+10px
    
  &__button
    border-radius: 50px
    border: 1px solid $black
    color: $black
    display: block
    font-family: $base-font
    font-size: 13px
    padding: 10px
    text-align: center
    text-decoration: none
    transition: ease-in-out 250ms background, ease-in-out 250ms color
    &:hover
      background: $black
      color: $white
    
  &__edit
    flex: none
    margin-left: 30px
    width: 140px
    
  &__header
    display: flex
    margin-bottom: 20px
    
  &__icon
    flex: none
    font-size: 1.5em
    margin-right: 10px
    padding-top: 3px
    
    &--gold
      color: $gold
      
    &--blue
      color: $blue
      
    &--pink
      color: $pink
      
  &__key
    font-family: $base-font
    font-size: 13px
    font-weight: 400
    text-align: center
    
  &__picture
    background: $white
    border-radius: 100px
    border: 10px solid $white
    height: $profile-picture-size
    position: absolute
    top: -40px
    width: $profile-picture-size
    
    &:before
      border-radius: 100px
      box-shadow: 0 0 40px 0px rgba($black, 0.17)
      content: ""
      height: calc(100% + 20px)
      left: -10px
      position: absolute
      top: -10px
      width: calc(100% + 20px)
      z-index: -1
    
    img
      border-radius: 100px
      height: 100%
      width: 100%
      
  &__stat
    animation: slideUp ease-in-out 350ms forwards
    border-right: 1px solid #e9e9e9
    display: flex
    flex: 1
    justify-content: center
    opacity: 0
    padding: 10px 4px
    transform: translateY(5px)
    
    &:last-of-type
      border-right: none
    
    @for $i from 1 through 3
      &:nth-child(#{$i})
        animation-delay: #{300ms + (100ms*$i)}
  
  &__stats
    display: flex
    
  &__username
    font-family: $base-font
    font-weight: 600
    margin: 0
    text-align: right
    
  &__value
    font-family: $base-font
    font-size: 28px
    font-weight: 700
    text-align: center
              
            
!

JS

              
                
              
            
!
999px

Console