.
Skip to live previewA mesmerizing multi-layer neon star animation built with pure HTML, CSS, and vanilla JavaScript. Four counter-rotating spike layers, pulsating glowing core, ambient blur glow, and 30 floating particles — all using CSS keyframes and zero external libraries.
<!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>
Every CSS technique powering the Purple Neon Star Enhanced animation.
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.
Free courses in JavaScript, Python, SQL, Kotlin, HTML, CSS, DSA. No account needed.