A sleek and modern counter application built with vanilla JavaScript, HTML, and CSS. Features a beautiful dark/light theme toggle, smooth animations, and keyboard shortcuts for enhanced user experience.
- Increment/Decrement Counter: Increase or decrease the counter value
- Custom Step Value: Set any step value for counting (default: 1)
- Reset Function: Reset counter to 0 and step value to 1
- Real-time Updates: Instant visual feedback for all operations
- Dark/Light Theme Toggle: Seamlessly switch between themes
- Smooth Transitions: All elements animate smoothly during theme changes
- Visual Indicators: Sun and moon icons show current theme state
- Persistent Design: Consistent styling across both themes
- Arrow Up or +: Increase counter
- Arrow Down or -: Decrease counter
- R: Reset counter and step value
- T: Toggle between light and dark themes
- Hover Effects: Interactive button animations
- Responsive Design: Works perfectly on mobile and desktop
- Smooth Animations: 0.3s ease transitions throughout
- Modern UI: Clean, minimalist design with Inter font
Our App Live at : https://biswajithemram.github.io/counter-app/
- HTML5: Semantic markup structure
- CSS3: Modern styling with Flexbox and transitions
- Vanilla JavaScript: Pure JS for all functionality
- Google Fonts: Inter font family for typography
Counter App/
├── index.html # Main HTML structure
├── style.css # Styling and theme definitions
├── script.js # JavaScript functionality
└── README.md # Project documentation
- Increase Counter: Click the "Increase" button or press ↑/+
- Decrease Counter: Click the "Decrease" button or press ↓/-
- Set Step Value: Enter any number in the step input field
- Reset: Click "Reset" button or press R key
- Toggle Theme: Click the toggle switch or press T key
| Key | Action |
|---|---|
↑ or + |
Increase counter |
↓ or - |
Decrease counter |
R |
Reset counter |
T |
Toggle theme |
- Clean white background
- Subtle gray shadows
- Green accent colors (#39e079)
- High contrast for readability
- Dark gray backgrounds (#1a1a1a, #2d2d2d)
- Reduced eye strain colors
- Same green accents maintained
- Smooth color transitions
- Clone or Download the project files
- Open
index.htmlin any modern web browser - Start using the counter app immediately!
# Navigate to project directory
cd "Counter App"
# Open in browser (Windows)
start index.html
# Or serve with a local server
npx serve .- ✅ Chrome (Latest)
- ✅ Firefox (Latest)
- ✅ Safari (Latest)
- ✅ Edge (Latest)
- ✅ Mobile Browsers
toggleTag.addEventListener("click", () => {
toggleBtn.classList.toggle("dark");
document.body.classList.toggle("dark-theme");
// Toggle theme icons
svg[0].classList.toggle("disable");
svg[1].classList.toggle("disable");
});.theme .toggle-btn {
transition: all 0.3s ease;
}
.dark {
transform: translateX(32px);
}document.addEventListener("keydown", (e) => {
if (e.key === "ArrowUp" || e.key === "+") {
e.preventDefault();
increaseBtn.click();
}
// ... more shortcuts
});- Local Storage: Save theme preference and counter state
- Counter Limits: Set min/max values for the counter
- Sound Effects: Audio feedback for button clicks
- Animation Effects: Pulse animation for counter changes
- History: Track counter operation history
- Export Data: Save counter sessions
Feel free to fork this project and submit pull requests for any improvements!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is open source and available under the MIT License.
Frontend BootCamp Project
- Created as part of frontend development learning journey
- Demonstrates modern CSS techniques and JavaScript functionality
Built with ❤️ using vanilla web technologies