This project is a basic web-based calculator built using HTML, CSS, and JavaScript. It provides standard arithmetic operations (addition, subtraction, multiplication, division, and percentage) with a clean and responsive user interface.
- Basic Arithmetic Operations: Perform addition, subtraction, multiplication, and division.
- Percentage Calculation: Supports percentage operations.
- Clear All (AC): Clears the entire input.
- Delete (DEL): Deletes the last entered digit or operator.
- Responsive Design: Adapts to various screen sizes for a consistent user experience.
- Stylish UI: Modern design with a gradient background and subtle shadows.
- HTML5: For the structure of the calculator.
- CSS3: For styling and layout, including responsive design and visual effects.
- JavaScript: For calculator logic and interactive functionality.
- Clone the repository:
git clone [https://github.com/YourUsername/calculator-web-app.git](https://github.com/YourUsername/calculator-web-app.git)
- Navigate to the project directory:
cd calculator-web-app - Open
index.html: Simply open theindex.htmlfile in your web browser to start using the calculator.
calculator-web-app/ ├── index.html ├── style.css └── script.js
index.html: The main HTML file containing the calculator's structure.style.css: Contains all the CSS rules for styling the calculator.script.js: Contains the JavaScript logic for calculator operations.
To upload this project to GitHub:
-
Initialize a Git repository in your project folder: Open your terminal or command prompt, navigate to your
calculator-web-appdirectory (the one containingindex.html,style.css, andscript.js), and run:git init
-
Add your files to the staging area:
git add .This command stages all changes in the current directory.
-
Commit your changes:
git commit -m "Initial commit: Basic Calculator Web App"Replace the message with a descriptive one for your first commit.
-
Create a new repository on GitHub:
- Go to GitHub and log in to your account.
- Click on the "+" sign in the top right corner and select "New repository."
- Give your repository a name (e.g.,
calculator-web-app), add an optional description, and choose whether it's public or private. Do not initialize with a README, .gitignore, or license as you've already created your files locally. - Click "Create repository."
-
Link your local repository to the remote GitHub repository: On the next page that GitHub shows after creating the repository, you'll see instructions under "…or push an existing repository from the command line." Copy and paste the two lines provided. They will look something like this (replace
YourUsernameandcalculator-web-appwith your actual details):git remote add origin [https://github.com/YourUsername/calculator-web-app.git](https://github.com/YourUsername/calculator-web-app.git) git branch -M main
(Note: GitHub now defaults to
mainbranch instead ofmaster.) -
Push your local commits to GitHub:
git push -u origin main
Your project will now be live on your GitHub repository!