Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

Responsive tip app using Grid and StimulusJS

vite
Ian•150
@blndcat
A solution to the Tip calculator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Implemented using StimulusJS for the logic (calculation and validations) along with grid for the layout. Decided to move the position of the error messages so that they were more flexible and consistent.

Probably spent as much time trying to cover as many edge cases, as I did with implementing the layout and main calculation logic. Some examples:

  • if the user clicks in the custom tip field and clicks out without entering a figure, it should result in an error
  • accepting the custom tip with a percentage sign like 20%
  • if an error occurs display dashes in the results panel so a user is protected from using potentially incorrect figures (e.g. if a negative custom tip value is entered)

and lots more! :)

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Ian's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License