Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

html, scss, js and nothing special

P

@AdamullaOsas

Desktop design screenshot for the Tip calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Community feedback

@alekseibodeev

Posted

Nice solution!

Here are some things you can improve:

Semantic input type

HTML5 has a lot semantic input types with built-in constraint validation. You can use appropriate type to prevent user from entering non-numeric data.

<input type="number" />

You can style it as a text input with following code:

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

Disabled state awareness

By providing appropriate styles you can ensure that user understand what's happening on the screen. You can style cursor to give user an extra hint that button does not clickable:

button[disabled] {
  cursor: not-allowed;
}

User feedback

It's good to provide additional feedback to user when something off. For example, tip calculator does not really want to "eat" negative tip %, amount of people or bill. It would be nice to show custom error message as you did for zero value.

Hope that was helpful.

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord