Skip to content

Commit 55792f1

Browse files
committed
first Commit
1 parent 1b7ba68 commit 55792f1

23 files changed

+553
-2
lines changed

README-template.md

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Frontend Mentor - Age calculator app solution
2+
3+
This is a solution to the [Age calculator app challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/age-calculator-app-dF9DFFpj-Q). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
4+
5+
## Table of contents
6+
7+
- [Overview](#overview)
8+
- [The challenge](#the-challenge)
9+
- [Screenshot](#screenshot)
10+
- [Links](#links)
11+
- [My process](#my-process)
12+
- [Built with](#built-with)
13+
- [What I learned](#what-i-learned)
14+
- [Continued development](#continued-development)
15+
- [Useful resources](#useful-resources)
16+
- [Author](#author)
17+
- [Acknowledgments](#acknowledgments)
18+
19+
**Note: Delete this note and update the table of contents based on what sections you keep.**
20+
21+
## Overview
22+
23+
### The challenge
24+
25+
Users should be able to:
26+
27+
- View an age in years, months, and days after submitting a valid date through the form
28+
- Receive validation errors if:
29+
- Any field is empty when the form is submitted
30+
- The day number is not between 1-31
31+
- The month number is not between 1-12
32+
- The year is in the future
33+
- The date is invalid e.g. 31/04/1991 (there are 30 days in April)
34+
- View the optimal layout for the interface depending on their device's screen size
35+
- See hover and focus states for all interactive elements on the page
36+
- **Bonus**: See the age numbers animate to their final number when the form is submitted
37+
38+
### Screenshot
39+
40+
![](./screenshot.jpg)
41+
42+
Add a screenshot of your solution. The easiest way to do this is to use Firefox to view your project, right-click the page and select "Take a Screenshot". You can choose either a full-height screenshot or a cropped one based on how long the page is. If it's very long, it might be best to crop it.
43+
44+
Alternatively, you can use a tool like [FireShot](https://getfireshot.com/) to take the screenshot. FireShot has a free option, so you don't need to purchase it.
45+
46+
Then crop/optimize/edit your image however you like, add it to your project, and update the file path in the image above.
47+
48+
**Note: Delete this note and the paragraphs above when you add your screenshot. If you prefer not to add a screenshot, feel free to remove this entire section.**
49+
50+
### Links
51+
52+
- Solution URL: [Add solution URL here](https://your-solution-url.com)
53+
- Live Site URL: [Add live site URL here](https://your-live-site-url.com)
54+
55+
## My process
56+
57+
### Built with
58+
59+
- Semantic HTML5 markup
60+
- CSS custom properties
61+
- Flexbox
62+
- CSS Grid
63+
- Mobile-first workflow
64+
- [React](https://reactjs.org/) - JS library
65+
- [Next.js](https://nextjs.org/) - React framework
66+
- [Styled Components](https://styled-components.com/) - For styles
67+
68+
**Note: These are just examples. Delete this note and replace the list above with your own choices**
69+
70+
### What I learned
71+
72+
Use this section to recap over some of your major learnings while working through this project. Writing these out and providing code samples of areas you want to highlight is a great way to reinforce your own knowledge.
73+
74+
To see how you can add code snippets, see below:
75+
76+
```html
77+
<h1>Some HTML code I'm proud of</h1>
78+
```
79+
```css
80+
.proud-of-this-css {
81+
color: papayawhip;
82+
}
83+
```
84+
```js
85+
const proudOfThisFunc = () => {
86+
console.log('🎉')
87+
}
88+
```
89+
90+
If you want more help with writing markdown, we'd recommend checking out [The Markdown Guide](https://www.markdownguide.org/) to learn more.
91+
92+
**Note: Delete this note and the content within this section and replace with your own learnings.**
93+
94+
### Continued development
95+
96+
Use this section to outline areas that you want to continue focusing on in future projects. These could be concepts you're still not completely comfortable with or techniques you found useful that you want to refine and perfect.
97+
98+
**Note: Delete this note and the content within this section and replace with your own plans for continued development.**
99+
100+
### Useful resources
101+
102+
- [Example resource 1](https://www.example.com) - This helped me for XYZ reason. I really liked this pattern and will use it going forward.
103+
- [Example resource 2](https://www.example.com) - This is an amazing article which helped me finally understand XYZ. I'd recommend it to anyone still learning this concept.
104+
105+
**Note: Delete this note and replace the list above with resources that helped you during the challenge. These could come in handy for anyone viewing your solution or for yourself when you look back on this project in the future.**
106+
107+
## Author
108+
109+
- Website - [Add your name here](https://www.your-site.com)
110+
- Frontend Mentor - [@yourusername](https://www.frontendmentor.io/profile/yourusername)
111+
- Twitter - [@yourusername](https://www.twitter.com/yourusername)
112+
113+
**Note: Delete this note and add/remove/edit lines above based on what links you'd like to share.**
114+
115+
## Acknowledgments
116+
117+
This is where you can give a hat tip to anyone who helped you out on this project. Perhaps you worked in a team or got some inspiration from someone else's solution. This is the perfect place to give them some credit.
118+
119+
**Note: Delete this note and edit this section's content as necessary. If you completed this challenge by yourself, feel free to delete this section entirely.**

README.md

+102-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,102 @@
1-
# CalculatorAge
2-
un formulaire qui calcule l'age par rapport a la date de naissance saisie par l'utilisateur et qui affiche en suit l'age de la personne par jour, mois et annee.
1+
# Frontend Mentor - Age calculator app
2+
3+
![Design preview for the Age calculator app coding challenge](./design/desktop-preview.jpg)
4+
5+
## Welcome! 👋
6+
7+
Thanks for checking out this front-end coding challenge.
8+
9+
[Frontend Mentor](https://www.frontendmentor.io) challenges help you improve your coding skills by building realistic projects.
10+
11+
**To do this challenge, you need a decent understanding of HTML, CSS and JavaScript.**
12+
13+
## The challenge
14+
15+
Your challenge is to build out this age calculator app and get it looking as close to the design as possible.
16+
17+
You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go.
18+
19+
Your users should be able to:
20+
21+
- View an age in years, months, and days after submitting a valid date through the form
22+
- Receive validation errors if:
23+
- Any field is empty when the form is submitted
24+
- The day number is not between 1-31
25+
- The month number is not between 1-12
26+
- The date is in the future
27+
- The date is invalid e.g. 31/04/1991 (there are 30 days in April)
28+
- View the optimal layout for the interface depending on their device's screen size
29+
- See hover and focus states for all interactive elements on the page
30+
- **Bonus**: See the age numbers animate to their final number when the form is submitted
31+
32+
Want some support on the challenge? [Join our Slack community](https://www.frontendmentor.io/slack) and ask questions in the **#help** channel.
33+
34+
## Where to find everything
35+
36+
Your task is to build out the project to the designs inside the `/design` folder. You will find both a mobile and a desktop version of the design.
37+
38+
The designs are in JPG static format. Using JPGs will mean that you'll need to use your best judgment for styles such as `font-size`, `padding` and `margin`.
39+
40+
If you would like the design files (we provide Sketch & Figma versions) to inspect the design in more detail, you can [subscribe as a PRO member](https://www.frontendmentor.io/pro).
41+
42+
All the required assets for this project are in the `/assets` folder. The images are already exported for the correct screen size and optimized.
43+
44+
We also include variable and static font files for the required fonts for this project. You can choose to either link to Google Fonts or use the local font files to host the fonts yourself. Note that we've removed the static font files for the font weights that aren't needed for this project.
45+
46+
There is also a `style-guide.md` file containing the information you'll need, such as color palette and fonts.
47+
48+
## Building your project
49+
50+
Feel free to use any workflow that you feel comfortable with. Below is a suggested process, but do not feel like you need to follow these steps:
51+
52+
1. Initialize your project as a public repository on [GitHub](https://github.com/). Creating a repo will make it easier to share your code with the community if you need help. If you're not sure how to do this, [have a read-through of this Try Git resource](https://try.github.io/).
53+
2. Configure your repository to publish your code to a web address. This will also be useful if you need some help during a challenge as you can share the URL for your project with your repo URL. There are a number of ways to do this, and we provide some recommendations below.
54+
3. Look through the designs to start planning out how you'll tackle the project. This step is crucial to help you think ahead for CSS classes to create reusable styles.
55+
4. Before adding any styles, structure your content with HTML. Writing your HTML first can help focus your attention on creating well-structured content.
56+
5. Write out the base styles for your project, including general content styles, such as `font-family` and `font-size`.
57+
6. Start adding styles to the top of the page and work down. Only move on to the next section once you're happy you've completed the area you're working on.
58+
59+
## Deploying your project
60+
61+
As mentioned above, there are many ways to host your project for free. Our recommend hosts are:
62+
63+
- [GitHub Pages](https://pages.github.com/)
64+
- [Vercel](https://vercel.com/)
65+
- [Netlify](https://www.netlify.com/)
66+
67+
You can host your site using one of these solutions or any of our other trusted providers. [Read more about our recommended and trusted hosts](https://medium.com/frontend-mentor/frontend-mentor-trusted-hosting-providers-bf000dfebe).
68+
69+
## Create a custom `README.md`
70+
71+
We strongly recommend overwriting this `README.md` with a custom one. We've provided a template inside the [`README-template.md`](./README-template.md) file in this starter code.
72+
73+
The template provides a guide for what to add. A custom `README` will help you explain your project and reflect on your learnings. Please feel free to edit our template as much as you like.
74+
75+
Once you've added your information to the template, delete this file and rename the `README-template.md` file to `README.md`. That will make it show up as your repository's README file.
76+
77+
## Submitting your solution
78+
79+
Submit your solution on the platform for the rest of the community to see. Follow our ["Complete guide to submitting solutions"](https://medium.com/frontend-mentor/a-complete-guide-to-submitting-solutions-on-frontend-mentor-ac6384162248) for tips on how to do this.
80+
81+
Remember, if you're looking for feedback on your solution, be sure to ask questions when submitting it. The more specific and detailed you are with your questions, the higher the chance you'll get valuable feedback from the community.
82+
83+
## Sharing your solution
84+
85+
There are multiple places you can share your solution:
86+
87+
1. Share your solution page in the **#finished-projects** channel of the [Slack community](https://www.frontendmentor.io/slack).
88+
2. Tweet [@frontendmentor](https://twitter.com/frontendmentor) and mention **@frontendmentor**, including the repo and live URLs in the tweet. We'd love to take a look at what you've built and help share it around.
89+
3. Share your solution on other social channels like LinkedIn.
90+
4. Blog about your experience building your project. Writing about your workflow, technical choices, and talking through your code is a brilliant way to reinforce what you've learned. Great platforms to write on are [dev.to](https://dev.to/), [Hashnode](https://hashnode.com/), and [CodeNewbie](https://community.codenewbie.org/).
91+
92+
We provide templates to help you share your solution once you've submitted it on the platform. Please do edit them and include specific questions when you're looking for feedback.
93+
94+
The more specific you are with your questions the more likely it is that another member of the community will give you feedback.
95+
96+
## Got feedback for us?
97+
98+
We love receiving feedback! We're always looking to improve our challenges and our platform. So if you have anything you'd like to mention, please email hi[at]frontendmentor[dot]io.
99+
100+
This challenge is completely free. Please share it with anyone who will find it useful for practice.
101+
102+
**Have fun building!** 🚀

assets/fonts/OFL.txt

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins)
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
http://scripts.sil.org/OFL
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.

assets/fonts/Poppins-Bold.ttf

150 KB
Binary file not shown.

assets/fonts/Poppins-BoldItalic.ttf

172 KB
Binary file not shown.

assets/fonts/Poppins-ExtraBold.ttf

149 KB
Binary file not shown.
170 KB
Binary file not shown.

assets/fonts/Poppins-Italic.ttf

178 KB
Binary file not shown.

assets/fonts/Poppins-Regular.ttf

155 KB
Binary file not shown.

assets/images/favicon-32x32.png

1.04 KB
Loading

assets/images/icon-arrow.svg

+1
Loading

design/active-states.jpg

34.3 KB
Loading

design/desktop-completed.jpg

33.6 KB
Loading

design/desktop-design.jpg

28.5 KB
Loading

design/desktop-error-empty.jpg

33.9 KB
Loading

design/desktop-error-invalid.jpg

34 KB
Loading

design/desktop-error-whole-form.jpg

31.7 KB
Loading

design/desktop-preview.jpg

38.7 KB
Loading

design/mobile-design.jpg

16.1 KB
Loading

index.html

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<!-- displays site properly based on user's device -->
7+
<link
8+
rel="icon"
9+
type="image/png"
10+
sizes="32x32"
11+
href="./assets/images/favicon-32x32.png"
12+
/>
13+
<link rel="stylesheet" href="./stylesheet.css" />
14+
<title>Frontend Mentor | Age calculator app</title>
15+
<!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
16+
</head>
17+
<body>
18+
<section class="card">
19+
<section>
20+
<form action="" method="get" id="ageCalculator">
21+
<section class="form-section">
22+
<section class="form-control">
23+
<label for="">DAY</label>
24+
<input type="number" id="day" placeholder="DD" />
25+
</section>
26+
<section class="form-control">
27+
<label for="">MONTH</label>
28+
<input type="number" id="month" placeholder="MM" />
29+
</section>
30+
<section class="form-control">
31+
<label for="">YEAR</label>
32+
<input type="number" id="year" placeholder="YYYY" />
33+
</section>
34+
</section>
35+
<section class="form-button">
36+
<hr>
37+
<img
38+
type="button"
39+
onclick="calculateAge()"
40+
src="./assets/images/icon-arrow.svg"
41+
alt=""
42+
/>
43+
</section>
44+
45+
</form>
46+
</section>
47+
<section id="result">
48+
<h2><span id="years" class="result-span">--</span> Years</h2>
49+
<h2><span id="months" class="result-span">--</span> Months</h2>
50+
<h2><span id="days" class="result-span">--</span> Days</h2>
51+
</section>
52+
<!---<section class="attribution">
53+
Challenge by
54+
<a href="https://www.frontendmentor.io?ref=challenge" target="_blank">
55+
Frontend Mentor</a>. Coded by <a href="#">Your Name Here</a>.
56+
</section> -->
57+
</section>
58+
<script src="script.js"></script>
59+
</body>
60+
</html>

0 commit comments

Comments
 (0)