cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="title">
    Click on the buttons to see the effects inside the button
  </div>
  <div class="buttons">
    <ul>
      <li>
        <a href="javascript:void(0)" class="customBtn effect1">Boom</a>
      </li>
      <li>
        <a href="javascript:void(0)" class="customBtn effect2">Slide Down</a>
      </li>
      <li>
        <a href="javascript:void(0)" class="customBtn effect3">Slide Up</a>
      </li>
      <li>
        <a href="javascript:void(0)" class="customBtn effect4">Slide Left</a>
      </li>
      <li>
        <a href="javascript:void(0)" class="customBtn effect5">Slide Right</a>
      </li>
    </ul>
  </div>
            
          
!
            
              $white: #fff
$blue: #2980b9

html
  background: $white
  min-height: 100%
  font-family: 'Roboto', sans-serif

.title
  font-size: 22px
  letter-spacing: 1px
  word-spacing: 2px
  text-align: center
  margin: 30px
  text-transform: uppercase
.buttons
  width: 100%
  max-width: 990px
  margin: 0 auto
  text-align: center

ul
  li
    list-style: none
    display: inline-block

.customBtn
  color: $white
  text-decoration: none
  background: $blue
  padding: 12px 20px
  border-radius: 3px
  display: inline-block
  overflow: hidden
  &:hover
    background: darken($blue, 5%)

.boomeffect
  position: relative
  &::after
    position: absolute
    content: ''
    left: 0
    top: 0
    width: 100%
    height: 100%
    border-radius: 50%
    background: rgba($white, 0.3)
    animation: boomeffect 400ms ease-in-out forwards

.slidedown
  position: relative
  &::after
    position: absolute
    content: ''
    width: 100%
    left: 0
    height: 100%
    bottom: 0
    background: rgba($white, 0.3)
    transform: translateY(100%)
    animation: slidedown 600ms ease-in-out forwards

.slideup
  position: relative
  &::after
    position: absolute
    content: ''
    width: 100%
    left: 0
    height: 100%
    top: 0
    background: rgba($white, 0.3)
    transform: translateY(100%)
    animation: slideup 600ms ease-in-out forwards

.slideleft
  position: relative
  &::after
    position: absolute
    content: ''
    width: 100%
    left: -100%
    height: 100%
    top: 0
    background: rgba($white, 0.3)
    transform: translateX(100%)
    animation: slideleft 600ms linear forwards

.slideright
  position: relative
  &::after
    position: absolute
    content: ''
    width: 100%
    right: -100%
    height: 100%
    top: 0
    background: rgba($white, 0.3)
    transform: translateX(0)
    animation: slideright 300ms linear forwards

/*---------------Keyframes-----------------*/
@keyframes boomeffect
  0%
    transform: scale(0)
    opacity: 0
  25%
    transform: scale(0.5)
    opacity: 0.5
  50%
    transform: scale(1)
    opacity: 1
  75%
    transform: scale(1.5)
    opacity: 0.5
  100%
    transform: scale(2)
    opacity: 0

@keyframes slidedown
  0%
    transform: translateY(-100%)
  30%
    transform: translateY(-80%)
  50%
    transform: translateY(-50%)
  100%
    transform: translateY(100%)


@keyframes slideup
  0%
    transform: translateY(100%)
  30%
    transform: translateY(-50%)
  50%
    transform: translateY(-80%)
  100%
    transform: translateY(-100%)

@keyframes slideleft
  0%
    transform: translateX(-100%)
  30%
    transform: translateX(-80%)
  50%
    transform: translateX(-50%)
  80%
    transform: translateX(100%)
  100%
    transform: translateX(200%)

@keyframes slideright
  0%
    transform: translateX(0%)
  30%
    transform: translateX(-50%)
  50%
    transform: translateX(-80%)
  80%
    transform: translateX(-100%)
  100%
    transform: translateX(-200%)

            
          
!
            
              $(document).ready(function(){
  //For Boom effect button
  $('.effect1').on('click', function(){
    var $effecto1 = $(this);

    $effecto1.addClass('boomeffect');

    setTimeout(function(){
      $effecto1.removeClass('boomeffect');
    },400);
  });

  // For slide down button
  $('.effect2').on('click', function(){
    var $effecto2 = $(this);

    $effecto2.addClass('slidedown');
    setTimeout(function(){
      $effecto2.removeClass('slidedown');
    },600);
  });

  // For slide up button
  $('.effect3').on('click', function(){
    var $effecto3 = $(this);

    $effecto3.addClass('slideup');
    setTimeout(function(){
      $effecto3.removeClass('slideup');
    },600);
  });

  // For slideleft button
  $('.effect4').on('click', function(){
    var $effecto4 = $(this);

    $effecto4.addClass('slideleft');
    setTimeout(function(){
      $effecto4.removeClass('slideleft');
    },600);
  });

  // For slideright button
  $('.effect5').on('click', function(){
    var $effecto5 = $(this);

    $effecto5.addClass('slideright');
    setTimeout(function(){
      $effecto5.removeClass('slideright');
    },600);
  });

});

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console