پیشنمایش زنده
کد HTML
<div class="noise-container">
<div class="gradient-layer gradient-1"></div>
<div class="gradient-layer gradient-2"></div>
<div class="gradient-layer gradient-3"></div>
<div class="top-strip"></div>
<div class="noise-overlay"></div>
<div class="content-wrapper">
<button class="publish-btn">Start publishing →</button>
</div>
</div>
کد CSS
.noise-container {
position: relative;
overflow: hidden;
border-radius: 9999px;
padding: 10px;
width: fit-content;
background-color: #171717;
box-shadow:
inset 0px 1px 0px 0px #0a0a0a,
0px 1px 0px 0px #262626;
font-family:
system-ui,
-apple-system,
sans-serif;
}
.top-strip {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
border-top-left-radius: 9999px;
border-top-right-radius: 9999px;
opacity: 0.8;
filter: blur(2px);
background: linear-gradient(
to right,
rgb(255, 100, 150),
rgb(100, 150, 255),
rgb(255, 200, 100)
);
background-size: 200% 100%;
animation: slideStrip 4s ease-in-out infinite alternate;
}
.gradient-layer {
position: absolute;
width: 200%;
height: 200%;
top: -50%;
left: -50%;
opacity: 0.4;
pointer-events: none;
}
.gradient-1 {
background: radial-gradient(
circle at center,
rgb(255, 100, 150) 0%,
transparent 40%
);
animation: float1 8s ease-in-out infinite;
}
.gradient-2 {
background: radial-gradient(
circle at center,
rgb(100, 150, 255) 0%,
transparent 40%
);
animation: float2 11s ease-in-out infinite;
opacity: 0.3;
}
.gradient-3 {
background: radial-gradient(
circle at center,
rgb(255, 200, 100) 0%,
transparent 40%
);
animation: float3 14s ease-in-out infinite;
opacity: 0.25;
}
.noise-overlay {
position: absolute;
inset: 0;
pointer-events: none;
background-image: url("s://assets.aceternity.com/noise.webp");
background-size: cover;
opacity: 0.2;
mix-blend-mode: overlay;
}
.content-wrapper {
position: relative;
z-index: 10;
}
.publish-btn {
cursor: pointer;
border-radius: 9999px;
border: none;
background: linear-gradient(to right, #000000, #000000, #171717);
color: white;
padding: 16px 32px;
font-size: 1.125rem;
font-weight: 500;
box-shadow:
inset 0px 1px 0px 0px #0a0a0a,
0px 1px 0px 0px #262626;
transition: all 0.1s ease-in-out;
display: flex;
align-items: center;
gap: 8px;
}
.publish-btn:active {
transform: scale(0.98);
}
@keyframes slideStrip {
0% {
background-position: 0% 0;
}
100% {
background-position: 100% 0;
}
}
@keyframes float1 {
0% {
transform: translate(0, 0);
}
33% {
transform: translate(15%, 10%);
}
66% {
transform: translate(-10%, 15%);
}
100% {
transform: translate(0, 0);
}
}
@keyframes float2 {
0% {
transform: translate(0, 0);
}
33% {
transform: translate(-15%, -15%);
}
66% {
transform: translate(20%, -5%);
}
100% {
transform: translate(0, 0);
}
}
@keyframes float3 {
0% {
transform: translate(0, 0);
}
33% {
transform: translate(10%, -20%);
}
66% {
transform: translate(-20%, 10%);
}
100% {
transform: translate(0, 0);
}
}