javascript-mini-projects
javascript-mini-projects copied to clipboard
added javascript project - Interactive Tip Calculator
✅ Developer Checklist
- [x] I have followed all the guidelines mentioned in the README file.
- [x] I have maintained the required directory structure. (Format:
ProjectName/{USERNAME}/...yourfiles) - [x] This Pull Request contains only one project.
- [x] I have starred ⭐ the repository (optional).
📝 Summary
Project: Interactive Tip Calculator
A clean, modern, and fully responsive web application for calculating tips and splitting bills among multiple people. The calculator provides real-time calculations with instant feedback and input validation.
Key Features:
- 💵 Enter bill amount with real-time validation
- 🎯 Quick tip selection (5%, 10%, 15%, 25%, 50%) or custom percentage
- 👥 Split bills among any number of people
- ⚡ Instant calculation updates
- 💸 Display tip amount and total per person in Indian Rupees (₹)
- ✅ Visual error highlighting for invalid inputs
- 🔄 One-click reset functionality
- 📱 Fully responsive design (mobile, tablet, desktop)
Technologies Used:
- HTML5 (Semantic markup)
- CSS3 (Flexbox, Grid, responsive design)
- Vanilla JavaScript (ES6+)
Changes Submitted:
- Complete tip calculator application with three core files
- Clean, modular code structure
- Comprehensive input validation
- Mobile-responsive design with media queries
- User-friendly interface with active state management
📸 Screenshots / GIFs
Desktop View:
Full calculator layout with input section and results panel side by side
Mobile View
Full calculator layout with input section and results in mobile mode
🔗 Live Project Link
Live Demo: https://saurabh-1785.github.io/interactive-tip-calculator/
Repository: https://github.com/saurabh-1785/interactive-tip-calculator
💡 Additional Notes
Project Highlights:
- Zero dependencies - pure vanilla JavaScript
- Works offline once loaded
- Lightweight and fast loading
- Clean code with detailed comments
- Follows best practices for accessibility
Calculation Example:
Input:
- Bill Amount: ₹1000
- Tip Percentage: 15%
- Number of People: 4
Output:
- Tip per Person: ₹37.50
- Total per Person: ₹287.50
Testing:
- ✅ Tested on Chrome, Firefox, Safari, and Edge
- ✅ Validated on mobile devices (iOS & Android)
- ✅ Input validation thoroughly tested
- ✅ Edge cases handled (negative numbers, decimals, etc.)
🎯 Future Enhancements (Optional)
- [x] Add dark mode toggle
- [x] Support multiple currencies
- [ ] Bill history/tracking feature
- [ ] Export/share calculation results
- [ ] Tip percentage recommendations based on service quality