Skip to content

MariusHor/calculator-javascript

Repository files navigation

calculator-javascript

Table of contents

Overview

Screenshot

Links

Features

  • Basic arithmetic operations (addition, subtraction, multiplication, division)
  • Switch between 3 different themes
  • History of the last 5 calculations
  • Responsive design

My process

Built with

  • Semantic HTML5 markup
  • SCSS
  • JavaScript
  • Webpack

Implementation

This is a vanilla JavaScript calculator app that allows users to switch between 3 nice-looking themes, provides basic arithmetic operations, and provides the ability to see a history of the last 5 calculations performed. The app is written in an MV* variation architecture, implements a PubSub class to manage communication of data from the Model to the listening views whenever the state changes. A HistoryManager class is also included to handle the history logic of the performed calculations and is separated from the Model class for better separation of concerns.

Continued development

In future developments, I would like to add more complex operations and advanced functionalities to the calculator, such as the ability to calculate percentages, square roots, and exponents.

Useful resources

Author