.
Purple Neon Star Enhanced by Coodeverse is a free multi-layer neon star animation built with pure HTML, CSS3, and vanilla JavaScript. It features 44 total spikes across 4 counter-rotating layers, a pulsating central glowing core, an ambient radial glow, and 30 randomly floating particles — all using CSS keyframe animations and box-shadow neon glow effects. Zero external libraries. Full source code free at coodeverse.com/projects/purple-neon-star-enhanced.
Spikes:44 total (4 layers)
·
💫Particles:30 floating
·
🎞️Animations:6 keyframes
·
JS Lines:~55
·
📦Libraries:Zero
·
🔄Loop:Infinite
Live Preview
Full Source Code
// index.html — Purple Neon Star Enhanced
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Purple Neon Star - Enhanced</title>
    <link rel="stylesheet" href="style.css" />
</head>
<body>
    <div class="star-container">
        <div class="ambient-glow"></div>
        <div class="center-core"></div>

        <!-- Layer 1 - 12 main spikes (clockwise) -->
        <div class="star-layer rotating-cw" id="layer1"></div>

        <!-- Layer 2 - 12 intermediate spikes (counter-clockwise) -->
        <div class="star-layer rotating-ccw" id="layer2"></div>

        <!-- Layer 3 - 12 smaller spikes (slow clockwise) -->
        <div class="star-layer rotating-slow" id="layer3"></div>

        <!-- Layer 4 - 8 accent spikes (fast clockwise) -->
        <div class="star-layer rotating-cw" id="layer4" style="animation-duration: 15s;"></div>

        <!-- Particles container -->
        <div id="particles"></div>
    </div>
    <script src="script.js"></script>
</body>
</html>

CSS Techniques Used

Every CSS technique powering the Purple Neon Star Enhanced animation.

@keyframes rotateCW / rotateCCW
Rotates entire spike layers clockwise or counter-clockwise. Four layers rotate at different speeds (15s, 20s, 25s, 30s) creating complex orbital patterns.
animation: rotateCW 20s linear infinite;
box-shadow Neon Layers
Each spike uses 3 outer box-shadow layers with decreasing opacity to simulate a real neon tube glow radiating outward from the spike core.
0 0 15px rgba(168,85,247,.8), 0 0 30px rgba(124,58,237,.6)
CSS Custom Properties (--index)
Each spike element uses a --index CSS variable to stagger its animation-delay, creating a wave-like cascade effect across all 44 spikes on page load.
animation-delay: calc(var(--index) * 0.1s);
Pseudo-elements ::before / ::after
::before holds the main neon gradient and glow shadow. ::after creates the bright white core line down the center of each spike using a white linear-gradient with blur.
.spike::before { ... } .spike::after { filter: blur(1px); }
CSS Custom Properties for Particles
Each particle has unique --float-x and --float-y values set via JavaScript. The @keyframes float animation uses these to give every particle a different drift direction.
transform: translate(var(--float-x), var(--float-y));
filter: blur() Ambient Glow
The .ambient-glow element uses filter: blur(40px) on a large radial-gradient circle to create a soft diffused light effect behind the entire star — like a nebula haze.
.ambient-glow { filter: blur(40px); }
// neon_star_faq

Purple Neon Star — FAQ

How the animation works and what it teaches.

Built with pure HTML, CSS3, and vanilla JavaScript — no external libraries. CSS keyframe animations handle all rotation, glow pulsing, core pulsing, and particle floating. JavaScript creates 44 spike elements across 4 layers and 30 particle elements dynamically using DOM manipulation. CSS custom properties (--index, --float-x, --float-y) control staggered timing and unique particle paths.

The neon glow uses layered box-shadow (3 outer glow rings at 15px, 30px, 45px radius with decreasing opacity), linear-gradient for the spike color fading from transparent at tips to bright purple at center, and a ::after pseudo-element with a white gradient and blur(1px) to create the bright core line. The ambient glow uses filter: blur(40px) on a large radial-gradient circle.

JavaScript runs inside DOMContentLoaded and uses for loops and createElement to make spike divs. Each spike gets a CSS transform with rotate() to position it around the center, translateY(-120px) to push it outward, and an animationDelay based on its index. Layer 4 spikes are also narrower (4px). All 30 particles get random positions calculated with Math.cos/sin and random --float-x/y CSS custom properties.

Yes. The animation runs in a self-contained HTML/CSS/JS file and works as a full-screen background, loading screen, hero section visual, or decorative element. The star container centers itself on screen using flexbox. You can modify the colors, number of spikes, rotation speeds, and particle count to customize it for any project.

Yes. Click Download Project at the top of this page to download the full HTML, CSS, and JavaScript as a ZIP file — completely free. No account or sign-up required. Coodeverse provides 540+ free downloadable coding projects.

Coodeverse offers 540+ free HTML/CSS/JavaScript projects including Cosmos Star Animation, Particle Fireworks, Holographic Login, Neon Toggle Switch, Catch the Star arcade game, and many more. All free to download, no account needed. Browse at coodeverse.com/projects.

Master CSS Animations.
Build Visual Magic.

Free courses in JavaScript, Python, SQL, Kotlin, HTML, CSS, DSA. No account needed.

Star Rating JSRGB Color GameFB Login CloneDominoes Game • style="color:inherit;">PEAK Fitness • AETHER PageEpic Delete • style="color:inherit;">Neon Toggle • All ProjectsHTML & CSS CourseCSS CourseJS CourseAll Courses
Learn CSS Free Browse All Projects