A basic calculator built using vanilla HTML, CSS, and JavaScript. Designed for simplicity, with a focus on clarity in layout and core functionality. This project showcases practical JavaScript techniques and clean structural organization.
This project uses only native browser technologies and highlights a few areas of interest:
- DOM event handling for interactive button clicks.
- Element selection and traversal using
querySelectorAll. - Input validation to prevent duplicate operators or malformed expressions (e.g., division by zero).
- Basic CSS Grid for responsive layout of calculator buttons.
- CSS Custom Properties for theme management.
- CSS Transitions and Transforms for UI feedback.
- Responsive Design with Media Queries ensures adaptability across devices.
- Robust numeric parsing using
parseFloat()andisNaN().
- Font: Segoe UI β Google Fonts
- Icons: Font Awesome (CDN Link)
No external JavaScript or CSS frameworks are used. All functionality is written using core browser APIs.
.
βββ index.html
βββ style.css
βββ script.js
- Root files include all layout, styling, and JavaScript logic.