Skip to content

NashTech-Labs/calculator-with-electronjs

Repository files navigation

Modern Calculator Desktop App

A modern, feature-rich calculator desktop application built with Electron.js, featuring both basic arithmetic and advanced mathematical functions.

Features

Basic Operations

  • Addition (+)
  • Subtraction (−)
  • Multiplication (×)
  • Division (÷)
  • Percentage (%)
  • Power (x^y)

Advanced Functions

  • Square Root (√)
  • Sine (sin)
  • Cosine (cos)
  • Tangent (tan)
  • Natural Logarithm (ln)
  • Base-10 Logarithm (log)

User Interface

  • Modern glassmorphic design with gradient background
  • Responsive button animations
  • History display showing current operation
  • Number formatting with commas
  • Scientific notation for very large/small numbers

Keyboard Support

  • Numbers: 0-9
  • Decimal: .
  • Operators: +, -, *, /
  • Equals: Enter or =
  • Clear: Escape
  • Delete: Backspace
  • Percentage: %
  • Power: ^

Installation

  1. Navigate to the electronjs directory:

    cd electronjs
  2. Install dependencies:

    npm install

Running the Application

Development Mode

Start the calculator with:

npm start

For development mode:

npm run dev

Using the Executable

The calculator has been packaged as a standalone Windows executable:

  1. Direct Execution: Navigate to dist/win-unpacked/ and run Modern Calculator.exe
  2. Easy Launch: Double-click run-calculator.bat in the project root

The executable is completely self-contained and doesn't require Node.js or any dependencies to be installed on the target machine.

File Structure

electronjs/
├── main.js          # Main Electron process
├── index.html       # Calculator UI structure
├── styles.css       # Modern styling and animations
├── calculator.js    # Calculator logic and functionality
├── package.json     # Project dependencies and scripts
└── README.md        # This file

Technologies Used

  • Electron.js: Cross-platform desktop application framework
  • HTML5: Structure and semantics
  • CSS3: Modern styling with animations and transitions
  • JavaScript: Calculator logic and event handling

Design Features

  • Glassmorphic UI: Translucent background with blur effects
  • Gradient Backgrounds: Modern color transitions
  • Button Animations: Ripple effects and hover states
  • Responsive Design: Adapts to different screen sizes
  • Error Handling: Graceful handling of invalid operations

Mathematical Functions

The calculator supports both degrees and radians for trigonometric functions. Advanced functions are evaluated using JavaScript's built-in Math object for accuracy.

License

MIT License

About

This advanced calculator app demonstrates the power and flexibility of Electron by combining modern web technologies with desktop application features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors