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

Kinyíló keret

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

Élő előnézet
HTML · CSS · JS
HTML
<button class="we-btn-frame" type="button">
    <span class="we-btn-frame-corner top-left"></span>
    <span class="we-btn-frame-corner top-right"></span>
    <span class="we-btn-frame-corner bottom-left"></span>
    <span class="we-btn-frame-corner bottom-right"></span>

    <span class="we-btn-frame-text">Felfedezem</span>
    <span class="we-btn-frame-arrow">→</span>
</button>
CSS
.we-btn-frame {
    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,.14);
    border-radius: 10px;

    background: #101713;
    color: #f1f3ee;

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

    cursor: pointer;
    overflow: hidden;

    transition:
        transform .7s cubic-bezier(.22,1,.36,1),
        border-radius .7s ease,
        box-shadow .7s ease;
}

/* sarokvonalak */

.we-btn-frame-corner {
    position: absolute;

    width: 20px;
    height: 20px;

    pointer-events: none;

    transition:
        width .9s cubic-bezier(.22,1,.36,1),
        height .9s cubic-bezier(.22,1,.36,1);
}

/* felső bal */

.we-btn-frame-corner.top-left {
    top: 7px;
    left: 7px;

    border-top: 2px solid #3f9f63;
    border-left: 2px solid #3f9f63;
}

/* felső jobb */

.we-btn-frame-corner.top-right {
    top: 7px;
    right: 7px;

    border-top: 2px solid #3f9f63;
    border-right: 2px solid #3f9f63;
}

/* alsó bal */

.we-btn-frame-corner.bottom-left {
    bottom: 7px;
    left: 7px;

    border-bottom: 2px solid #3f9f63;
    border-left: 2px solid #3f9f63;
}

/* alsó jobb */

.we-btn-frame-corner.bottom-right {
    bottom: 7px;
    right: 7px;

    border-bottom: 2px solid #3f9f63;
    border-right: 2px solid #3f9f63;
}

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

    transition:
        transform .8s cubic-bezier(.22,1,.36,1),
        color .6s ease;
}

.we-btn-frame-arrow {
    font-size: 20px;
    line-height: 1;
}

/* hover */

.we-btn-frame:hover {
    transform:
        translateY(-4px);

    border-radius: 16px;

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

.we-btn-frame:hover .we-btn-frame-corner {
    width: calc(100% - 14px);
    height: calc(100% - 14px);
}

.we-btn-frame:hover .we-btn-frame-text {
    transform:
        translateX(-3px);

    color: #9bd5a9;
}

.we-btn-frame:hover .we-btn-frame-arrow {
    transform:
        translateX(8px)
        scale(1.12);

    color: #5fbd7d;
}

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