Neon Gradient Border Generator

Create modern neon gradient borders with customizable colors, glow effects, and smooth animations. Perfect for adding a modern, cyberpunk aesthetic to your web elements.

Preview Content
/* First, define the rotating property */
@property --rotate {
  syntax: "<angle>";
  initial-value: 132deg;
  inherits: false;
}

/* Main container */
.neon-card {
  width: 300px;
  height: 400px;
  padding: 3px;
  position: relative;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.5em;
  cursor: pointer;
}

/* Gradient border */
.neon-card::before {
  content: "";
  width: 104%;
  height: 102%;
  border-radius: 8px;
  background-image: linear-gradient(
    var(--rotate),
    #ff00ff,
    #00ffff 43%,
    #ff00ff
  );
  position: absolute;
  z-index: -1;
  top: -1%;
  left: -2%;
  animation: spin 2.5s linear infinite;
}

/* Glow effect */
.neon-card::after {
  position: absolute;
  content: "";
  top: calc(var(--card-height) / -10);
  left: -28px;
  right: 0;
  z-index: -1;
  height: 120%;
  width: 120%;
  margin: 0 auto;
  transform: scale(0.8);
  filter: blur(25px);
  background-image: linear-gradient(
    var(--rotate),
    #ff00ff,
    #00ffff 43%,
    #ff00ff
  );
  opacity: 1;
  transition: opacity .5s;
  animation: spin 2.5s linear infinite;
}

/* Content area */
.neon-card-content {
  background: #28251e;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* Animation */
@keyframes spin {
  0% {
    --rotate: 0deg;
  }
  100% {
    --rotate: 360deg;
  }
}

How to Use

1. Choose Colors: Pick two colors for your gradient border using the color pickers, or select from our preset combinations.

2. Adjust Effects: Fine-tune the glow size to control the neon effect's intensity and spread.

3. Customize Shape: Set the border radius to create anything from sharp corners to fully rounded edges.

4. Size Control: Adjust the card height to match your design needs.

5. Get Code: Copy the generated code in your preferred format (CSS, HTML, or Tailwind) and use it in your project.

Features & Tips

Smooth Animation: The gradient automatically rotates for a dynamic effect. You can adjust the animation speed by modifying the CSS.

Responsive Design: The generated code is responsive and works across different screen sizes.

Browser Support: Uses modern CSS features like @property for smooth animations. For older browsers, the border will still show but without rotation.

Performance: The glow effect uses CSS filters and transforms for optimal performance.

Customization: Feel free to modify the generated code to match your specific needs, like changing animation duration or adding hover effects.