A professional-grade calculator application available in three distinct versions.
- Web Version (
mainbranch) - Standard web-based calculator - Progressive Web App (PWA) (
PWAbranch) - Installable web application with offline capabilities - Desktop Application (
electronbranch) - Native desktop application built with Electron
- Basic arithmetic operations: addition (+), subtraction (-), multiplication (*), division (/)
- Advanced mathematical functions:
- Square root (√)
- Exponentiation (x^y)
- Percentage calculations
- M+: Add current value to memory
- M-: Subtract from memory
- MR: Recall memory value
- MC: Clear memory
- Visual memory indicator
- Responsive design for all screen sizes
- Light and dark theme support
- System theme detection
- Keyboard navigation
- Visual feedback on interactions
- Installable on devices
- Offline functionality
- App-like experience
- Service worker caching
- Web App Manifest
- Native desktop integration
- System tray support
- Global keyboard shortcuts
- Automatic updates
- Native notifications
Try PWA version: Live Demo
Screenshots:
| Light Theme | Dark Theme |
|---|---|
![]() |
![]() |
- HTML5 with semantic markup
- CSS3/SCSS with custom properties
- JavaScript (ES6+)
- Node.js
- npm
- ESBuild
- Electron (for desktop version)
- Electron Builder
- ESLint
- Stylelint
- Prettier
- Git
calculator-web-pwa-electron/
├── assets/ # Static assets
│ ├── color-palette.svg # Theme toggle icon
│ └── fonts/ # Web fonts in WOFF2 format
├── build/ # Build artifacts and configuration files
│ ├── calculator.desktop # Desktop entry file for Linux
│ ├── icon-{sizes}.png # Various icon sizes for Electron
│ ├── icon.ico # Windows icon
│ ├── icon.icns # macOS icon
│ └── other electron specific files
├── src/ # Source code for the application
│ ├── main.js # Main JavaScript logic for the application
│ ├── styles/ # SCSS stylesheets for the application
│ └── index.html # HTML entry point for the application
├── LICENSE # License file
├── main.electron.js # Electron main process file
├── build.config.js # Build configuration file for the web version
├── build.js # Build script for the web version
├── package.json # Project metadata and dependencies
├── README.md # Project documentation
└── watch.js # File watcher script for development
- Node.js v23.4.0
- npm v11.1.0
- Development Dependencies:
@stylistic/stylelint-plugin: v3.1.2concurrently: v9.1.2del: v8.0.0electron: v31.0.0electron-builder: v26.0.12electronmon: v2.0.3esbuild: v0.25.0eslint: v9.22.0fs-extra: v11.3.0globals: v16.0.0html-minifier-terser: v7.2.0png2icons: v2.0.1postcss-scss: v4.0.9sass: v1.85.1sharp: v0.34.1stylelint: v16.16.0
build: Builds the project usingbuild.js.build:electron: Builds the Electron application for the current operating system.build:electron-cross-platform: Builds the Electron application for Windows, macOS, and Linux.icons: Generates icons for macOS, Windows, and Linux platforms usinggenerate-icons.js.start:electron: Starts the application with live reload usingelectronmon.watch: Watches for changes in the source files.clean:build: Cleans the build directory except essential files.clean:dist: Cleans thedist/directory.clean:local_cache: Removes the local Electron cache.stylelint:fix: Fixes SCSS styling issues.eslint:fix: Fixes JavaScript issues.
To build and install the application, follow these steps based on your operating system:
First, clone the repository to your local machine:
git clone https://github.com/theEvilGrinch/calculator-web-pwa-electron.git
cd calculator-web-pwa-electronBefore building, ensure all dependencies are installed:
npm installNote: Additional system dependencies may be required for building the application on specific platforms:
- On Linux:
gtk3for graphical components.libxcrypt-compatfor building.debpackages.- On Linux (for cross-platform builds targeting Windows):
wineis required to build.exefiles for Windows.
-
Single-Platform Build: To build the application for the operating system you are currently using, run:
npm run build:electron
This will generate a platform-specific build (e.g., an
.exefor Windows, a.zipfor macOS, or a.debfor Linux) in thebuild/directory. -
Cross-Platform Build: To create builds for all supported platforms (Windows, macOS, and Linux), run:
npm run build:electron-cross-platform
This will produce the following files in the
build/directory:- Windows:
calculator Setup <version>.exe(installer). - macOS:
calculator-<version>-mac.zip(archive). - Linux:
.debpackage for Debian-based distributions..AppImagefor universal Linux usage.
- Windows:
After building, follow the instructions below to install the application depending on your operating system:
Linux (AppImage or .deb)
- For
.AppImage:- Copy the following files from the
build/directory:calculator.desktopto~/.local/share/applications/(or any other directory where your system stores application shortcuts).icon-256x256.pngto your preferred location for icons.calculator-<version>.AppImageto your desired application directory.
- Edit the
calculator.desktopfile and replace the placeholders:- Replace
<PATH_TO_ICON>with the full path to the copiedicon-256x256.png. - Replace
<PATH_TO_APPIMAGE>with the full path tocalculator-<version>.AppImage.
- Replace
- Refresh your desktop environment to register the new application.
- Make the
.AppImagefile executable:chmod +x calculator-<version>.AppImage
- Run the file to launch the application:
./calculator-<version>.AppImage
- Copy the following files from the
- For
.deb:sudo dpkg -i calculator-<version>.deb
Windows (.exe)
Double-click the .exe installer in the build/ directory and follow the on-screen instructions to complete the installation.
macOS (.zip)
Extract the .zip file and move the application to your Applications folder.
Note: Replace <version> with the actual version number of the generated files.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
MIT Licensed - See LICENSE for details.
⚡ Maintained by @theEvilGrinch.

