{"id":22724581,"url":"https://github.com/binghuan/calculator","last_synced_at":"2026-04-30T10:39:11.053Z","repository":{"id":9833344,"uuid":"11821837","full_name":"binghuan/calculator","owner":"binghuan","description":"This is a simple calculator app","archived":false,"fork":false,"pushed_at":"2025-07-31T13:11:03.000Z","size":1227,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"gh-pages","last_synced_at":"2025-07-31T17:14:01.218Z","etag":null,"topics":["javascript","webapp"],"latest_commit_sha":null,"homepage":"http://studiobinghuan.blogspot.tw/2013/05/calculator.html?view=flipcard","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binghuan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-01T16:30:38.000Z","updated_at":"2025-07-31T13:11:07.000Z","dependencies_parsed_at":"2022-09-24T06:10:35.353Z","dependency_job_id":null,"html_url":"https://github.com/binghuan/calculator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/binghuan/calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binghuan%2Fcalculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binghuan%2Fcalculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binghuan%2Fcalculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binghuan%2Fcalculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binghuan","download_url":"https://codeload.github.com/binghuan/calculator/tar.gz/refs/heads/gh-pages","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binghuan%2Fcalculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32462304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","webapp"],"created_at":"2024-12-10T15:07:09.912Z","updated_at":"2026-04-30T10:39:11.045Z","avatar_url":"https://github.com/binghuan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calculator\n\n\u003cimg src=\"Icon.png\" width=\"auto\" height=\"240\"\u003e\n\n## Overview\n\nA simple, responsive web-based calculator application with offline capabilities. This mobile-friendly calculator provides basic arithmetic operations and can be used without an internet connection after the initial load.\n\n## 🌐 Live Demo\n\n- **Web App**: [http://binghuan.github.io/calculator/](http://binghuan.github.io/calculator/)\n- **Blog Post**: [http://studiobinghuan.blogspot.tw/2013/05/calculator.html?view=flipcard](http://studiobinghuan.blogspot.tw/2013/05/calculator.html?view=flipcard)\n\n## ✨ Features\n\n- **Basic Arithmetic Operations**: Addition (+), Subtraction (-), Multiplication (*), Division (/)\n- **Offline Functionality**: Works without internet connection using Application Cache\n- **Mobile Optimized**: Responsive design using jQuery Mobile framework\n- **Touch-Friendly Interface**: Large buttons optimized for mobile devices\n- **Clear Function**: Reset calculator with the \"C\" button\n- **Real-time Display**: Shows calculations as you type\n- **Progressive Web App**: Can be added to home screen on mobile devices\n\n## 🛠️ Technology Stack\n\n- **HTML5**: Structure and semantic markup with offline manifest\n- **CSS3**: Styling with jQuery Mobile theme\n- **JavaScript**: Calculator logic and event handling\n- **jQuery 1.10.1**: DOM manipulation and event handling\n- **jQuery Mobile 1.3.1**: Mobile UI framework for responsive design\n- **Application Cache**: Enables offline functionality\n\n## 📱 Supported Operations\n\n| Operation | Symbol | Button |\n|-----------|--------|--------|\n| Addition | + | + |\n| Subtraction | - | - |\n| Multiplication | * | * |\n| Division | / | / |\n| Equals | = | = |\n| Clear | C | C |\n| Numbers | 0-9 | 0-9 |\n\n## 🚀 How to Use\n\n1. **Online**: Visit [the live demo](http://binghuan.github.io/calculator/)\n2. **Offline**: After first visit, the app will work without internet connection\n3. **Mobile**: Add to home screen for app-like experience\n\n### Calculator Instructions:\n1. Tap number buttons to input values\n2. Tap operation buttons (+, -, *, /) to perform calculations\n3. Tap \"=\" to see the result\n4. Tap \"C\" to clear and start over\n5. Calculations are performed left-to-right as you input operations\n\n## 📁 Project Structure\n\n```\ncalculator/\n├── index.html              # Main HTML file\n├── calculator.js           # Calculator logic and event handlers\n├── calculator.css          # Custom styles\n├── calculator.appcache     # Offline cache manifest\n├── jquery-1.10.1.min.js   # jQuery library\n├── jquery.mobile-1.3.1.min.js    # jQuery Mobile JavaScript\n├── jquery.mobile-1.3.1.min.css   # jQuery Mobile CSS\n├── Icon.png                # App icon\n├── README.md              # This file\n├── icons/                 # Various app icon sizes\n│   ├── Icon-16.png\n│   ├── Icon-32.png\n│   ├── Icon-48.png\n│   └── ... (various sizes for different devices)\n└── images/                # UI assets\n    ├── ajax-loader.gif\n    ├── calculator_icon.png\n    └── ... (jQuery Mobile icons)\n```\n\n## 🔧 Installation \u0026 Development\n\n### Local Development:\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/binghuan/calculator.git\n   cd calculator\n   ```\n\n2. Open `index.html` in a web browser or serve it using a local web server:\n   ```bash\n   # Using Python 3\n   python -m http.server 8000\n   \n   # Using Python 2\n   python -m SimpleHTTPServer 8000\n   \n   # Using Node.js (if you have http-server installed)\n   npx http-server\n   ```\n\n3. Navigate to `http://localhost:8000` in your browser\n\n### Deployment:\nThe app is configured for GitHub Pages deployment. Simply push to the `gh-pages` branch to update the live version.\n\n## 🌐 Browser Compatibility\n\n- **Mobile Browsers**: iOS Safari, Android Chrome, Mobile Firefox\n- **Desktop Browsers**: Chrome, Firefox, Safari, Edge\n- **Offline Support**: All modern browsers with Application Cache support\n\n## 🎯 Key Implementation Details\n\n- **State Management**: Uses JavaScript variables to track current value, last operator, and calculation state\n- **Event Handling**: jQuery event listeners for all button interactions\n- **Calculation Logic**: Handles operator precedence and chained calculations\n- **Offline Cache**: Application Cache manifest ensures all resources are cached for offline use\n- **Mobile Optimization**: Viewport meta tags and jQuery Mobile for touch-friendly interface\n\n## 📝 Future Enhancements\n\n- [ ] Add decimal point support\n- [ ] Implement memory functions (M+, M-, MR, MC)\n- [ ] Add scientific calculator functions\n- [ ] Implement keyboard support\n- [ ] Add calculation history\n- [ ] Migrate from deprecated Application Cache to Service Workers\n\n## 👨‍💻 About\n\nThis is my second web application, created to demonstrate offline web app capabilities and mobile-first design principles. The primary focus was on creating a functional calculator that works seamlessly without an internet connection.\n\n**Powered by BH_Lin**\n\n---\n\n### 中文說明\n\n這是我的第二個網頁應用程式。本程式的特性是，使用者可以在離線的環境下，依然可以使用本網頁應用程式。這個簡單的計算機應用程式支援基本的數學運算，並且針對行動裝置進行了最佳化。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinghuan%2Fcalculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinghuan%2Fcalculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinghuan%2Fcalculator/lists"}