JSFiddle - React, Tailwind, and code Playground
by Kocsten
HTML
<a href="#" class="btn">
<span>Перейти к событию</span>
<div class="icon"><b class="fontawesome-arrow-right" aria-hidden="true"></b></div>
</a>
<a href="#" class="btn btn-remove">
<span>Удалить</span>
<div class="icon"><b class="fontawesome-remove" aria-hidden="true"></b></div>
</a>
CSS
@import url(http://weloveiconfonts.com/api/?family=fontawesome);
/* fontawesome */
[class*="fontawesome-"]:before {
font-family: 'FontAwesome', sans-serif;
}
body {
background-color: #009CD0;
height: 100vh;
text-align: center;
}
.btn {
position: relative;
top: 50%;
transform: translateY(-50%);
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
margin: 0 8px;
}
.btn {
border-radius: 4px;
border: 2px solid #fff;
color: #fff;
display: inline-block;
overflow: hidden;
padding: 24px 60px 24px 16px;
position: relative;
text-decoration: none;
line-height: 1;
}
.btn span {
font-size: 1em;
padding: 0 26px;
position: relative;
right: 0;
transition: right 300ms ease;
}
.btn .icon {
border-left: 1px solid rgba(255, 255, 255, 0.3);
bottom: 10px;
display: inline-block;
line-height: 42px;
position: absolute;
right: 0;
text-align: center;
top: 10px;
transition: all 300ms ease;
width: 58px;
}
.btn:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
background-color: #fff;
opacity: 0;
transition: opacity 300ms ease;
}
.btn:hover span {
right: 100%;
}
.btn:hover .icon {
border-left: 0;
font-size: 1.8em;
width: 100%;
}
.btn:hover:after {
opacity: .2;
}