Code Monkey home page Code Monkey logo

sarthak-0-sach / age-calculator-app_frontend_project Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 0.0 683 KB

Welcome to the Age Calculator App, your reliable tool for instant age calculation. With seamless form validation and error handling, users can accurately determine their age. Built with HTML, CSS, and vanilla JavaScript, this project showcases modern web development techniques. Experience responsive design and intuitive user interactions today!πŸ˜‡πŸš€

Home Page: https://age-calculator-app-frontend.netlify.app/

License: MIT License

HTML 25.06% CSS 38.29% JavaScript 36.65%
agecalculator animation css desktop-first error-handling html js nextjs nodejs project react responsive responsive-design web webdevelopment

age-calculator-app_frontend_project's Introduction

Age Calculator App

Welcome! πŸ‘‹

Table of contents

Overview

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 date 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

I have ensured to provide an intuitive user experience with responsive design and error handling for accurate age calculation.

How to setup the project

To set up the project locally, follow these steps:

  1. Clone the repository using GitHub Desktop or Git Bash:
    https://github.com/SartHak-0-Sach/Age-calculator-app_frontend_project.git
  2. Open the project folder in your code editor.
  3. Run the project using a live server extension or deploy it using Netlify, Vercel, or another web hosting and deployment service.

Screenshot

Design preview for the Age Calculator app coding challenge

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS
  • Flexbox
  • DOM manipulation
  • Vanilla JavaScript

You will find all the required assets in the /design folder. The assets are already optimized.

What I learned

This project requires programmer to be well versed with date and time methods of JavaScript along with DOM manipulation to show error as shown below

js = proud of this function

function onError(element, message) {
    const inputControl = element.parentElement;
    const errorDisplay = inputControl.querySelector(".feedback");
    const input = inputControl.querySelector(".form-control");
    const label = inputControl.querySelector(".form-label");
    label.classList.add("color-red");
    input.classList.add("border-red");
    errorDisplay.innerHTML = `<p class="color-red validation-text error">${message}</p>`;
    inputControl.classList.remove("success");
}

Continued development

The continuously learning journey of a programmer never ends. This project made me realize that there are many concepts that I need to work upon including fundamentals like flex-box and its properties, to more complex concepts like working with fetch and async await in javascript. These areas are some that I think I need to work more upon in the upcoming future as they highlight some of the most significant regions of web development that are important for every developer to know of.

These key points mentioned here will help me grow accountable and consistent towards improving at writing good quality code and be a successful full stack developer one day.

Useful resources

  • mdn documentation DOM - This is an amazing article which helped me finally understand promises, async and await syntax. I'd recommend it to anyone still learning this concept.
  • Harkirat Singh course notes - I have added notes of all lectures along with code and lecture insights of all weeks along with bonus lectures to help you all as much as I can.
  • My development code and notes - These are my notes that I made while working on my development skills in initial days and did these courses. Make sure to star the repository if you like it.βœ¨πŸ’«

Author

Sarthak Sachdev

Acknowledgments

I feel like the solutions provided on the website and the continuous doubt solving by industry experts on discord for free is something that is unmatched by anyone else and need to be acknowledged for their efforts in improving me as a developer by suggesting the best practices in your respective tech stack.

Got feedback for me?

I love receiving feedback! I am always looking to improve my code and take up new innovative ideas to work upon. So if you have anything you'd like to mention, please email 'hi' at saarsaach30[at]gmail[dot]com.

If you liked this project make sure to spread the word and share it with all your friends.

Happy calculating! β˜ΊοΈπŸš€

age-calculator-app_frontend_project's People

Contributors

sarthak-0-sach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.