Skip to content

iharshity/Basic-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🧮 Basic Calculator

A basic, responsive calculator built using HTML, CSS, and JavaScript, featuring a clean glassmorphism UI and smooth interactions.
This project was built to strengthen frontend fundamentals like DOM manipulation, event handling, and CSS Grid layouts.


🌐 Live Demo

👉 Reminder: Try it live here
🔗 https://iharshity.github.io/Basic-Calculator/

🚀 Features

  • ➕ Basic arithmetic operations (+, -, ×, ÷)
  • 🔢 Decimal number support
  • 🧼 Clear (AC) button
  • 🟰 Equal (=) button with error handling
  • 🧠 Prevents multiple operators in sequence
  • 🎨 Modern glassmorphism UI
  • 📱 Responsive design
  • 🧩 Grid-based layout using CSS Grid

🛠️ Tech Stack

  • HTML5 – Structure
  • CSS3 – Styling, Grid layout, Glass UI
  • JavaScript (ES6) – Logic & interactivity

📂 Project Structure

├── index.html     # Calculator structure
├── style.css      # UI styling
├── script.js      # Calculator logic
└── README.md      # Documentation

🧠 What I Learned

  • Handling button input using event listeners
  • Managing calculator state efficiently
  • Preventing invalid operator combinations
  • Using CSS Grid for complex layouts
  • Designing a modern UI from scratch

🎨 UI Highlights

  • Glassmorphism using backdrop-filter
  • Gradient equals (=) button
  • Dark theme for better readability
  • Smooth hover and click animations

⚠️ Important Note

This calculator uses JavaScript’s eval() function for simplicity.
While fine for learning projects, it is not recommended for production due to security concerns.


🧪 Run Locally

  1. Clone the repository:
    git clone https://github.com/iharshity/Basic-Calculator.git
  2. Open index.html in your browser

About

Basic Calculator - A sleek, browser-based calculator built with HTML, CSS, and JavaScript. Features a modern glassmorphism UI, responsive grid-based layout, smooth button interactions, operator validation, and real-time expression evaluation. Designed to practice core frontend fundamentals and deployed using GitHub Pages for instant access.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors