Git Product home page Git Product logo

calculator's Introduction

Pursuit-Core-Web-React-Calculator-Lab

Simple Calculator

Task

  • You will create a React app that mimics a simple calculator
  • Please use create-react-app to generate your project
  • Break your application down to necessary components
  • Your app should look, feel and work like this: Live Example

Functionality

  • AC: Clears all of the data in the screen
  • C: Clears only what is being displayed
  • %: Converts the current value into a percentage. So just x / 100
  • ±: Toggles between negative and positive number
  • . : Adds decimal point to the current number
  • Operations: Queues the operation
  • Equal to: Invokes the operation to happen
  • Play around with the Live Example

State

You can use the following state:

{
  displayValue: '0',
  previousValue: null,
  operation: null,
  waitingForNewValue: false
}

Styling

  • Center your calculator so it takes up 50% of the screen

  • You may use the following button css to get started quickly:

    .button {
      background-color: #E0E0E6;
      font-size: 40px;
      text-align: center;
      color: #666666;
      border-left: 1px solid #666666;
      border-bottom: 1px solid #666666;
      user-select: none;
      cursor: pointer;
      outline: none;
      -webkit-tap-highlight-color: rgba(0,0,0,0);
      display: block;
    }
    
    button:active {
      box-shadow: inset 0px 0px 80px 0px rgba(0,0,0,0.25);
    }
    
    .orange {
      background-color: #EE9B3E;
      color: #fff;
    }
  • Try your best to make it look like the example

Rubric

calculatorRubric

calculator's People

Contributors

benstone1 avatar crystalcardona avatar

Watchers

 avatar  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.