A professional-grade calculator available as a web app, PWA, and Electron desktop application.
- 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 ^23.4.0
- npm ^11.1.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.
Ready-to-use builds for Windows, macOS, and Linux are available on the Releases page.
Download the appropriate file for your operating system and follow the installation instructions below.
First, clone the repository to your local machine:
git clone https://github.com/andmitr/cross-platform-app.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.
1CCnwAvJYEoDVGM7vsBg2Q99cF9EHtBVaY
0x54f0ccc6b2987de454f69f2814fc9202bcfb74fe
MIT Licensed. See LICENSE for details.

