Skip to content

vanshmehandru/Basic-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🧮 Basic Calculator

A sleek, responsive basic calculator built using HTML, CSS, and JavaScript. It supports basic arithmetic operations and mimics the look and feel of a modern calculator.


🚀 Features

  • Responsive, modern UI
  • Basic operations: +, -, ×, ÷
  • AC (All Clear), C (Backspace), +/- toggle
  • Decimal input and real-time display update
  • Error handling for invalid operations

🖥️ Demo Preview

Calculator UI Preview


🛠️ How to Run

  1. Clone the repository:
    git clone https://github.com/your-username/calculator-project.git
    cd calculator-project
  • Open index.html in your browser.

  • That’s it! Your calculator should now be running.

📄 Code Highlights

HTML

  • Semantic layout with a simple structure

  • Uses input field for live display updates

CSS

  • Flexbox and CSS Grid for layout

  • Modern dark theme with button hover effects

JavaScript

Core functions:

  • press(val) for input handling

  • calculate() for expression evaluation

  • Uses eval() with input sanitization

💡 Future Enhancements

  • ⌨️ Keyboard input support

  • 🌗 Dark/Light mode toggle

  • % Modulo and memory features

  • 🧮 Scientific calculator mode

📜 License

  • This project is open-sourced under the MIT License.

🤝 Contributions

  • Feel free to fork the repo, submit pull requests, or open issues!

Releases

No releases published

Packages

 
 
 

Contributors