<div class="button-wrapper">
<div class="button">CLICK</div>
</div>
@import url('https://fonts.googleapis.com/css?family=Roboto+Mono:300,400,500');
html,body {
margin: 0;
padding: 0;
}
body {
background-color: rgba(255,209,57,0.5);
}
.button-wrapper {
position: absolute;
width: 120px;
height: 40px;
top: 50%;
left: 50%;
transform: translate(-50%);
.button {
font-family: Roboto Mono;
letter-spacing: 0.4em;
position: absolute;
border: none;
outline: none;
width: 120px;
height: 40px;
background-color: #FFD139;
text-align: center;
line-height: 40px;
cursor: pointer;
color: white;
user-select: none;
&:before {
content: '';
position: absolute;
width: 40px;
height: 10px;
left: -25px;
bottom: 10px;
background-color: #F9DD8F;
transform: rotate(90deg) skew(45deg);
}
&:after {
content: '';
position: absolute;
width: 120px;
height: 10px;
bottom: -10px;
left: -5px;
background-color: #E2B537;
transform: skew(-45deg) rotate(0deg);
}
&.clicked {
left: -5px;
bottom: -5px;
&:before {
height: 5px;
left: -22px;
bottom: 15px;
}
&:after {
height: 5px;
bottom: -5px;
left: -2px;
}
}
}
}
View Compiled
$('.button').on('mousedown',function() {
$(this).addClass('clicked');
});
$('.button').on('mouseup',function() {
$(this).removeClass('clicked');
});
This Pen doesn't use any external CSS resources.