<div class="box">
<h1>Hi.</h1>
</div>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: #234;
}
.box {
position: relative;
background: orange;
width: 150px;
height: 150px;
margin: 150px auto;
transition: .2s linear;
-webkit-clip-path: polygon(12% 12%, 70% 10%, 68% 45%, 44% 44%, 48% 61%, 30% 44%, 7% 45%);
}
.box:hover {
-webkit-clip-path: polygon(5% 5%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);
background: black;
color: orange;
}
h1 {
position: absolute;
display: inline-block;
top: 32px;
left: 40px;
font-size: 1.2em;
transition: all .2s linear;
}
.box:hover h1 {
top: 38px;
left: 50px;
font-size: 2em;
}
$('.box').on('mouseenter', function() {
$(this).find('h1').text('Bye.');
})
$('.box').on('mouseleave', function() {
$(this).find('h1').text('Hi.');
})
This Pen doesn't use any external CSS resources.