Loading repository data…
Loading repository data…
Yashi-Singh-9 / repository
A simple web application that calculates a user's age in years, months, and days based on a provided date. The app features form validation, responsive design, and dynamic error handling for invalid or incomplete inputs. Built with HTML, CSS, JavaScript, and LESS.
This is a solution to the Age calculator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
Desktop Screenshot
Mobile Screenshot
This project helped me to practice:
Form Validation:
LESS Preprocessor:
Dynamic Error Messaging:
function showError(input, errorElement, message) {
input.classList.add("error");
input.previousElementSibling.classList.add("error");
errorElement.textContent = message;
}
In the future, I want to:
Install Node.js: If you don't already have Node.js installed, download it from Node.js and follow the installation instructions.
Install LESS: Open your terminal and run:
npm install -g less
This will globally install LESS on your system.
To compile your .less files into .css, follow these steps:
Navigate to your project directory in the terminal.
Run the following command to compile the LESS file into CSS:
lessc style.less style.css
Link the generated style.css file in your HTML <head>.
For automatic compilation, you can use a watcher tool like less-watch-compiler:
npm install -g less-watch-compiler
less-watch-compiler less css
This will watch your LESS files for changes and automatically compile them to CSS.
Thanks to Frontend Mentor for providing such a practical and engaging challenge. It was a great opportunity to polish my JavaScript and LESS skills.