<button>animate</button>
<div id="bubbles">
<div class="bubble-wrap">
<div class="bubble left">
Everybody is identical in their secret unspoken belief that way deep down they are different from everyone else.
</div>
</div>
<div class="bubble-wrap">
<div class="bubble right">
Everybody is identical in their secret unspoken belief that way deep down they are different from everyone else.
</div>
</div>
</div>
@import "bourbon";
/* modified from
https://www.ilikepixels.co.uk/drop/bubbler/
*/
a {
color: #fff;
}
body {
background: #3a3a3a;
font-family: $lucida-grande;
}
@include keyframes(scaleIn) {
from {
@include transform(scale(0));
}
to {
@include transform(scale(1));
}
}
.bubble-wrap.fade-in {
@include animation(scaleIn 0.4s ease-in-out);
@include transform-origin(0 50% 0);
}
.bubble-wrap {
width: 300px;
margin: 20px auto;
}
.bubble {
position: relative;
padding: 20px;
background: #FFFFFF;
border-radius: 4px;
border: #7F7F7F solid 1px;
font-size: 1em;
line-height: 1.25em;
}
.bubble.left:after {
content: '';
position: absolute;
border-style: solid;
border-width: 16px 16px 16px 0;
border-color: transparent #FFFFFF;
display: block;
width: 0;
z-index: 1;
left: -15px;
top: 50%;
margin-top: -16px
}
.bubble.left:before {
content: '';
position: absolute;
border-style: solid;
border-width: 16px 16px 16px 0;
border-color: transparent #7F7F7F;
display: block;
width: 0;
z-index: 0;
left: -16px;
top: 50%;
margin-top: -16px;
}
.bubble.right:after {
content: '';
position: absolute;
border-style: solid;
border-width: 16px 0 16px 16px;
border-color: transparent #FFFFFF;
display: block;
width: 0;
z-index: 1;
right: -16px;
top: 50%;
margin-top: -16px;
}
.bubble.right:before {
content: '';
position: absolute;
border-style: solid;
border-width: 16px 0 16px 16px;
border-color: transparent #7F7F7F;
display: block;
width: 0;
z-index: 0;
right: -16px;
top: 50%;
margin-top: -16px;
}
View Compiled
$('button').click(function(){
var bubbles = $('.bubble-wrap').addClass('fade-in');
});
This Pen doesn't use any external CSS resources.