JSFiddle - React, Tailwind, and code Playground
by Thasmo
HTML
<a class="avatar" href="http://thasmo.com/" target="_blank">
<span class="avatar__photo"></span>
</a>
SCSS
*, *:after, *:before {
box-sizing: border-box;
}
.avatar {
position: relative;
overflow: hidden;
display: block;
width: 256px;
height: 256px;
border-radius: 100%;
outline: 1px solid transparent;
transition: all 250ms;
&:hover {
transform: rotate(-5deg);
.avatar__photo {
box-shadow: 0 0 25px rgba(0, 0, 0, .1);
}
.avatar__photo:after {
filter: blur(5px);
transform: rotate(360deg) scale(1.25);
}
}
}
.avatar__photo {
position: relative;
top: 28px;
left: 28px;
display: block;
width: 200px;
height: 200px;
background-image: url('http://www.gravatar.com/avatar/39263d15a3b0838a938aaaa59dde5c06.png?s=256');
background-size: 256px 256px;
background-position: center;
background-repeat: no-repeat;
border-radius: 100%;
&:after {
content: '';
position: absolute;
left: -28px;
top: -28px;
z-index: -2;
overflow: hidden;
display: block;
width: 256px;
height: 256px;
background-image: url('http://www.gravatar.com/avatar/39263d15a3b0838a938aaaa59dde5c06.png?s=256');
background-size: 256px 256px;
background-position: center;
background-repeat: no-repeat;
border-radius: 100%;
filter: blur(0);
transition: all 250ms;
}
}