{"id":19904434,"url":"https://github.com/triple-ade/tip-calculator-app-main","last_synced_at":"2025-10-10T11:15:11.953Z","repository":{"id":104361309,"uuid":"584045307","full_name":"TRIPLE-ADE/tip-calculator-app-main","owner":"TRIPLE-ADE","description":"Frontend mentor challenge of building a tip-calculator-app-main, first project of the year","archived":false,"fork":false,"pushed_at":"2023-05-18T13:34:20.000Z","size":4902,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T07:28:08.025Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://triple-ade.github.io/tip-calculator-app-main/","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/TRIPLE-ADE.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}},"created_at":"2023-01-01T04:17:11.000Z","updated_at":"2024-05-12T09:26:20.000Z","dependencies_parsed_at":"2024-11-12T20:41:16.322Z","dependency_job_id":null,"html_url":"https://github.com/TRIPLE-ADE/tip-calculator-app-main","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TRIPLE-ADE/tip-calculator-app-main","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Ftip-calculator-app-main","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Ftip-calculator-app-main/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Ftip-calculator-app-main/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Ftip-calculator-app-main/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TRIPLE-ADE","download_url":"https://codeload.github.com/TRIPLE-ADE/tip-calculator-app-main/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPLE-ADE%2Ftip-calculator-app-main/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003725,"owners_count":26083610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-11-12T20:28:25.747Z","updated_at":"2025-10-10T11:15:11.935Z","avatar_url":"https://github.com/TRIPLE-ADE.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frontend Mentor - Tip calculator app solution\n\nThis is a solution to the [Tip calculator app challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/tip-calculator-app-ugJNGbJUX). 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  - [Continued development](#continued-development)\n- [Author](#author)\n\n**Note: Delete this note and update the table of contents based on what sections you keep.**\n\n## Overview\nThe challenge is Tip calculator app that takes input of bill, number of people and available button of tip or customize input of tip and display the tip and total cost per person, It is responsive across all screen size and also have interactive elements with hover and focus state\n### The challenge\n\nUsers should be able to:\n\n- View the optimal layout for the app depending on their device's screen size\n- See hover states for all interactive elements on the page\n- Calculate the correct tip and total cost of the bill per person\n\n### Screenshot\n\n![](./design/desktop.png)\n![](./design/mobile.png)\n\n\n### Links\n\n- Solution URL: [Add solution URL here](https://github.com/TRIPLE-ADE/tip-calculator-app-main)\n- Live Site URL: [Add live site URL here](https://triple-ade.github.io/tip-calculator-app-main/)\n\n## My process\n- Design the layout\n- Responsiveness across different screen sizes \n- Getting HTML element with javascript DOM manipulation\n- Created a function that do the calculation by taking three parameter(Tip, Bill, People)\n- Add event handlers for click events when the tips button are clicked and keyup for the custom tip input\n- display tip and total per person as a text content in another element\n\n### Built with\n\n- Semantic HTML5 markup\n- CSS custom properties\n- Flexbox\n- CSS Grid\n\n**Note: These are just examples. Delete this note and replace the list above with your own choices**\n\n### What I learned\n\nUse this section to recap over some of your major learnings while working through this project. Writing these out and providing code samples of areas you want to highlight is a great way to reinforce your own knowledge.\n\nTo see how you can add code snippets, see below:\n\n```html\n\u003ch1\u003eSome HTML code I'm proud of\u003c/h1\u003e\n```\n```css\n.tip \u003e div{\n    gap: 10px; \n    display: grid;\n    grid-template-columns: repeat(3,31.5%);\n}\n.tip input{\n    grid-column: 3/4;\n}\n```\n```js\nfunction calculateAmount(billInput, peopleInput, tip) {\n    const billTipPercent = billInput * tip/100;\n    const totalAmount = billTipPercent + billInput;\n    const tipPerPerson = (billTipPercent/peopleInput).toFixed(2);\n    const totalPerPerson = (totalAmount/peopleInput).toFixed(2);\n    \n    //display total and tip amount as textContent \n    total.textContent = `$${totalPerPerson}`;\n    tipAmount.textContent = `$${tipPerPerson}`;\n}\n\n//selecting all the tip Button\ntipBtn.forEach(e =\u003e {\n    e.addEventListener('click', function () {\n        if (people.value \u0026\u0026 bill.value) {\n            let tip = Number(e.textContent.replace(\"%\",''));\n            const billInput = parseInt(bill.value);\n            const peopleInput = parseInt(people.value);\n\n            //function calculate the amount and display\n            calculateAmount(billInput, peopleInput, tip);\n\n            //reset button background color and opacity\n            resetBtn.style.backgroundColor = \"hsl(172, 67%, 45%)\";\n            resetBtn.style.opacity = 1;\n\n           \n        }else{\n            if(bill.value == '' ){\n                bill.style.borderColor = 'red';\n            }\n            else if(people.value == ''){\n                people.style.borderColor = 'red' \n            }\n            \n            //setTimeOut of 2 seconds\n            setTimeout(() =\u003e {\n                people.style.borderColor = 'hsl(172, 67%, 45%)';\n                bill.style.borderColor = 'hsl(172, 67%, 45%)';\n            }, 2000);\n        }\n    })\n   \n})     \n\n//adding event listener to custom tip \ncustom.addEventListener('keyup', function (e) {\n    if (people.value \u0026\u0026 bill.value) {\n        \n        let tip = Number(custom.value);\n        const billInput = parseInt(bill.value);\n        const peopleInput = parseInt(people.value);\n\n        //function calculate the amount and display\n        calculateAmount(billInput, peopleInput, tip);\n        resetBtn.style.backgroundColor = \"hsl(172, 67%, 45%)\";\n        resetBtn.style.opacity = 1;\n       \n    } else{\n        if(people.value == ''){\n            people.style.borderColor = 'red' \n        } else if(bill.value == '' ){\n            bill.style.borderColor = 'red';\n        }\n        \n        setTimeout(() =\u003e {\n            people.style.borderColor = 'hsl(172, 67%, 45%)';\n            bill.style.borderColor = 'hsl(172, 67%, 45%)';\n        }, 2000);\n    }\n   \n})\n```\n\n\n### Continued development\n\nUse this section to outline areas that you want to continue focusing on in future projects. These could be concepts you're still not completely comfortable with or techniques you found useful that you want to refine and perfect.\n- JavaScript DOM Manipulation\n- JavaScript Array, function and Object\n\n## Author\n\n- Website - [Add your name here](https://www.your-site.com)\n- Frontend Mentor - [@TRIPLE-ADE](https://www.frontendmentor.io/profile/TRIPLE-ADE)\n- Twitter - [@Triple123A](https://www.twitter.com/Triple123A)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriple-ade%2Ftip-calculator-app-main","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriple-ade%2Ftip-calculator-app-main","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriple-ade%2Ftip-calculator-app-main/lists"}