cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console