{"id":50729203,"url":"https://github.com/sam4web/calculator-app","last_synced_at":"2026-06-10T07:02:57.614Z","repository":{"id":357176607,"uuid":"1206110437","full_name":"sam4web/calculator-app","owner":"sam4web","description":"This is a solution to the Calculator app challenge on Frontend Mentor.","archived":false,"fork":false,"pushed_at":"2026-05-11T17:02:41.000Z","size":588,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-11T18:28:26.070Z","etag":null,"topics":["frontend-mentor","sveltejs","tailwindcss","typescript"],"latest_commit_sha":null,"homepage":"https://sam4web.github.io/calculator-app/","language":"CSS","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/sam4web.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-09T15:30:56.000Z","updated_at":"2026-05-11T17:04:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sam4web/calculator-app","commit_stats":null,"previous_names":["sam4web/calculator-app"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sam4web/calculator-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam4web%2Fcalculator-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam4web%2Fcalculator-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam4web%2Fcalculator-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam4web%2Fcalculator-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sam4web","download_url":"https://codeload.github.com/sam4web/calculator-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam4web%2Fcalculator-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34140776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":["frontend-mentor","sveltejs","tailwindcss","typescript"],"created_at":"2026-06-10T07:02:54.103Z","updated_at":"2026-06-10T07:02:57.603Z","avatar_url":"https://github.com/sam4web.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frontend Mentor - Calculator app solution\n\nThis is a solution to the [Calculator app challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/calculator-app-9lteq5N29). Frontend Mentor challenges help you improve your coding skills by building realistic projects.\n\n## Table of contents\n\n- [Overview](#overview)\n  - [The challenge](#the-challenge)\n  - [Screenshot](#screenshot)\n  - [Links](#links)\n- [My process](#my-process)\n  - [Built with](#built-with)\n  - [What I learned](#what-i-learned)\n  - [Useful resources](#useful-resources)\n- [Author](#author)\n\n## Overview\n\n### The challenge\n\nUsers should be able to:\n\n- See the size of the elements adjust based on their device's screen size\n- Perform mathmatical operations like addition, subtraction, multiplication, and division\n- Adjust the color theme based on their preference\n- **Bonus**: Have their initial theme preference checked using `prefers-color-scheme` and have any additional changes saved in the browser\n\n### Screenshot\n\n![screenshot](./screenshot.png)\n\n### Links\n\n- Solution URL: [Frontend Mentor Solution](https://www.frontendmentor.io/solutions/calculator-app-cvmBM047hY)\n- Live Site URL: [Github Pages](https://sam4web.github.io/calculator-app/)\n\n## My process\n\n### Built with\n\n- [Svelte](http://svelte.dev/)\n- [Tailwind](https://tailwindcss.com/)\n- TypeScript\n- Mobile-first workflow\n\n### What I learned\n\nIn this project, I implemented the **Shunting Yard algorithm** to convert **Infix** expressions into **Postfix** (Reverse Polish Notation). This involved managing operator precedence and parentheses using a **Stack**.\n\n**Key Highlights:**\n\n- **Shunting Yard Algorithm:** Utilized a stack to reorder tokens based on mathematical precedence.\n- **Stacks (LIFO):** Applied \"Last-In, First-Out\" logic for both parsing operators and evaluating the final expression.\n- **Postfix Evaluation:** Developed a logic to process the final string and calculate results without the need for parentheses.\n\n```javascript\n// Postfix evaluation logic using a for...of loop\nfor (const token of tokens) {\n  if (isOperator(token)) {\n    const b = stack.pop();\n    const a = stack.pop();\n    stack.push(calculate(a, b, token));\n  } else {\n    stack.push(Number(token));\n  }\n}\n```\n\n### Useful resources\n\n- [Svelte Docs](https://svelte.dev/docs/): As someone new to Svelte, these docs were my primary guide. They were incredibly helpful for understanding reactivity and component lifecycle.\n- [Evaluation of Postfix Expression](https://www.geeksforgeeks.org/dsa/evaluation-of-postfix-expression/): This article broke down the step-by-step logic for using a stack to evaluate expressions, which was crucial for my calculation logic.\n- [Shunting Yard Algorithm Implementation](https://www.geeksforgeeks.org/java/java-program-to-implement-shunting-yard-algorithm/): While the examples were in Java, the logic helped me finally understand how to handle operator precedence and the transition from infix to postfix.\n\n## Author\n\n- Website: [Sijal Manandhar](https://sijalmanandhar.com.np/)\n- Frontend Mentor: [@sam4web](https://www.frontendmentor.io/profile/sam4web)\n- Github: [@sam4web](https://github.com/sam4web)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam4web%2Fcalculator-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsam4web%2Fcalculator-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam4web%2Fcalculator-app/lists"}