Pens

Gradient Animated Border Pill Header

UI Component bởi acmatvjrus
Mở Studio
<div class="pill-preview-wrapper">
  <div class="glow-container">
    <header class="gradient-pill-header">
      <div class="pill-logo">
        <span class="sparkle">✧</span>
        <span>Lumina<strong>UI</strong></span>
      </div>
      <nav class="pill-nav">
        <a href="#" class="pill-link active">Khám phá</a>
        <a href="#" class="pill-link">Tài nguyên</a>
        <a href="#" class="pill-link">Cộng đồng</a>
        <a href="#" class="pill-link">Showcase</a>
      </nav>
      <div class="pill-cta">
        <button class="join-btn">Gia nhập Discord</button>
      </div>
    </header>
  </div>
</div>
body {
  margin: 0;
  min-height: 100vh;
  background: #0b0f19;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
}
.pill-preview-wrapper {
  padding: 30px 20px;
  display: flex;
  justify-content: center;
}
.glow-container {
  position: relative;
  border-radius: 9999px;
  padding: 2px;
  background: conic-gradient(from var(--angle, 0deg), #10a37a, #06b6d4, #8b5cf6, #ec4899, #10a37a);
  animation: rotateBorder 4s linear infinite;
  box-shadow: 0 10px 30px -10px rgba(16, 163, 122, 0.4);
}
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotateBorder {
  to { --angle: 360deg; }
}
.gradient-pill-header {
  background: #0f172a;
  border-radius: 9999px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 36px;
}
.pill-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
}
.sparkle { color: #10a37a; font-size: 1.3rem; }
.pill-logo strong { color: #38bdf8; }
.pill-nav {
  display: flex;
  gap: 8px;
}
.pill-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 9999px;
  transition: all 0.2s;
}
.pill-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.pill-link.active {
  color: #fff;
  background: rgba(16, 163, 122, 0.25);
}
.join-btn {
  background: linear-gradient(135deg, #10a37a, #06b6d4);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.join-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}
@media (max-width: 768px) {
  .pill-nav { display: none; }
}
// Gradient Animation Helper
console.log("Conic angle animation running");
Đã sao chép vào bộ nhớ tạm!