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 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

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="container">
  <div class="headline">
    <h3>Hover over the icons to animate them</h3>
  </div>
  <div class="social-buttons">
    <!-- facebook  Button -->
    <a href="http://www.facebook.com" target="blank" class="social-button">
      <div class="social-icon facebook">
        <i class="fab fa-facebook"></i>
         <span>Round & round we go</span>
      </div>
    </a>
    <!-- pinterest Button -->
    <a href="https://pinterest.com/" target="blank" class="social-button">
      <div class="social-icon pinterest">
        <i class="fab fa-pinterest-p" aria-hidden="true"></i>
        <span>Smooth...</span>
      </div>
    </a>
    <!-- LinkedIn Button -->
    <a href="http://linkedin.com/" class="social-button" target="blank">
      <div class="social-icon linkedin">
        <i class="fab fa-linkedin" aria-hidden="true"></i>
         <span>Not a rainbow!</span>
      </div>
    </a>
    <!-- Github Button -->
    <a href="https://github.com/" target="blank" class="social-button">
      <div class="social-icon github">
        <i class="fab fa-github-alt" aria-hidden="true"></i>
         <span>Go big!</span>
      </div>
    </a>
    <!-- Youtube Button -->
    <a href="http://youtube.com/" target="blank" class="social-button">
      <div class="social-icon youtube">
        <i class="fab fa-youtube" aria-hidden="true"></i>
        <span>Go big!</span>
      </div>
    </a>
    <!-- Behance Button -->
    <a href="https://behance.com/" target="blank" class="social-button">
      <div class="social-icon behance">
        <i class="fab fa-behance" aria-hidden="true"></i>
        <span>It's a rainbow!</span>
      </div>
    </a>
    <!-- Soundcloud Button -->
    <a href="http://soundcloud.com/" target="blank" class="social-button">
      <div class="social-icon soundcloud">
        <i class="fab fa-soundcloud" aria-hidden="true"></i>
        <span>Feel the pulse</span>
      </div>
    </a>
    <!-- TwitterButton -->
    <a href="http://twitter.com/" target="blank" class="social-button">
      <div class="social-icon twitter">
        <i class="fab fa-twitter" aria-hidden="true"></i>
        <span>Like a bird</span>
      </div>
    </a>
    <a href="http://instagram.com/" target="blank" class="social-button">
      <div class="social-icon instagram">
        <i class="fab fa-instagram" aria-hidden="true"></i>
        <span>Say cheese</span>
      </div>
    </a>
  </div>
</div>
              
            
!

CSS

              
                // Color variants
$behance-color: #1666f8;
$facebook-color: #3b5998;
$pinterest-color: #e60023;
$linkedin-color: #0976b4;
$github-color: #24292e;
$youtube-color: #f90101;
$soundcloud-color: #f50;
$twitter-color: #1da1f2;
$instagram-color: #000;

@mixin animation($prop...) {
  -webkit-animation: $prop;
  -moz-animation: $prop;
  -ms-animation: $prop;
  -o-animation: $prop;
  animation: $prop;
}

@mixin keyframes($name) {
    @-webkit-keyframes #{$name} {
        @content;
    }
    @-moz-keyframes #{$name} {
        @content;
    }
    @-o-keyframes #{$name} {
        @content;
    }
    @keyframes #{$name} {
        @content;
    }
}

