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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <section>
  
  <span class="title">Hover me</span>
  
  <a class="method method--mobile" href="#">
    <div class="method__icon-con method__icon-con--mobile"><span class="icon"></span>
      <span class="mobile-lines">
        <span class="mobile-lines__line mobile-lines__line--small"></span>
        <span class="mobile-lines__line mobile-lines__line--big"></span>
      </span>
    </div>
  </a>

  <a class="method method--fb" href="#">
    <div class="method__icon-con method__icon-con--fb">
      <span class="icon"><span></span></span>
      <span class="bubble">
        <span class="tail"></span>
      </span>
    </div>
  </a>

  <a class="method method--email" href="#">
    <div class="method__icon-con method__icon-con--email"><span class="icon"></span></div>
  </a>
  
</section>
              
            
!

CSS

              
                $linecolor: navy; // line color
$highlight: red; // hightlight color
$bg: white; // background
$unit: 10vw; // base size
$width: 3px; // border width

$ease: cubic-bezier(.23,.01,0,1);
$easy: cubic-bezier(.8,0,.08,1);

body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  height: 100vh;
  justify-content: center;
}

section {
  background: $bg;
  width: 100%;
  text-align: center;
  
  .title {
    display: block;
    font-family: monospace;
    width: 100%;
    text-align: center;
    letter-spacing: .02em;
    font-size: 1.2rem;
    color: rgba($highlight,1);
    margin-bottom: 10vh;
  }
}


// contact methods
.method {
  display: inline-block;
  vertical-align: middle;

  &:last-of-type {
    margin-bottom: 0;
  }
    
    &:nth-of-type(2) {
      margin: 0 $unit;
    }
    
  
  span {
    box-sizing: border-box;
  }
}


.method {

  &:hover,
  &:active,
  &:focus {

    .method__span {
      color: $highlight;

      &:before {
        border: $width solid rgba($linecolor, 0.9);
      }
    }

    // email animate
    .method__icon-con--email {
      transform: skewX(-4deg) translate3d(10%,0,0);

      &:before {
        transition: transform 0.4s $easy 0.1s, left 0.4s $ease 0.1s;
        left: -45%;
      }

      &:after {
        left: -35%;
        transition: transform 0.4s $easy 0.04s, left 0.4s $ease 0.04s;
      }

      &:after,
      &:before {
        transform: scale3d(1,1,1) translate3d(0,0,0);
        transform-origin: right;
      }
    }


    // mobile animate
    .method__icon-con--mobile {
      animation: mobile-shake 0.4s;

      @keyframes mobile-shake {
        0%{transform: rotate(0deg)}
        33%{transform: rotate(2deg)}
        66%{transform: rotate(-2deg)}
        100%{transform: rotate(0deg)}
      }

      .mobile-lines {

        .mobile-lines__line {
          transition: transform 0.4s $ease;

          &:before {
            transition: transform 0.4s;
            transform: rotate(-45deg);
          }

          &:after {
            transform: rotate(-45deg);
            transition: transform 0s 0.6s;
          }
        }

        .mobile-lines__line--small {
          &:before {
            transition-delay: 0.1s;
          }
        }

        .mobile-lines__line--big {
          &:before {
            transition-delay: 0.2s;
          }
        }
      }
    }

    // speech bubble animate
    .method__icon-con--fb {
      transform: translate3d(14px,0,0);

      .bubble {
        transform: rotate(0deg);
        opacity: 1;
        transition: 0.8s $ease 0.1s;

        &:after {
          transform: scale3d(1,1,1);
          transition: transform 0.8s $ease 0.1s;
        }
      }

    }

  }
}

.method__icon-con {
  border-radius: $unit * .03;
  border: $width solid $linecolor;
  margin: 0 auto;
  position: relative;
}


// mobile
.method__icon-con--mobile {
  width: $unit * .718;
  height: $unit * 1.154;

  .icon {
    position: absolute;
    border: $width solid $linecolor;
    width: $unit * .14;
    height: $unit * .14;
    bottom: $unit * .115;
    border-radius: $width;
    left: 50%;
    transform: translate3d(-50%,0,0);
  }
}

.mobile-lines {
  position: absolute;
  height: $unit * .77;
  width: $unit * .77;
  overflow:hidden;
  top: 0;
  left: 0;
  transform: translate3d(-100%,-100%,0);
}


