پیشنمایش زنده
کد HTML
<div class="loader-container">
<div class="glass-wrapper">
<div class="glass-card"></div>
</div>
</div>
کد CSS
/* Main overall container */
.loader-container {
width: 150px;
height: 180px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
/* Container for the glass card and moving blobs */
.glass-wrapper {
width: 100px;
height: 100px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
/* Crucial: Hides blobs when they move outside this box */
overflow: hidden;
border-radius: 25px; /* Squircle design */
}
/* The Glassy Card on top */
.glass-card {
width: 90px;
height: 90px;
background: rgba(255, 255, 255, 0.05); /* Slight white tint */
border-radius: 20px;
backdrop-filter: blur(10px); /* The blurring magic */
-webkit-backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow:
0 8px 32px 0 rgba(0, 0, 0, 0.3),
inset 0 0 15px rgba(255, 255, 255, 0.05);
z-index: 2; /* Sits on top of blobs */
position: relative;
}
/* Shared styling for both colorful blobs (behind glass) */
.glass-wrapper::before,
.glass-wrapper::after {
content: "";
position: absolute;
width: 70px;
height: 70px;
border-radius: 50%;
filter: blur(10px); /* Extra soft edges */
opacity: 0.8;
z-index: 1; /* Sits behind the glass-card */
}
/* Blob 1: Neon Blue */
.glass-wrapper::before {
background: #00d2ff;
background: linear-gradient(to right, #3a7bd5, #00d2ff);
top: -15px;
left: -15px;
animation: blob-one-move 3s infinite ease-in-out;
}
/* Blob 2: Neon Purple/Pink */
.glass-wrapper::after {
background: #ff00cc;
background: linear-gradient(to right, #3333ff, #ff00cc);
bottom: -15px;
right: -15px;
animation: blob-two-move 3s infinite ease-in-out;
}
/* Optional text below loader */
.loading-text {
margin-top: 15px;
color: #fff;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
font-size: 14px;
letter-spacing: 2px;
font-weight: 300;
animation: text-pulse 1.5s infinite;
opacity: 0.7;
}
/* Animation: Moves blue blob chaotically */
@keyframes blob-one-move {
0%,
100% {
transform: translate(0, 0) scale(1);
}
25% {
transform: translate(40px, 15px) scale(1.1);
}
50% {
transform: translate(20px, 45px) scale(1);
}
75% {
transform: translate(-15px, 25px) scale(0.9);
}
}
/* Animation: Moves pink blob chaotically (opposite pattern) */
@keyframes blob-two-move {
0%,
100% {
transform: translate(0, 0) scale(1);
}
25% {
transform: translate(-40px, -15px) scale(1.1);
}
50% {
transform: translate(-20px, -45px) scale(1);
}
75% {
transform: translate(15px, -25px) scale(0.9);
}
}
/* Animation: Optional text pulse */
@keyframes text-pulse {
0%,
100% {
opacity: 0.5;
}
50% {
opacity: 1;
}
}