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

Responsive landing page using CSS Flexbox and Grid

#accessibility

@ABQ4539

Desktop design screenshot for the Tip calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


This was a challenging project as I am still a newbie with JavaScript. I would appreciate constructive feedback and easier ways to write cleaner and reusable code. Thank you.

Community feedback

Vicktor 900

@Victor-Nyagudi

Posted

Great work! This looks good for someone who considers themself a newbie. Keep it up.

First things first, there's a warning in the accessibility report telling you every page should contain a level-one heading i.e. h1. This is because it's the first thing screen readers read out loud to people with poor eyesight telling them about what's on the page.

I'd suggest adding a title like "Tip Calculator" inside an h1 tag at the very top of your HTML. You can then give it a class like for-screen-reader and style it such that it's out of view for those with good eyesight but screen readers still read it out loud for those with poor eyesight.

Example styling:

.for-screen-reader
{
     position: absolute;
     right: -10000000;  // give it a very large number so it's out of view
     height: 1px;
     width: 1px;  // if it ends up on the screen, it's too small to see
     overflow: hidden;
}

I noticed that if you enter the amount first and then select a percentage, it throws an error but works when you start with the number of people

This isn't all bad since you can just press reset, but it's not the best user experience since people will naturally start at the top and move downwards.

You could optionally add an event listener like onkeyup on the inputs so that the user can change the number of guests or amount without having to hit reset.

I completed this challenge too and implemented this, so feel free to take a look at my code and see if it helps you out. https://www.frontendmentor.io/solutions/mobilefirst-using-bem-flexbox-css-grid-and-vanilla-js-71IKl_vqZ

Good luck with your other solutions.

Marked as helpful

0

@ABQ4539

Posted

@Victor-Nyagudi Thank you, I'll make sure to include an <h1> for accessibility. I looked at your code as well it looks great but a bit advanced for me with all those methods lol. I will also learn more on the onkeyup event listener.

0
Vicktor 900

@Victor-Nyagudi

Posted

@ABQ4539

Don't worry about it.

Take things one step at a time, and you'll eventually get better.

0

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