cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-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="wrapper">
  <div class="panel ripple-effect">
    <div id="mount-point"></div>
  </div>
  <div class="title">Klik kotak untuk melihat efek Ripple</div>
</div>
            
          
!
            
              @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);
  }
}
            
          
!
            
              '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
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