.mobile-lines__line {
  position: absolute;
  border-radius: 50%;
  bottom: 0;
  right: 0;
  transition: transform 0s 0.4s;
  transform: translate3d(50%,50%,0) rotate(90deg);

  &:after,
  &:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: $width solid transparent;
    border-left-color: $highlight;
  }

  &:before {
    transform: rotate(135deg);
    transition: transform 0s;
  }

  &:after {
    transform: rotate(-135deg);
    transition: transform 0.4s;
  }
}

.mobile-lines__line--small {
  width: $unit * .462;
  height: $unit * .462;

  &:after {
    transition-delay: 0.1s;
  }
}

.mobile-lines__line--big {
  width: $unit * .77;
  height: $unit * .77;
}



// facebook
.method__icon-con--fb {
  width: $unit;
  height: $unit;
  transition: 0.8s $ease;

  // speech bubble
  .bubble {
    position: absolute;
    bottom: $width;
    left: -$width;
    width: $unit * .718;
    height: $unit * .5385;
    border: $width solid $highlight;
    border-radius: $unit * .77;
    margin-bottom: $unit * .128;
    margin-left: -$unit * .878;
    border-bottom-right-radius: 3px;
    transform-origin: bottom right;

    opacity: 0;
    transform: rotate(-10deg) translate3d(-10%,10%,0);
    transition: opacity 0.4s $ease, transform 0s 0.4s;

    &:after {
      content: '';
      position: absolute;
      bottom: -$width;
      right: -$width;
      height: $unit * .07;
      width: $unit * .16;
      background: $bg;
      z-index: 1;
      transform-origin: right;

      transition: transform 0s 0.4s;
      transform: scale3d(2.5,1,1);
    }

    .tail {
      position: absolute;
      bottom: -$unit * .165;
      right: -$width;
      width: $unit * .2301;
      height: $unit * .2301;
      z-index: 2;

      &:before,
      &:after {
        background: $highlight;
        content: '';
        position: absolute;
        width: $width;
        right: 0;
        bottom: 0;
        height: 100%;
        border-radius: $width;
      }

      &:before {
      }

      &:after {
        transform-origin: bottom;
        transform: rotate(-45deg);
      }
    }
  }


  // f letter
  .icon {
    position: absolute;
    width: 25%;
    bottom: -$width / 2;
    left: 50%;
    transform: translate3d(-25%,0,0);
    height: 75%;

    span,
    &:after,
    &:before {
      content: '';
      position: absolute;
    }

    &:before {
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      border-left: $width solid $linecolor;
      border-top: $width solid $linecolor;
      border-top-left-radius: $unit * .513;
    }

    &:after {
      transform: translate3d(-30%,0,0);
      background: $linecolor;
    }

    span,
    &:after {
      top: 40%;
      height: $width;
      left: 0;
      width: 120%;
    }

    span {
      background: $highlight;
      z-index: 1;
      transform: translate3d(-30%,0,0) scale3d(0,1,1);
      transition: transform 0.8s $ease;
      transform-origin: right;
    }
  }
}



// email
.method__icon-con--email {
  width: $unit * 1.41;
  height: $unit * .92; 
  transition: 0.8s $ease;

  &:after,
  &:before {
    content: '';
    position: absolute;
    background: $highlight;
    height: $width;
    z-index: 1;
    transform-origin: left;
    transform: scale3d(0,1,1) translate3d(20%,0,0);
  }

  &:before {
    top: 30%;
    left: -25%;
    width: 28%;
    transition: transform 0.4s $easy, left 0s 0.5s;
  }

  &:after {
    bottom: 30%;
    left: -15%;
    width: 40%;
    box-shadow: 0px $width 0px 0px $bg;
    transition: transform 0.4s $easy 0.03s, left 0s 0.5s;
  }

  .icon {
    position: absolute;
    overflow: hidden;
    top: 0;
    left: 0;
    right: 0;
    height: 65%;
    backface-visibility: hidden;

    &:after,
    &:before {
      content: '';
      height: $width;
      bottom: 0;
      position: absolute;
      background: $linecolor;
      width: 100%;
      border-radius: $width;
    }

    &:before {
      left: 50%;
      transform-origin: left bottom;
      transform: rotate(-39.5deg);
    }

    &:after {
      right: 50%;
      transform-origin: right bottom;
      transform: rotate(39.5deg);
    }
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console