Skip to content

Conversation

@Pramod-Munnoli
Copy link
Contributor

✨ Description

This PR adds a fully functional calculator built using vanilla JavaScript, HTML, and CSS.
The calculator includes the complete user interface, core operations, and keyboard support as defined in the project’s acceptance criteria.


✅ Features Implemented

  • Responsive calculator UI built with CSS Grid
  • Core operations: +, , ×, ÷, %, +/-, AC, Backspace
  • Decimal input validation (prevents multiple decimals)
  • Handles division by zero gracefully (displays “Error”)
  • Float rounding up to 10–12 significant digits
  • Full keyboard support:
    • Digits 0–9
    • Operators +, , *, /
    • Enter → equals
    • Escape → clear (AC)
    • Backspace → delete last digit
  • ARIA labels and focus styles for accessibility
  • Works as a single self-contained HTML file (no dependencies)

🖼️ Screenshots

  • The full calculator UI
  • Error message on division by zero
Calculator UI Error message on division by zero
UI Error message

🧪 Testing

Manually tested locally in the browser:

  • ✅ All buttons functional
  • ✅ Keyboard inputs working
  • ✅ Responsive layout on desktop and mobile
  • ✅ Correct results with float precision and rounding
  • ✅ Proper error handling for invalid operations

🔗 Related Issue

Closes #161


🗒️ Notes

  • Built entirely using vanilla JS, HTML, and CSS (no frameworks or CDNs).
  • The calculator can be opened directly in any browser — no build tools required.
  • Open to suggestions for UI styling or additional improvements.

🏷️ Hacktoberfest

This PR is submitted for Hacktoberfest 2025.
If the repository is not automatically marked as participating, kindly add the label hacktoberfest-accepted. 🙏

@vercel
Copy link

vercel bot commented Oct 27, 2025

@Pramod-Munnoli is attempting to deploy a commit to the hrishikesh-dalal's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Hrishikesh-Dalal Hrishikesh-Dalal merged commit e6aa0f2 into commitra:main Oct 27, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calculator — implement UI, operations, and keyboard support

2 participants