A sophisticated and visually appealing preloader animation built with GSAP (GreenSock Animation Platform) and modern web technologies. This project demonstrates a smooth, professional loading experience with dynamic progress counting and elegant transitions.
- 🎯 Smooth progress counter animation
- 🎨 Modern gradient color schemes
- ⚡ GSAP-powered transitions and animations
- 📱 Fully responsive design
- 🎭 Custom text reveal effects
- 🌊 Elegant color wipe transitions
- 🎪 Clean and minimal UI
- HTML5
- CSS3
- JavaScript (ES6+)
- GSAP 3.12.2 (Animation Library)
- TailwindCSS (Utility-first CSS framework)
- Space Grotesk Font Family
- Clone the repository:
git clone https://github.com/prashantkoirala465/Modern-Preloader
cd Modern-Preloader
- Open
index.html
in your preferred web browser.
- Include the required dependencies in your HTML file:
<link rel="stylesheet" href="styles.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/SplitText.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/CustomEase.min.js"></script>
- Add the preloader HTML structure:
<div id="preloader" class="font-grotesk">
<div class="preloader-content">
<div class="progress-text">0</div>
<div class="loading-text">Loading</div>
</div>
</div>
- Initialize the preloader:
const preloader = new Preloader();
Modify the gradient colors in styles.css
:
.progress-text {
background: linear-gradient(to right, #ffffff, #818cf8);
}
.colorWipe {
background: linear-gradient(45deg, #4f46e5, #818cf8);
}
Adjust the animation timings in preloader.js
:
gsap.to(element, {
duration: 1, // Change duration
ease: 'power4.inOut' // Modify easing function
});
Modify the progress simulation in preloader.js
:
setInterval(() => {
progress += Math.random() * 8; // Adjust increment value
}, 200); // Modify interval timing
- Smooth number counting animation
- Dynamic opacity based on progress
- Tabular number formatting for consistent width
- Color wipe transition between loading and content
- Smooth fade-in animations for content
- Staggered text reveal effects
- Fluid typography using clamp()
- Mobile-friendly layout
- Optimized for various screen sizes
- Uses
will-change
for optimized animations - Implements
requestAnimationFrame
for smooth progress updates - Efficient GSAP timeline management
- Minimal DOM operations
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- GSAP by GreenSock for powerful animations
- TailwindCSS for utility classes
- Space Grotesk font family by Florian Karsten