Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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="wrapper">
  <div class="panel ripple-effect">
    <div id="mount-point"></div>
  </div>
  <div class="title">Klik kotak untuk melihat efek Ripple</div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Fira+Sans+Condensed');

body {
  background: #ecf0f1;
  font-family: 'Fira Sans Condensed', sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 20vh auto 0 auto;
}
.MenuRipple {
  position: relative;
  width: 100px;
  height: 80px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.MenuRipple:before,
.MenuRipple:after,
.MenuRipple div {
  position: absolute;
  width: 100%;
  height: 10%;
  background: #fff;
  transition: all .3s;
}

.MenuRipple:before {
  content: '';
  top: 0;
}

.MenuRipple:after {
  content: '';
  bottom: 0;
}

.MenuRipple div {
  top: 50%;
  transform: translateY(-50%);
  transition: all 150ms;
  opacity: 1;
}

.MenuRipple--active:before {
  top: 50%;
  transform: translateY(-50%) rotateZ(135deg);
}

.MenuRipple--active:after {
  bottom: 50%;
  transform: translateY(50%) rotateZ(45deg);
}

.MenuRipple--active div {
  opacity: 0;
}

.wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 370px;
}

.panel {
  position: relative;
  display: inline-block;
  width: 170px;
  height: 170px;
  vertical-align: top;
  text-align: left;
  background: #e74c3c;
}

.panel > div {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.title {
  display: inline-block;
  width: 150px;
  margin-left: 30px;
  vertical-align: top;
  font-size: 25px;
  line-height: 32px;
  text-align: left;
  color: #e74c3c;
}

@media (max-width: 400px) {
  .wrapper {
    width: 100%;
  }
  .title {
    width: 80%;
    margin: 30px 0 0 0;
    text-align: center;
  }
}

svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

circle {
  fill: rgba(255, 255, 255, 0.07);
}

.ripple-effect {
  position: relative;
  overflow: hidden;
  -webkit-transform: translatez(0);
}

.teffect {
  display: block;
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  transform: scale(0);
  background: #fff;
  opacity: 0.5;
}

.teffect.animate {
  animation: ripple-effect 0.5s linear;
}

@keyframes ripple-effect {
  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}

@-webkit-keyframes ripple-effect {
  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}
              
            
!

JS

              
                'use strict';

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var _React = React;
var Component = _React.Component;
var PropTypes = _React.PropTypes;
var _ReactDOM = ReactDOM;
var render = _ReactDOM.render;

var MenuRipple = function (_Component) {
  _inherits(MenuRipple, _Component);

  function MenuRipple(props) {
    _classCallCheck(this, MenuRipple);

    var _this = _possibleConstructorReturn(this, _Component.call(this, props));

    _this.state = {
      isMenuOpen: false
    };

    _this.getMenuRippleClass = _this.getMenuRippleClass.bind(_this);
    _this.toggleMenu = _this.toggleMenu.bind(_this);
    return _this;
  }

  MenuRipple.prototype.toggleMenu = function toggleMenu() {
    var isMenuOpen = !this.state.isMenuOpen;
    this.setState({ isMenuOpen: !this.state.isMenuOpen });

    if (typeof this.props.onChange === 'function') {
      this.props.onChange(isMenuOpen);
    }
  };

  MenuRipple.prototype.getMenuRippleClass = function getMenuRippleClass() {
    var elementClasses = ['MenuRipple'];

    if (this.state.isMenuOpen === true) {
      elementClasses.push('MenuRipple--active');
    }

    return elementClasses.join(' ');
  };

  MenuRipple.prototype.render = function render() {
    return React.createElement(
      'div',
      {
        className: this.getMenuRippleClass(),
        onClick: this.toggleMenu },
      React.createElement('div', null)
    );
  };

  return MenuRipple;
}(Component);

render(React.createElement(MenuRipple, null), document.getElementById('mount-point'));

/* Arlina Design Material Button by http://www.arlinadzgn.com */
(function($) {
    $(".ripple-effect").click(function(e){
        var rippler = $(this);
        if(rippler.find(".teffect").length === 0) {
            rippler.append("<span class='teffect'></span>");
        }
        var teffect = rippler.find(".teffect");
        teffect.removeClass("animate");
        if(!teffect.height() && !teffect.width())
        {
            var d = Math.max(rippler.outerWidth(), rippler.outerHeight());
            teffect.css({height: d, width: d});
        }
        var x = e.pageX - rippler.offset().left - teffect.width()/2;
        var y = e.pageY - rippler.offset().top - teffect.height()/2;
        teffect.css({
            top: y+'px',
            left:x+'px'
        }).addClass("animate");
    })
})(jQuery);
              
            
!
999px

Console