Vissza az animációkhoz
Gombanimációk

Rugózó gomb

Élő előnézet – az animáció teljes méretben.

Élő előnézet
HTML · CSS · JS
HTML
<button class="we-btn-spring" type="button">
    <span class="we-btn-spring-text">Felfedezem</span>
    <span class="we-btn-spring-arrow">→</span>
</button>
CSS
.we-btn-spring {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;

    min-width: 180px;
    height: 54px;

    padding: 0 26px;

    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;

    background: #10191c;
    color: #f2f4f0;

    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .4px;

    cursor: pointer;
    overflow: hidden;

    transition:
        transform .65s cubic-bezier(.34,1.56,.64,1),
        border-radius .45s ease,
        border-color .4s ease,
        box-shadow .5s ease;
}

.we-btn-spring::before {
    content: "";

    position: absolute;
    inset: 0;

    background: #8ee8d4;

    border-radius: inherit;

    transform: scaleX(0);
    transform-origin: center;

    transition:
        transform .55s cubic-bezier(.34,1.56,.64,1);
}

.we-btn-spring-text,
.we-btn-spring-arrow {
    position: relative;
    z-index: 2;

    transition:
        transform .6s cubic-bezier(.34,1.56,.64,1),
        color .3s ease;
}

.we-btn-spring-arrow {
    font-size: 20px;
}

.we-btn-spring:hover {
    transform:
        translateY(-4px)
        scale(1.035);

    border-radius: 20px;
    border-color: #8ee8d4;

    box-shadow:
        0 20px 42px rgba(0,0,0,.4);
}

.we-btn-spring:hover::before {
    transform: scaleX(1);
}

.we-btn-spring:hover .we-btn-spring-text {
    color: #081012;

    transform:
        translateX(-4px)
        scale(1.02);
}

.we-btn-spring:hover .we-btn-spring-arrow {
    color: #081012;

    transform:
        translateX(9px)
        scale(1.2);
}

.we-btn-spring:active {
    transform:
        translateY(-1px)
        scale(.94);
}
JavaScript
Ehhez az animációhoz nincs külön JavaScript.