Vissza az animációkhoz
Hover effektek

Digitális pásztázás

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

Élő előnézet
HTML · CSS · JS
HTML
<div class="we-hover-scan">

    <div class="we-scan-line"></div>
    <div class="we-scan-glow"></div>

    <div class="we-scan-content">

        <span>WebElements</span>

        <strong>
            Digitális pásztázás
        </strong>

        <small>
            Mozgasd fölötte az egeret
        </small>

    </div>

</div>
CSS
.we-hover-scan {
    width: 100%;
    max-width: 440px;
    height: 190px;
    margin: 60px auto;

    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;

    padding: 40px;
    box-sizing: border-box;

    background:
        linear-gradient(
            135deg,
            #080d11,
            #10191c
        );

    border: 1px solid rgba(142,232,212,.22);
    border-radius: 18px;

    color: #f2f4f0;
    font-family: Arial, sans-serif;

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


/* FINOM RÁCS */

.we-hover-scan::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            rgba(142,232,212,.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(142,232,212,.035) 1px,
            transparent 1px
        );

    background-size: 24px 24px;

    opacity: 0;

    transition: opacity .4s ease;

    pointer-events: none;
}


/* PÁSZTÁZÓ VONAL */

.we-scan-line {
    position: absolute;

    z-index: 3;

    top: 0;
    left: -5%;

    width: 2px;
    height: 100%;

    background: #8ee8d4;

    box-shadow:
        0 0 8px rgba(142,232,212,1),
        0 0 25px rgba(142,232,212,.9),
        0 0 55px rgba(142,232,212,.45);

    opacity: 0;
}


/* VONAL KÖRÜLI FÉNY */

.we-scan-glow {
    position: absolute;

    z-index: 2;

    top: 0;
    left: -20%;

    width: 20%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(142,232,212,.12),
            rgba(142,232,212,.03),
            transparent
        );

    filter: blur(5px);

    opacity: 0;
}


/* TARTALOM */

.we-scan-content {
    position: relative;
    z-index: 4;

    transition:
        transform .45s ease,
        filter .45s ease;
}

.we-scan-content span {
    display: block;

    margin-bottom: 12px;

    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;

    color: #8ee8d4;
}

.we-scan-content strong {
    display: block;

    font-size: 27px;
    font-weight: 500;
}

.we-scan-content small {
    display: block;

    margin-top: 10px;

    font-size: 13px;
    color: rgba(242,244,240,.62);
}


/* HOVER */

.we-hover-scan:hover {

    transform: translateY(-6px);

    border-color:
        rgba(142,232,212,.65);

    box-shadow:
        0 22px 50px rgba(0,0,0,.5),
        0 0 30px rgba(142,232,212,.10);
}


.we-hover-scan:hover::before {
    opacity: 1;
}


.we-hover-scan:hover .we-scan-line {

    opacity: 1;

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


.we-hover-scan:hover .we-scan-glow {

    opacity: 1;

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


.we-hover-scan:hover .we-scan-content {

    transform: translateX(5px);

    filter:
        drop-shadow(
            0 0 8px rgba(142,232,212,.15)
        );
}


/* PÁSZTÁZÁS */

@keyframes scanLine {

    0% {
        left: -5%;
    }

    100% {
        left: 105%;
    }

}


@keyframes scanGlow {

    0% {
        left: -20%;
    }

    100% {
        left: 105%;
    }

}
JavaScript
Ehhez az animációhoz nincs külön JavaScript.