@petritnuredini
Posted
Great job on completing the Frontend Mentor challenge! Your Age Calculator App shows off your coding skills nicely. Here are a few suggestions to further refine your project:
-
Use Semantic HTML:
- Replace
<div>
elements with more semantic tags where applicable. For example, use<section>
for distinct sections of content,<header>
for the header area, and<footer>
for your attribution section. This improves accessibility and SEO. - Example:
<div class="container">
could be<section class="container">
.
- Replace
-
JavaScript Validation:
- Implement more robust form validation in JavaScript. Currently, you're checking if the input dates are valid based on whether they are empty or not. Consider adding logic to validate the actual date values entered. For instance, check if the day is within 1-31, the month is within 1-12, and the year is a reasonable number.
- You might also want to add more user feedback for invalid inputs, such as highlighting the input fields in red or showing a specific error message.
-
CSS Refinements:
- For improved readability, consider organizing your CSS properties alphabetically or by type (display, positioning, box model, typography, etc.). This makes it easier to find and edit specific properties as your CSS grows.
- Utilize CSS variables for commonly used values like colors and font sizes. You've started this in the
:root
selector, which is great. Consistently using these variables throughout your CSS will make theme adjustments much easier in the future.
Helpful Resources:
- Semantic HTML: MDN Web Docs - HTML elements reference
- Form Validation: MDN Web Docs - Client-side form validation
- Organizing CSS: CSS-Tricks - Strategies for Keeping CSS Specificity Low
Keep up the fantastic work, and continue challenging yourself. Each project you build strengthens your skills and portfolio. Happy coding! ๐๐จโ๐ป
Marked as helpful
@ilkerkarahan
Posted
hello there @petritnuredini
Thank you for your feedback. Yes, I need to use semantic HTML, I will be careful about that.
I checked whether the date entered during form validation was an existing date by assigning it to input:type'date'. I also used an error message and red border for incorrect date entries.