Skip to content

ABQ4539/Tip-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Tip calculator app solution

This is a solution to the Tip calculator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Calculate the correct tip and total cost of the bill per person

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • Mobile-first workflow
  • Vanilla JavaScript

What I learned

I learnt many things while working on this project mostly with JavaScript. I learnt how to manipulate the HTML document by changing the content using JavaScript and how to change the style of the elements as well such as input fields and buttons when a condition is true.

peopleStyle.style.border = "none";
spanTitle.style.display = "none";
  if (tipAmount === 0 || tipAmountPerPerson === Infinity) {
      tipAmountValue.innerHTML = "Error"
      totalValue.innerHTML = "Error"
      peopleStyle.style.border = "2px solid red";
      spanTitle.style.display = "initial";
  }

I also learnt how to use CSS grid to style the layout of elements in a grid.

.buttons-grid-container {
    display: grid;
    grid-template-columns: auto auto;
}
.grid-item {
    margin: 0.6rem 0.4rem;
}

Useful resources

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published