@mixin keyframesChange($name, $color) {
  @if $color == $behance-color {
    @include keyframes ($name) {
      0% {fill: $behance-color;}
      20% {fill: #FF7F00;}
      40% {fill: #FFFF00;}
      60% {fill: #00FF00;}
      80% {fill: #0000FF;}
      100% {fill: #2E2B5F;}
    }
  } @else {
      @include keyframes ($name) {
        0% {fill: $linkedin-color;}
        20% {fill: #0000cc;}
        40% {fill: #0000b2;}
        60% {fill: #00007f;}
        80% {fill: #00004c;}
        100% {fill: #000019;}
      }
  }
}

@mixin stroke($array, $offset, $color, $width: 1rem) {
  stroke-dasharray: $array;
  stroke-dashoffset: $offset;
  stroke: $color;
  stroke-width: $width;
}

@mixin transform($prop...) {
  -webkit-transform: $prop;
  -moz-transform: $prop;
  -ms-transform: $prop;
  -o-transform: $prop;
  transform: $prop;
}

@mixin transition($prop...) {
  -webkit-transition: $prop;
  -moz-transition: $prop;
  -ms-transition: $prop;
  -o-transition: $prop;
  transition: $prop;
}

html, body {
  margin: 0;
  overflow: hidden;
}

.container {
  min-height: 300px;
  padding-top: 20px;
  padding-bottom: 20px;
  text-align: center;
}

.container h3 {
  font-size: 20px;
}
.social-buttons {
  display:inline-block;
  background: rgba(256,256,256,0.5);
  text-align:center;

  .social-button {
    display: inline-block;
    text-decoration: none;
    color: #333;
    margin: 20px;
    font-size: 12px;
    width: 60px;
  }
  
  .social-icon {
    display: grid;    

    &.behance {
      path {
        fill: $behance-color;
      }
      svg:hover {
        path {
           @include animation(swapB 1.5s both);
        }
        @include keyframesChange (swapB, $behance-color);
      }
    }
    
    &.facebook {
      path {
        fill: $facebook-color;
      }
      svg:hover {
        @include transform(rotate(360deg));
        @include transition(1s ease-in);
      }
    }
    
    &.instagram {
      path {
        fill: $instagram-color;
      }
      svg:hover {
        @include transition(1s ease-in);
        path {
          @include stroke(0, 0, #fc853e, 10px);
          fill: #9633c2;         
        }
      }      
    }
    
    &.linkedin {
      path {
        fill: $linkedin-color;
      }
      svg:hover {
        path {
          @include animation(swapL 2.5s both);
        }
        @include keyframesChange (swapL, $linkedin-color);
      }
    }
    
    &.pinterest {
      path {
        fill: $pinterest-color;
      }
      svg:hover {
        path {
          @include stroke(2640, -2640, $pinterest-color);
          @include animation(line 3s linear forwards, filling 3s ease-in forwards);
        }
        @include keyframes (line) {
          to {
             stroke-dashoffset: 0;
             fill: #333;
          }
        }
         @include keyframes (filling) {
          to {
            fill: #fff;
          }
        }
      }
    }
    
    &.soundcloud {
      path {
        fill: $soundcloud-color;
      }
      svg{
        width: 70px;
      }
      svg:hover {
        path {
          @include animation(pulse 2.5s infinite);
        }
        @include keyframesChange (swapL, $linkedin-color);
      }
      @include keyframes (pulse) {
        0% {
          stroke-width: 2;
          stroke: #ff55007a;
        }
        100% {
          stroke-width: 140;
          stroke: #ff55006e;
        }
      }
    }
    
    &.twitter {
      path {
        fill: $twitter-color;
      }
      svg:hover {
        path {
          @include stroke(2200, -2200, #010327);
          @include animation(line 3s linear forwards);
        }
        @include keyframes (line) {
          to {
            stroke-dashoffset: 0;
          }
        }
      }
    }
    
    &.github,
    &.youtube {
      svg:hover {
        path {
          transform: scale(1.2);
          transform-origin: 10%;
          @include transition(0.2s ease-in-out);
        }
      }
      
    }
    
    &.github path {
      fill: $github-color;
    }
    &.youtube path {
      fill: $youtube-color;
    }
    
    svg {
      width: 50px;
      height: 50px;
    }
}

  .social-icon i {
    font-size: 30px;
  }
  
} 
              
            
!

JS

              
                
              
            
!
999px

Console