An interactive and visually stunning Dragon Cursor Animation UI built using HTML, CSS, SVG, and Vanilla JavaScript.
This project creates a glowing, animated dragon that smoothly follows the user's cursor, simulating natural motion using mathematical calculations and chained segment animation.
dragon-cursor-effect/
│
├── index.html # SVG structure and layout
├── styles.css # Styling and visual effects
├── main.js # Animation and cursor tracking logic
├── LICENSE
└── README.md # Project documentation- Dragon head tracks the cursor position
- Body follows with smooth trailing motion
- Creates a snake-like / fluid animation effect
- Built using multiple connected segments
- Each segment follows the previous one
- Uses trigonometry (atan2, sin, cos) for realistic movement
- Glowing neon-style dragon using
drop-shadow - Continuous color shifting (hue-rotate)
- Smooth animation rendering with
requestAnimationFrame
- Responds instantly to cursor movement
- Idle animation when cursor is still
- Feels alive and reactive
| Technology | Role |
|---|---|
| HTML5 | Structure and SVG container |
| CSS3 | Styling and glow effects |
| SVG | Dragon shapes and reusable parts |
| JavaScript (Vanilla) | Animation logic and interaction |
- Pointer tracking (
pointermove) - Trigonometric motion (
Math.atan2,sin,cos) - Chain physics simulation
- DOM manipulation using SVG
<use> - Real-time animation loop (
requestAnimationFrame)
git clone https://github.com/YOUR_USERNAME/dragon-cursor-effect.git
cd dragon-cursor-effectSimply open:
index.htmlin any modern browser.
- No mobile optimization
- High animation load on low-end devices
- No customization UI for speed, size, or colors
- Add fire trail / particle effects
- Add click interaction (dragon attack / burst)
- Improve mobile responsiveness
- Add settings panel (speed, size, colors)
- Convert into a reusable JS library
This project is built to:
- Practice advanced JavaScript animation
- Understand SVG manipulation
- Learn mathematical motion in UI
- Build creative frontend experiences
- Enhance portfolio-level projects
Creator: Shakal Bhau
GitHub: ShakalBhau0001
If you like this project, consider giving it a ⭐ on GitHub!