HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!-- header -->
<header>
<h2>Material Design Buttons</h2>
</header><!-- @end header -->
<!-- Main content -->
<main role="main">
<section>
<h3 class="heading">Fab Buttons</h3>
<div class="wrap">
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-fab btn-lightBlue ripple-effect"><i class="material-icons">attach_file</i></button></div>
<div class="captions">Normal Button</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-fab-mini btn-pink ripple-effect"><i class="material-icons">favorite_border</i></button></div>
<div class="captions">Mini Button</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-fab-mini btn-lightBlue" disabled><i class="material-icons">cloud_upload</i></button></div>
<div class="captions">Disabled Button</div>
</div>
</div>
</section>
<section>
<h3 class="heading">Raised Buttons</h3>
<div class="wrap">
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-lightBlue">Button</button></div>
<div class="captions">Normal Button</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-lightBlue ripple-effect">Button</button></div>
<div class="captions">Ripple Effect</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-lightBlue" disabled>Button</button></div>
<div class="captions">Disabled Button</div>
</div>
</div>
</section>
<section>
<h3 class="heading">Buttons With Icon</h3>
<div class="wrap">
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-lightBlue"><i class="material-icons">cloud_upload</i>Button</button></div>
<div class="captions">Icon Left</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-lightBlue ripple-effect"><i class="material-icons right">cloud_upload</i>Button</button></div>
<div class="captions">Icon Right</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-lightBlue" disabled><i class="material-icons">cloud_upload</i>Button</button></div>
<div class="captions">Disabled Button</div>
</div>
</div>
</section>
<section>
<h3 class="heading">Flat Buttons</h3>
<div class="wrap">
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-flat">Button</button></div>
<div class="captions">Flat Button</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-flat ripple-effect"><i class="material-icons">favorite_border</i>Button</button></div>
<div class="captions">Ripple Effect</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-flat" disabled>Button</button></div>
<div class="captions">Disabled Button</div>
</div>
</div>
</section>
<section>
<h3 class="heading">Link Buttons</h3>
<div class="wrap">
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-link">Button</button></div>
<div class="captions">Link Button</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-link ripple-effect"><i class="material-icons">favorite_border</i>Button</button></div>
<div class="captions">Ripple Effect</div>
</div>
<div class="holder col-3">
<div class="demo"><button class="rkmd-btn btn-link" disabled>Button</button></div>
<div class="captions">Disabled Button</div>
</div>
</div>
</section>
<section>
<h3 class="heading">Raised Buttons in Different Sizes</h3>
<div class="wrap">
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-lg btn-lightBlue ripple-effect">Button</button></div>
<div class="captions">Large Button</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-lightBlue ripple-effect">Button</button></div>
<div class="captions">Medium Button</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-sm btn-lightBlue ripple-effect">Button</button></div>
<div class="captions">Small Button</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-xs btn-lightBlue ripple-effect">Button</button></div>
<div class="captions">Extra Small Button</div>
</div>
</div>
</section>
<section>
<h3 class="heading">Ripple Effect in Different Colors</h3>
<div class="wrap">
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-lightBlue ripple-effect"><i class="material-icons right">send</i>Submit</button></div>
<div class="captions">Default Ripple</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-white ripple-effect ripple-dark"><i class="material-icons right">send</i>Submit</button></div>
<div class="captions">Ripple Dark</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-white ripple-effect ripple-red"><i class="material-icons right">send</i>Submit</button></div>
<div class="captions">Ripple Red</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-white ripple-effect ripple-orange"><i class="material-icons right">send</i>Submit</button></div>
<div class="captions">Ripple Orange</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-white ripple-effect ripple-yellow"><i class="material-icons right">send</i>Submit</button></div>
<div class="captions">Ripple Yellow</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-white ripple-effect ripple-green"><i class="material-icons right">send</i>Submit</button></div>
<div class="captions">Ripple Green</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-white ripple-effect ripple-purple"><i class="material-icons right">send</i>Submit</button></div>
<div class="captions">Ripple Purple</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-white ripple-effect ripple-teal"><i class="material-icons right">send</i>Submit</button></div>
<div class="captions">Ripple Teal</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-white ripple-effect ripple-pink"><i class="material-icons right">send</i>Submit</button></div>
<div class="captions">Ripple Pink</div>
</div>
</div>
</section>
<section>
<h3 class="heading">Buttons in Different Colors</h3>
<div class="wrap">
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-white ripple-effect ripple-dark"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">White</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-black ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Black</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-grey ripple-effect ripple-dark"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Grey</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-lightBlue ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Light Blue</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-orange ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Orange</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-amber ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Amber</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-green ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Green</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-teal ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Teal</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-cyan ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Cyan</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-indigo ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Indigo</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-deepPurple ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Deep Purple</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-pink ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Pink</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-red ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Red</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-yellow ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Yellow</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-lime ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Lime</div>
</div>
<div class="holder col-4">
<div class="demo"><button class="rkmd-btn btn-brown ripple-effect"><i class="material-icons">file_download</i>Download</button></div>
<div class="captions">Brown</div>
</div>
</div>
</section>
</main><!-- @end main -->
<!-- Footer -->
<footer>
<div class="row">
<div class="footer-content">
<span><strong>Made in India</strong>,</span>
<span>by <a href="https://twitter.com/rkchauhan01" target="_blank">Ravikumar Chauhan</a>.</span>
<span><a href="https://github.com/rkchauhan" target="_blank">GitHub</a></span>
<span><a href="https://codepen.io/rkchauhan" target="_blank">CodePen</a></span>
</div>
</div>
</footer><!-- @end footer -->
/* -----------------------------------------------------
Material Design Buttons
https://codepen.io/rkchauhan/pen/NNKgJY
By: Ravikumar Chauhan
Find me on -
Twitter: https://twitter.com/rkchauhan01
Facebook: https://www.facebook.com/ravi032chauhan
GitHub: https://github.com/rkchauhan
CodePen: https://codepen.io/rkchauhan
-------------------------------------------------------- */
// Buttons Color
$btn_default: #e0e0e0;
$btn_lightBlue: #03a9f4;
$btn_white: #FFF;
$btn_black: #111;
$btn_grey: #f5f5f5;
$btn_orange: #ff9800;
$btn_amber: #ffc107;
$btn_green: #4caf50;
$btn_teal: #009688;
$btn_cyan: #00bcd4;
$btn_indigo: #3f51b5;
$btn_deepPurple: #673ab7;
$btn_pink: #e91e63;
$btn_red: #f44336;
$btn_yellow: #ffeb3b;
$btn_lime: #cddc39;
$btn_brown: #795548;
// KEYFRAMES
@mixin keyframes($animation-name) {
@-webkit-keyframes #{$animation-name} {
@content;
}
@-moz-keyframes #{$animation-name} {
@content;
}
@-ms-keyframes #{$animation-name} {
@content;
}
@-o-keyframes #{$animation-name} {
@content;
}
@keyframes #{$animation-name} {
@content;
}
}
// Column generator
@mixin colmk($numRows, $margin) {
width: ((100% - (($numRows - 1) * $margin)) / $numRows);
&:nth-child(n) {
margin-right: $margin;
margin-bottom: $margin;
}
&:nth-child(#{$numRows}n) {
margin-right: 0;
margin-bottom: 0;
}
}
/* -----------------------------------------------------
Body
-------------------------------------------------------- */
body {
margin: 0;
padding: 0;
color: #646360;
font-size: 16px;
font-family: 'Roboto', sans-serif;
background-color: #eee;
}
*, *::after, *::before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
box-sizing: border-box;
}
a {
color: #03a9f4;
outline: none;
text-decoration: none;
&:hover { text-decoration: underline; }
}
/* -----------------------------------------------------
Main
-------------------------------------------------------- */
main {
width: 100%;
max-width: 940px;
margin: 1.4rem auto;
section {
display: block;
margin-bottom: 1.4rem;
padding: 1.2rem;
background-color: #fff;
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.157);
&:last-child { margin-bottom: 0; }
.heading {
margin: 0;
padding: 0;
font-size: 1.2rem;
}
.wrap {
overflow: hidden;
display: block;
margin: 1rem 0 0.8rem;
text-align: center;
.holder {
float: left;
//display: inline-block;
//margin-right: 8px;
//margin-bottom: 8px;
text-align: center;
background-color: #f2f2f2;
&:last-child { margin-right: 0; }
&.col-3 {
//width: calc(100% / 3 - 8px);
@include colmk(3, 1%);
}
&.col-4 {
//width: calc(100% / 4 - 9px);
//&:nth-child(4n) { margin-right: 0; }
@include colmk(4, 1%);
}
.demo {
min-height: 120px;
padding: 2em 0;
display: flex;
justify-content: center;
align-content: center;
}
.captions {
padding: 8px;
color: rgba(0,0,0,0.5);
font-size: 13px;
font-weight: bold;
border-top: 1px solid rgba(0,0,0,0.1);
}
@media only screen and (max-width: 860px) {
&.col-4 {
@include colmk(3, 1%);
}
}
@media only screen and (max-width: 640px) {
float: none;
&.col-3,
&.col-4 {
display: block;
width: 100%;
&:nth-child(n) { margin: 0; margin-bottom: 14px; }
}
}
}
}
}
@media only screen and (max-width: 960px) {
padding: 0 1.5%;
}
}
/* -----------------------------------------------------
Header
-------------------------------------------------------- */
header {
display: block;
width: 100%;
padding: 12px 0;
text-align: center;
background-color: #FFF;
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.1);
h2 {
margin: 0;
padding: 25px 0;
font-size: 2em;
font-weight: 300;
letter-spacing: 1px;
}
}
/* -----------------------------------------------------
Footer
-------------------------------------------------------- */
footer {
display: block;
overflow: hidden;
width: 100%;
min-height: 80px;
background-color: #FFF;
border-top: 1px solid #EEE;
.row {
width: 100%;
max-width: 860px;
margin: 0 auto;
}
.footer-content {
margin: 0 8px;
padding: 25px 0 18px;
text-align: center;
span {
color: rgba(0, 0, 0, 0.525);
font-size: 0.857em;
margin-right: 5px;
}
}
@media only screen and (max-width: 768px) {
span {
display: block;
width: 100%;
margin-bottom: 8px;
}
}
}
/* ----------------------------------------------------------------------
Material Design Raised Buttons - by Ravikumar Chauhan
------------------------------------------------------------------------- */
.rkmd-btn {
display: inline-block;
position: relative;
cursor: pointer;
height: 35px;
line-height: 35px;
padding: 0 1.5rem;
color: #424242;
font-size: 15px;
font-weight: 600;
font-family: 'Roboto', sans-serif;
letter-spacing: .8px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
vertical-align: middle;
white-space: nowrap;
outline: none;
border: none;
user-select: none;
border-radius: 2px;
transition: all .3s ease-out;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.225);
&:hover { text-decoration: none; box-shadow: 0 4px 10px 0px rgba(0,0,0,0.225); }
}
/* ----------------------------------------------------------------------
Material Design Fab Buttons - by Ravikumar Chauhan
------------------------------------------------------------------------- */
.rkmd-btn {
&.btn-fab,
&.btn-fab-mini {
overflow: hidden;
position: relative;
margin: auto;
padding: 0;
line-height: normal;
border-radius: 50%;
box-shadow: 0 2px 5px 1px rgba(0,0,0,0.3);
&:hover { box-shadow: 0 4px 11px 0px rgba(0,0,0,0.375); }
i {
display: inline-block;
float: none;
width: inherit;
margin: 0;
font-size: inherit;
text-align: center;
line-height: none;
vertical-align: middle;
}
}
&.btn-fab {
width: 56px;
height: 56px;
font-size: 28px;
}
&.btn-fab-mini {
width: 40px;
height: 40px;
font-size: 24px;
}
}
/* Buttons Color */
.rkmd-btn {
&.btn-lightBlue {
color: #FFF;
background-color: $btn_lightBlue;
&:hover { background-color: lighten($btn_lightBlue, 8%); }
}
&.btn-white {
color: #444;
background-color: $btn_white;
&:hover { background-color: darken($btn_white, 2%); }
}
&.btn-black {
color: #bdbdbd;
background-color: $btn_black;
&:hover { background-color: lighten($btn_black, 8%); }
}
&.btn-grey {
color: #757575;
background-color: $btn_grey;
&:hover { background-color: darken($btn_grey, 4%); }
}
&.btn-orange {
color: #FFF;
background-color: $btn_orange;
&:hover { background-color: lighten($btn_orange, 8%); }
}
&.btn-amber {
color: #FFF;
background-color: $btn_amber;
&:hover { background-color: lighten($btn_amber, 8%); }
}
&.btn-green {
color: #FFF;
background-color: $btn_green;
&:hover { background-color: lighten($btn_green, 8%); }
}
&.btn-teal {
color: #FFF;
background-color: $btn_teal;
&:hover { background-color: lighten($btn_teal, 8%); }
}
&.btn-cyan {
color: #FFF;
background-color: $btn_cyan;
&:hover { background-color: lighten($btn_cyan, 8%); }
}
&.btn-indigo {
color: #FFF;
background-color: $btn_indigo;
&:hover { background-color: lighten($btn_indigo, 8%); }
}
&.btn-deepPurple {
color: #FFF;
background-color: $btn_deepPurple;
&:hover { background-color: lighten($btn_deepPurple, 8%); }
}
&.btn-pink {
color: #FFF;
background-color: $btn_pink;
&:hover { background-color: lighten($btn_pink, 8%); }
}
&.btn-red {
color: #FFF;
background-color: $btn_red;
&:hover { background-color: lighten($btn_red, 8%); }
}
&.btn-yellow {
color: #FFF;
background-color: $btn_yellow;
&:hover { background-color: darken($btn_yellow, 13%); }
}
&.btn-lime {
color: #FFF;
background-color: $btn_lime;
&:hover { background-color: darken($btn_lime, 8%); }
}
&.btn-brown {
color: #FFF;
background-color: $btn_brown;
&:hover { background-color: lighten($btn_brown, 8%); }
}
}
/* Raised Buttons Size (Not work in Fab Buttons) */
.rkmd-btn {
&.btn-lg {
height: 48px;
line-height: 48px;
}
&.btn-sm {
height: 30px;
padding: 0 1rem;
line-height: 30px;
font-size: 12px;
}
&.btn-xs {
height: 24px;
padding: 0 .4rem;
line-height: 24px;
font-size: 11px;
font-weight: 300;
letter-spacing: .2px;
}
}
/* Raised Buttons Types */
.rkmd-btn {
&.disabled, &[disabled] {
cursor: default !important;
color: #9e9e9e !important;
box-shadow: none !important;
}
&.disabled:not(.btn-flat), &[disabled]:not(.btn-flat) {
background-color: #cdcdcd !important;
&:hover { background-color: #cdcdcd !important; }
}
&.btn-flat {
box-shadow: none !important;
background-color: transparent !important;
&:hover { background-color: #cecece !important; box-shadow: none !important; }
&.disabled:hover,
&[disabled]:hover { background-color: transparent !important; }
}
&.btn-link {
color: #3949ab !important;
box-shadow: none !important;
background-color: transparent !important;
&:hover {
text-decoration: underline !important;
background-color: transparent !important;
box-shadow: none !important;
}
&.disabled,
&[disabled] {
color: #9fa8da !important;
text-decoration: underline !important;
background-color: transparent !important;
}
&.disabled:hover,
&[disabled]:hover { background-color: transparent !important; }
}
i {
float: left;
width: auto;
height: auto;
margin-right: 10px;
font-size: 1.3rem;
line-height: inherit;
&.right {
float: right !important;
margin: 0;
margin-left: 10px;
}
}
}
/* ----------------------------------------------------------------------
Material Design Ripple Effect - by Ravikumar Chauhan
------------------------------------------------------------------------- */
.ripple-effect {
display: inline-block;
position: relative;
overflow: hidden;
cursor: pointer;
vertical-align: middle;
user-select: none;
z-index: 1;
.ripple {
display: block;
position: absolute;
border-radius: 100%;
background: rgba(255,255,255,0.5);
transform: scale(0);
pointer-events: none;
}
&.ripple-dark {
.ripple {
background: rgba(0,0,0,0.1) !important;
}
}
&.ripple-red {
.ripple {
background: rgba(244,67,54,0.725) !important;
}
}
&.ripple-orange {
.ripple {
background: rgba(255,152,0,0.725) !important;
}
}
&.ripple-yellow {
.ripple {
background: rgba(255,235,59,0.725) !important;
}
}
&.ripple-green {
.ripple {
background: rgba(76,175,80,0.725) !important;
}
}
&.ripple-purple {
.ripple {
background: rgba(156,39,176,0.725) !important;
}
}
&.ripple-teal {
.ripple {
background: rgba(0,150,136,0.725) !important;
}
}
&.ripple-pink {
.ripple {
background: rgba(233,30,99,0.725) !important;
}
}
.animated {
animation: ripple 0.6s linear;
}
@include keyframes('ripple') {
100% {
opacity: 0;
transform: scale(2.5);
}
}
}
/* -----------------------------------------------------
Material Design Buttons
https://codepen.io/rkchauhan/pen/NNKgJY
By: Ravikumar Chauhan
Find me on -
Twitter: https://twitter.com/rkchauhan01
Facebook: https://www.facebook.com/ravi032chauhan
GitHub: https://github.com/rkchauhan
CodePen: https://codepen.io/rkchauhan
-------------------------------------------------------- */
$(document).ready(function() {
$('.ripple-effect').rkmd_rippleEffect();
});
(function($) {
$.fn.rkmd_rippleEffect = function() {
var btn, self, ripple, size, rippleX, rippleY, eWidth, eHeight;
btn = $(this).not('[disabled], .disabled');
btn.on('mousedown', function(e) {
self = $(this);
// Disable right click
if(e.button === 2) {
return false;
}
if(self.find('.ripple').length === 0) {
self.prepend('<span class="ripple"></span>');
}
ripple = self.find('.ripple');
ripple.removeClass('animated');
eWidth = self.outerWidth();
eHeight = self.outerHeight();
size = Math.max(eWidth, eHeight);
ripple.css({'width': size, 'height': size});
rippleX = parseInt(e.pageX - self.offset().left) - (size / 2);
rippleY = parseInt(e.pageY - self.offset().top) - (size / 2);
ripple.css({ 'top': rippleY +'px', 'left': rippleX +'px' }).addClass('animated');
setTimeout(function() {
ripple.remove();
}, 800);
});
};
}(jQuery));
Also see: Tab Triggers