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 Age Calculator

@Arfirpo

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


Hi everybody! 👋

This is a solution to the Age calculator app challenge on Frontend Mentor.

  • PS: I don’t quite understand how to animate the transition of numbers (bonus of the challenge), if anyone could guide me at this point I would thank them.
  • PS2: if someone wanted to check my javascript code and suggest how to improve it would be great. Saludos!

The challenge 🎯

Users should be able to:

  • View an age in years, months, and days after submitting a valid date through the form
  • Receive validation errors if:
    • Any field is empty when the form is submitted
    • The day number is not between 1-31
    • The month number is not between 1-12
    • The year is in the future
    • The date is invalid e.g. 31/04/1991 (there are 30 days in April)
  • View the optimal layout for the interface depending on their device's screen size
  • See hover and focus states for all interactive elements on the page
  • Bonus: See the age numbers animate to their final number when the form is submitted

Links 🔗

My process ⚙️

Built with 🛠️

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Javascript

What I learned 📚

This work was a real challenge when testing my skills with javascript, mainly when I had to create the functionalities of error messages for inputs and also to assemble the age calculation. With this challenge I began to get into the management of functions and calculations.

Continued development 🔨

In the following challenges I want to improve my javascript skills. I must strengthen my knowledge and management of functions, field validation and much more.

Author 🙋🏻‍♂️

Community feedback

@Mohammed-Faisal9

Posted

hi Agustín Firpo, your solution is good, but it needs some improvement, For example, if the user enters a negative number, you can stop the count and show him an error, and if enter a year above the current year. To do animate the transition of numbers you should read about setInterval method in JavaScript I hope we can communicate to improve our skills.

Marked as helpful

0

@Arfirpo

Posted

@Mohammed-Faisal9 thanks for the tips, we will stay in touch. Greetings!

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