A beautiful, interactive web application that displays random cat facts with a sleek glassmorphic design. Features an adorable sleeping cat animation and engaging UI elements.
- 🎨 Modern Glassmorphic Design - Beautiful, premium UI with blur effects and transparency
- 🐾 Interactive Sleeping Cat - Lottie animation that responds to cursor movement
- 📜 Scrollable Facts - Compact container with custom-styled scrollbar for long facts
- 🎭 Smooth Animations - Loading states with cute cat animations
- 🎉 Confetti Effects - Celebration animation when loading new facts
- 📱 Responsive Layout - Works beautifully on all screen sizes
- 🎯 Cat Images - Random cat images from The Cat API
Simply open index.html in your browser or use a local development server like Live Server.
- HTML5 - Semantic markup
- CSS3 - Modern styling with glassmorphism, custom scrollbars, and animations
- JavaScript (ES6+) - Async/await, DOM manipulation
- Bootstrap Icons - Icon library
- Lottie - High-quality animations
- Lottie Interactivity - Cursor-based animation control
- Axios - HTTP requests
- Canvas Confetti - Confetti effects
-
Cat Facts API -
https://catfact.ninja/fact- Provides random cat facts
-
The Cat API -
https://api.thecatapi.com/v1/images/search- Provides random cat images
Randon cat facts/
├── index.html # Main HTML file
├── styles.css # All styling and animations
├── app.js # Application logic and API calls
├── bg-image.jpg # Background image
├── assets/
│ ├── Cat Sleeping.json # Sleeping cat Lottie animation
│ ├── Cat Sleeping.lottie # Alternative format
│ └── pets.svg # Paw icon SVG
└── README.md # This file
- Frosted glass effect with backdrop blur
- Subtle shadows and borders
- Compact, centered design
- Top-left positioned Lottie animation
- Responds to cursor movement using seek mode
- Retry logic ensures consistent initialization
- Max height: 100px for compact display
- Auto-scrolling for long facts
- Custom pink-themed scrollbar
- Smooth transitions
- Inline SVG paw icon
- Loading state with hourglass icon
- Smooth hover effects
- Color Palette: Pink gradient (
#ff9a9eto#fecfef) - Typography: System fonts with clean hierarchy
- Animations: Smooth transitions and micro-interactions
- Accessibility: ARIA labels and semantic HTML
-
Clone or Download the project
git clone <your-repo-url> cd "Randon cat facts"
-
Open with Live Server (recommended)
- Install Live Server extension in VS Code
- Right-click
index.html→ "Open with Live Server"
-
Or open directly
- Simply double-click
index.html
- Simply double-click
- Solution: The script includes retry logic (up to 10 attempts) to ensure the Lottie player is ready
- Check browser console for "Cat interactivity initialized!" message
- Solution: Hard refresh the browser (Ctrl+Shift+R)
- Clear browser cache if needed
Replace assets/Cat Sleeping.json with your own Lottie animation file and update the path in index.html:
<lottie-player id="interactive-mascot" src="assets/YOUR_ANIMATION.json" ...>In styles.css, modify the .fact-container max-height:
.fact-container {
max-height: 100px; /* Change this value */
}Update the gradient colors in styles.css:
background: linear-gradient(135deg, #YOUR_COLOR_1 0%, #YOUR_COLOR_2 100%);- Add favorite facts feature
- Share facts on social media
- Dark mode toggle
- More cat animation variations
- Fact categories/filters
- Offline support with service workers
Contributions are welcome! Feel free to:
- Fork the project
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is open source and available under the MIT License.
- Cat facts from Cat Facts API
- Cat images from The Cat API
- Sleeping cat animation from LottieFiles
- Icons from Bootstrap Icons
Created with 💖 by Prathmesh
Enjoy learning about cats! 🐱✨