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

Js Vanilla, FlexBox, Semantic Tag

Ruan Mesquita• 70

@RuHd

Desktop design screenshot for the Age calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Surprisingly, the css was the hardest to me than the functionality itself. I spent a decent amount of time to figure out the best way to organize all the containers and to establish each position on the page. But despite the struggle, it was really fun to solve. There's some traits that it's missing but in overall, I'm happy with! Hope you like it! :)

I have a question: Dedicating a external js file just to store the constants is it efficient on code execution manner or it's for a better readibility? Thanks!

Community feedback

@Jahan-Shah

Posted

Hi 👋. Well done on completing this challenge. To improve your code I've got some feedback

HTML:

  • Use Semantic elements like <section>, article> instead of using <div>. Use the <main> tag to wrap all the main content in your HTML file to improve the accessibility of your page.

  • You must include one heading 1 (h1). Even though there is no use of the h1 you should create an <h1> element in your HTML file that is inclusively hidden but readable to screen readers. You can copy this style to do that. e.g: <h1 class="sr-only">Age Calculator App</h1>.

  • Use <label> tag above <input> instead if using <div> and <span> for more accessablity. e.g:

<label for="day">Day</label>
<input placeholder="DD" type="number" id="day"  />

Feedback on functionality

  • The user is able to enter future dates, which can be solved with a check, by getting the current year from the Date function.
  • The user is able to enter an invalid date like 30th Feb which is invalid. You can look into that too.

Answer to your question We use external js file just like an external CSS file, so that we can easily manage our code. If only a little bit of javascript is used that you can do that in an HTML file. But it is preferable to use external js file as the code gets bigger and bigger, it get difficult to manage the code.

I hope this helps you 😄

Marked as helpful

0

Ruan Mesquita• 70

@RuHd

Posted

@Jahan-Shah Thank You Jahan for the feedback! It's been awhile since I began to code but I never had this kind of experience having my projects receiving feedback. I really appreciate it! :)

1

@Jahan-Shah

Posted

@RuHd I'm glad to help you. Also, the last thing you should do is upload your code properly to the GitHub repository so that it can be reviewed in detail. :)

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