Hover effektek
Fényudvar
Élő előnézet – az animáció teljes méretben.
Élő előnézet
HTML · CSS · JS
<div class="we-hover-halo">
<div class="we-halo-border"></div>
<div class="we-halo-light"></div>
<div class="we-halo-content">
<span>WebElements</span>
<strong>Fényudvar</strong>
<small>
Lebegő fény és dinamikus keret
</small>
</div>
</div>
.we-hover-halo {
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:
radial-gradient(
circle at 50% 50%,
rgba(142,232,212,.035),
transparent 60%
),
#090f12;
border: 1px solid rgba(142,232,212,.18);
border-radius: 20px;
color: #f2f4f0;
font-family: Arial, sans-serif;
transition:
transform .5s cubic-bezier(.22,1,.36,1),
box-shadow .6s ease,
border-color .5s ease;
}
.we-halo-border {
position: absolute;
inset: 0;
border-radius: 20px;
background:
conic-gradient(
from 0deg,
transparent 0deg,
transparent 290deg,
rgba(142,232,212,.9) 315deg,
rgba(255,255,255,.7) 330deg,
transparent 350deg,
transparent 360deg
);
opacity: 0;
transition:
opacity .4s ease;
animation:
haloRotate 4s linear infinite paused;
pointer-events: none;
}
.we-halo-border::after {
content: "";
position: absolute;
inset: 1px;
border-radius: 19px;
background: #090f12;
}
.we-halo-light {
position: absolute;
left: 50%;
top: 50%;
width: 180px;
height: 180px;
transform:
translate(-50%, -50%)
scale(.5);
border-radius: 50%;
background:
radial-gradient(
circle,
rgba(142,232,212,.18),
rgba(142,232,212,.05) 35%,
transparent 70%
);
filter: blur(12px);
opacity: 0;
transition:
opacity .6s ease,
transform .7s cubic-bezier(.22,1,.36,1);
}
.we-halo-content {
position: relative;
z-index: 5;
transition:
transform .6s cubic-bezier(.22,1,.36,1),
filter .6s ease;
}
.we-halo-content span {
display: block;
margin-bottom: 12px;
font-size: 11px;
letter-spacing: 4px;
text-transform: uppercase;
color: #8ee8d4;
}
.we-halo-content strong {
display: block;
font-size: 27px;
font-weight: 500;
}
.we-halo-content small {
display: block;
margin-top: 10px;
font-size: 13px;
color: rgba(242,244,240,.62);
}
.we-hover-halo:hover {
transform:
translateY(-7px);
border-color:
rgba(142,232,212,.5);
box-shadow:
0 30px 70px rgba(0,0,0,.55),
0 0 55px rgba(142,232,212,.12);
}
.we-hover-halo:hover .we-halo-border {
opacity: 1;
animation-play-state: running;
}
.we-hover-halo:hover .we-halo-light {
opacity: 1;
transform:
translate(-50%, -50%)
scale(1.35);
}
.we-hover-halo:hover .we-halo-content {
transform:
translateY(-4px)
scale(1.015);
filter:
drop-shadow(
0 0 12px rgba(142,232,212,.18)
);
}
@keyframes haloRotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
Ehhez az animációhoz nincs külön JavaScript.