Vissza az animációkhoz
Szöveganimációk

Forgó tengelyből kibomló

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

Élő előnézet
HTML · CSS · JS
HTML
<div class="we-text-rotate-card">
    <h2 class="we-text-rotate">
        <span>Fedezd</span>
        <span>fel</span>
        <span>az</span>
        <span>ismeretlent</span>
    </h2>
</div>
CSS
.we-text-rotate-card {
    display: inline-block;

    padding: 32px 42px;

    background: #f4f1e9;

    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 18px;

    box-shadow:
        0 18px 45px rgba(0, 0, 0, .22);

    overflow: hidden;

    perspective: 900px;
}

.we-text-rotate {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .3em;

    margin: 0;

    color: #111111;

    font-family: "Bodoni Moda", Georgia, serif;
    font-size: clamp(34px, 5.5vw, 68px);
    font-weight: 500;
    line-height: 1.08;
}

.we-text-rotate span {
    display: inline-block;

    opacity: 0;

    transform:
        rotateX(-85deg)
        translateY(45px);

    transform-origin: center bottom;

    animation:
        weTextRotate 1.15s
        cubic-bezier(.22,1,.36,1)
        forwards;
}

.we-text-rotate span:nth-child(1) {
    animation-delay: .1s;
}

.we-text-rotate span:nth-child(2) {
    animation-delay: .28s;
}

.we-text-rotate span:nth-child(3) {
    animation-delay: .46s;
}

.we-text-rotate span:nth-child(4) {
    animation-delay: .64s;
}

@keyframes weTextRotate {
    0% {
        opacity: 0;

        transform:
            rotateX(-85deg)
            translateY(45px);
    }

    55% {
        opacity: 1;
    }

    100% {
        opacity: 1;

        transform:
            rotateX(0deg)
            translateY(0);
    }
}
JavaScript
Ehhez az animációhoz nincs külön JavaScript.