LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code




CSS
*,
*:after,
*:before {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #434A54;
  font-family: "Open Sans", "Arial", sans-serif;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  padding: 50px 0;
}

/**
 * Object: Divider
 * --------------------------------------------------
 */
.o-divider {
  border: 0;
  margin: 20px;
  height: 1px;
  background: #656D78;
}

/**
 * Component: Button
 * --------------------------------------------------
 */
.c-button {
  -webkit-appearance: none;
  position: relative;
  display: inline-block;
  padding: 12px 24px;
  margin: 0;
  vertical-align: middle;
  overflow: visible;
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  text-align: center;
  letter-spacing: 1px;
  background: transparent;
  border: 0;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  box-shadow: 2px 2px 0 0 #383e46;
  -webkit-transition: all 0.2s ease;
  transition: all 0.2s ease;
}
.c-button:hover, .c-button:focus {
  outline: 0;
  text-decoration: none;
}
.c-button:not(:disabled) {
  cursor: pointer;
}

/**
 * Mixin: Button Modifier
 * --------------------------------------------------
 */
/**
 * Component: Button
 * Modifier: Purple
 * --------------------------------------------------
 */
.c-button--purple {
  background: #967ADC;
  text-shadow: 2px 2px 0 #7652d1;
}
.c-button--purple:hover {
  background: #8666d7;
}

/**
 * Component: Button
 * Modifier: Blue
 * --------------------------------------------------
 */
.c-button--blue {
  background: #4A89DC;
  text-shadow: 2px 2px 0 #276ecc;
}
.c-button--blue:hover {
  background: #357bd8;
}

/**
 * Component: Button
 * Modifier: Red
 * --------------------------------------------------
 */
.c-button--red {
  background: #E9573F;
  text-shadow: 2px 2px 0 #dc3519;
}
.c-button--red:hover {
  background: #e64328;
}

/**
 * Utility: Ripple
 * --------------------------------------------------
 */
.c-ripple {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

.c-ripple__circle {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  opacity: 0;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.c-ripple.is-active .c-ripple__circle {
  -webkit-animation: a-ripple .4s ease-in;
          animation: a-ripple .4s ease-in;
}

/**
 * Animation: Ripple
 * --------------------------------------------------
 */
@-webkit-keyframes a-ripple {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    width: 200%;
    padding-bottom: 200%;
    opacity: 0;
  }
}
@keyframes a-ripple {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    width: 200%;
    padding-bottom: 200%;
    opacity: 0;
  }
}
JS
;(function($, window, document, undefined) {

  'use strict';

  var $ripple = $('.js-ripple');

  $ripple.on('click.ui.ripple', function(e) {

    var $this = $(this);
    var $offset = $this.parent().offset();
    var $circle = $this.find('.c-ripple__circle');

    var x = e.pageX - $offset.left;
    var y = e.pageY - $offset.top;

    $circle.css({
      top: y + 'px',
      left: x + 'px'
    });

    $this.addClass('is-active');

  });

  $ripple.on('animationend webkitAnimationEnd oanimationend MSAnimationEnd', function(e) {
  	$(this).removeClass('is-active');
  });

})(jQuery, window, document);
Host Instantly Drag and Drop Website Builder

 

Description

Ripple effect inspired by Google Material Design
Term
Mon, 11/27/2017 - 21:35

Related Codes

Pen ID
Pen ID
Pen ID