Xila of Dev biznet
8/11/2019 - 4:04 PM

Bouton animation hover 2

<a class="btn">
      <span class="text">Voir mes projets</span>
      <span class="line -right"></span>
      <span class="line -top"></span>
      <span class="line -left"></span>
      <span class="line -bottom"></span>
</a>
.btn {
    color: black;
    padding: 0.7em calc(0.7em * 1.2);
    display: inline-block;
    border: 3px solid transparent;
    position: relative;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 20px;
}

.btn .text {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    transform: translate3d(0, 0.7em, 0);
    display: block;
    transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1) 0.4s;
}
.btn:after {
    position: absolute;
    content: '';
    bottom: -3px;
    left: calc(0.7em * 1.2);
    right: calc(0.7em * 1.2);
    height: 3px;
    background: #ff8500;
    transition: transform 0.8s cubic-bezier(1, 0, 0.37, 1) 0.2s, right 0.2s cubic-bezier(0.04, 0.48, 0, 1) 0.6s, left 0.4s cubic-bezier(0.04, 0.48, 0, 1) 0.6s;
    transform-origin: left;
}
.btn .line {
    position: absolute;
    background: #ff8500;
}
.btn .line.-right, .btn .line.-left {
    width: 3px;
    bottom: -3px;
    top: -3px;
    transform: scale3d(1, 0, 1);
}
.btn .line.-top, .btn .line.-bottom {
    height: 3px;
    left: -3px;
    right: -3px;
    transform: scale3d(0, 1, 1);
}
.btn .line.-right {
    right: -3px;
    transition: transform 0.1s cubic-bezier(1, 0, 0.65, 1.01) 0.23s;
    transform-origin: top;
}
.btn .line.-top {
    top: -3px;
    transition: transform 0.08s linear 0.43s;
    transform-origin: left;
}
.btn .line.-left {
    left: -3px;
    transition: transform 0.08s linear 0.51s;
    transform-origin: bottom;
}
.btn .line.-bottom {
    bottom: -3px;
    transition: transform 0.3s cubic-bezier(1, 0, 0.65, 1.01);
    transform-origin: right;
}
.btn:hover .text,
.btn:active .text {
    transform: translate3d(0, 0, 0);
    transition: transform 0.6s cubic-bezier(0.2, 0, 0, 1) 0.4s;
}
.btn:hover:after,
.btn:active:after {
    transform: scale3d(0, 1, 1);
    right: -3px;
    left: -3px;
    transform-origin: right;
    transition: transform 0.2s cubic-bezier(1, 0, 0.65, 1.01) 0.17s, right 0.2s cubic-bezier(1, 0, 0.65, 1.01), left 0s 0.3s;
}
.btn:hover .line,
.btn:active .line {
    transform: scale3d(1, 1, 1);
}
.btn:hover .line.-right,
.btn:active .line.-right {
    transition: transform 0.1s cubic-bezier(1, 0, 0.65, 1.01) 0.2s;
    transform-origin: bottom;
}
.btn:hover .line.-top,
.btn:active .line.-top {
    transition: transform 0.08s linear 0.4s;
    transform-origin: right;
}
.btn:hover .line.-left,
.btn:active .line.-left {
    transition: transform 0.08s linear 0.48s;
    transform-origin: top;
}
.btn:hover .line.-bottom,
.btn:active .line.-bottom {
    transition: transform 0.5s cubic-bezier(0, 0.53, 0.29, 1) 0.56s;
    transform-origin: left;
}