Git Product home page Git Product logo

js-calculator's Introduction

Frontend Mentor - Calculator app solution

This is a solution to the Calculator app challenge on Frontend Mentor. with dark mode feature.

Table of contents

Overview

The challenge

Users should be able to:

  • See the size of the elements adjust based on their device's screen size
  • Perform mathmatical operations like addition, subtraction, multiplication, and division
  • Adjust the color theme based on their preference

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow

What I learned

<h1>HTML layout of a calculator</h1>
 <button type="button" class="operator" value="-">-</button>

	  <button type="button" class="operator" value="*">&times;</button>

	  <button type="button" class="operator" value="/">&divide;</button>
	  
	  <button type="button" value="7">7</button>
	  <button type="button" value="8">8</button>
	  <button type="button" value="9">9</button>
.calculator-keys {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-gap: 20px;
  padding: 20px;
}
const calculator = {
  displayValue: '0',
  firstOperand: null,
  waitingForSecondOperand: false,
  operator: null,
};

  console.log('๐ŸŽ‰')

Continued development

  • sin, cos, tan functionality

Useful resources

  • CSS grid - This helped me with CSS grid. I really liked this pattern and it's explanatory.
  • Js calculator resources - This is an amazing article which helped me finally understand javascript calculator. I'd recommend it to anyone still learning this concept.

Author

js-calculator's People

Contributors

faozziyyah avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.