Giter Site home page Giter Site logo

jamalrefaideen / javascript-calculator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from umarfarooq95/javascript-calculator

0.0 0.0 0.0 28 KB

Simple Javascript Calculator

Home Page: https://js-calculator.now.sh/

License: MIT License

HTML 7.15% JavaScript 92.85%

javascript-calculator's Introduction

Javascript-Calculator

This is a Simple Javascript Calculator

Demo

Demo

Feature

  • Support Keyboard Key bindings;

Keyboard

  • Type 0 to 9 Numbers;
  • Shift plus + : will add the Numbers;
  • Shift plus * : will multiply the Numbers;
  • -: will subtract the Numbers;
  • / : will divide the Numbers;
  • = : will give the Output;
  • backspace : will clear the values;

Options

Name Description Type
background change the calculator background String
numbersBackground change the numbers box background String
numbersColor change the numbers box color String
operatorsBackground change the operators box background String
operatorsColor change the operators box color String
clearAndEqualBackgrounds change the clear and equal box background String
clearAndEqualColors change the clear and equal box color String

Note

Add index.js to your html file

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Calculator</title>
    <script src="../node_modules/javascript-calculator/src/index.js"></script>
</head>
<body>
</body>
</html>

Step 1: add some class to the div.

<div class="wrapper"></div>

Step 2: Initialize the plugin on your page. For example

// initialize with defaults
$(".wrapper").javascriptCalcInit();

// initialize with options
$(".wrapper").javascriptCalcInit({
        background:'black',
        numbersBackground:'#8c4141',
        numbersColor:'white',
        operatorsBackground:'#FF5722',
        operatorsColor:'white',
        clearAndEqualBackgrounds:'#8c4141',
        clearAndEqualColors:'white',
});

Using NPM

To install using the npm package manager run:

$ npm install javascript-calculator

Contribute

Contributions are always welcome!

License

MIT

javascript-calculator's People

Contributors

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