Skip to content

top-submissions/foundations-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Foundations Calculator

A calculator project built with HTML, CSS, and JavaScript
as part of The Odin Project – Foundations Path.

This project demonstrates building a functional calculator interface with basic arithmetic operations, a responsive design, and clean, interactive UI.


πŸš€ Live Demo

πŸ‘‰ https://top-submissions.github.io/foundations-calculator/


πŸ“‹ Project Overview

The calculator supports:

  • Basic arithmetic operations: addition, subtraction, multiplication, division
  • Special buttons: clear, negate, decimal, backspace
  • Interactive button feedback and styling
  • Real-time input display

The project focuses on DOM manipulation, event handling, and JavaScript logic implementation.


✨ Features

  • Functional calculator with all standard operations
  • Interactive buttons with hover and active states
  • Input validation to prevent invalid operations (e.g., division by zero)
  • Responsive design for desktop and mobile
  • Simple, clean interface using CSS variables for consistent styling

πŸ›  Technologies Used

  • HTML5: Semantic markup for calculator structure
  • CSS3: Styling, responsive layout, variables, and hover effects
  • JavaScript (ES6): DOM manipulation, event listeners, and calculation logic

πŸ“– How It Works

  • Each button triggers an event listener in script.js
  • Number buttons append digits to the input display
  • Operator buttons handle calculations and store operands
  • Special buttons handle clear, negate, decimal, and backspace
  • The script ensures valid operations and updates the display in real-time

πŸ“š Learning Outcomes

  • DOM manipulation and event handling in vanilla JavaScript
  • Structuring HTML and CSS for a calculator interface
  • Implementing responsive design
  • Using CSS variables and consistent styling
  • Debugging and fixing logical errors in JavaScript

πŸ‘€ Author

MatimotTheTimoters GitHub: https://github.com/Chonky_Seal