42 | 43 |
├── .gitignore ├── .vscode ├── c_cpp_properties.json ├── launch.json └── settings.json ├── LICENSE ├── README.md ├── assets ├── fonts │ ├── OFL.txt │ ├── Poppins-Bold.ttf │ ├── Poppins-BoldItalic.ttf │ ├── Poppins-ExtraBold.ttf │ ├── Poppins-ExtraBoldItalic.ttf │ ├── Poppins-Italic.ttf │ └── Poppins-Regular.ttf └── images │ ├── favicon-32x32.png │ └── icon-arrow.svg ├── design ├── active-states.jpg ├── desktop-completed.jpg ├── desktop-design.jpg ├── desktop-error-empty.jpg ├── desktop-error-invalid.jpg ├── desktop-error-whole-form.jpg ├── desktop-preview.jpg └── mobile-design.jpg ├── index.html ├── script.js ├── style-guide.md └── style.css /.gitignore: -------------------------------------------------------------------------------- 1 | # Avoid accidental upload of the Sketch and Figma design files 2 | ##################################################### 3 | ## Please do not remove lines 5 and 6 - thanks! 🙂 ## 4 | ##################################################### 5 | *.sketch 6 | *.fig 7 | 8 | # Avoid accidental XD upload if you convert the design file 9 | ############################################### 10 | ## Please do not remove line 12 - thanks! 🙂 ## 11 | ############################################### 12 | *.xd 13 | 14 | # Avoid your project being littered with annoying .DS_Store files! 15 | .DS_Store 16 | .prettierignore -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "windows-gcc-x86", 5 | "includePath": [ 6 | "${workspaceFolder}/**" 7 | ], 8 | "compilerPath": "C:/MinGW64/bin/gcc.exe", 9 | "cStandard": "${default}", 10 | "cppStandard": "${default}", 11 | "intelliSenseMode": "windows-gcc-x86", 12 | "compilerArgs": [ 13 | "" 14 | ] 15 | } 16 | ], 17 | "version": 4 18 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "C/C++ Runner: Debug Session", 6 | "type": "cppdbg", 7 | "request": "launch", 8 | "args": [], 9 | "stopAtEntry": false, 10 | "externalConsole": true, 11 | "cwd": "c:/Users/saksh/OneDrive/Desktop/github/365-day_daily-problem_challenge/088-28th_march-Longest_subarray_with_freq_K", 12 | "program": "c:/Users/saksh/OneDrive/Desktop/github/365-day_daily-problem_challenge/088-28th_march-Longest_subarray_with_freq_K/build/Debug/outDebug", 13 | "MIMode": "gdb", 14 | "miDebuggerPath": "gdb", 15 | "setupCommands": [ 16 | { 17 | "description": "Enable pretty-printing for gdb", 18 | "text": "-enable-pretty-printing", 19 | "ignoreFailures": true 20 | } 21 | ] 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501, 3 | "C_Cpp_Runner.cCompilerPath": "gcc", 4 | "C_Cpp_Runner.cppCompilerPath": "g++", 5 | "C_Cpp_Runner.debuggerPath": "gdb", 6 | "C_Cpp_Runner.cStandard": "", 7 | "C_Cpp_Runner.cppStandard": "", 8 | "C_Cpp_Runner.msvcBatchPath": "", 9 | "C_Cpp_Runner.useMsvc": false, 10 | "C_Cpp_Runner.warnings": [ 11 | "-Wall", 12 | "-Wextra", 13 | "-Wpedantic", 14 | "-Wshadow", 15 | "-Wformat=2", 16 | "-Wcast-align", 17 | "-Wconversion", 18 | "-Wsign-conversion", 19 | "-Wnull-dereference" 20 | ], 21 | "C_Cpp_Runner.msvcWarnings": [ 22 | "/W4", 23 | "/permissive-", 24 | "/w14242", 25 | "/w14287", 26 | "/w14296", 27 | "/w14311", 28 | "/w14826", 29 | "/w44062", 30 | "/w44242", 31 | "/w14905", 32 | "/w14906", 33 | "/w14263", 34 | "/w44265", 35 | "/w14928" 36 | ], 37 | "C_Cpp_Runner.enableWarnings": true, 38 | "C_Cpp_Runner.warningsAsError": false, 39 | "C_Cpp_Runner.compilerArgs": [], 40 | "C_Cpp_Runner.linkerArgs": [], 41 | "C_Cpp_Runner.includePaths": [], 42 | "C_Cpp_Runner.includeSearch": [ 43 | "*", 44 | "**/*" 45 | ], 46 | "C_Cpp_Runner.excludeSearch": [ 47 | "**/build", 48 | "**/build/**", 49 | "**/.*", 50 | "**/.*/**", 51 | "**/.vscode", 52 | "**/.vscode/**" 53 | ], 54 | "C_Cpp_Runner.useAddressSanitizer": false, 55 | "C_Cpp_Runner.useUndefinedSanitizer": false, 56 | "C_Cpp_Runner.useLeakSanitizer": false, 57 | "C_Cpp_Runner.showCompilationTime": false, 58 | "C_Cpp_Runner.useLinkTimeOptimization": false, 59 | "C_Cpp_Runner.msvcSecureNoWarnings": false 60 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Sarthak Sachdev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Age Calculator App 2 | 3 | ## Welcome! 👋 4 | 5 | ## Table of contents 6 | 7 | - [Overview](#overview) 8 | - [The challenge](#the-challenge) 9 | - [How to setup the project](#how-to-setup-the-project) 10 | - [Screenshot](#screenshot) 11 | - [Links](#links) 12 | - [My process](#my-process) 13 | - [Built with](#built-with) 14 | - [What I learned](#what-i-learned) 15 | - [Continued development](#continued-development) 16 | - [Useful resources](#useful-resources) 17 | - [Author](#author) 18 | - [Acknowledgments](#acknowledgments) 19 | 20 | ## Overview 21 | 22 | ### The challenge 23 | 24 | Users should be able to: 25 | 26 | - View an age in years, months, and days after submitting a valid date through the form 27 | - Receive validation errors if: 28 | - Any field is empty when the form is submitted 29 | - The day number is not between 1-31 30 | - The month number is not between 1-12 31 | - The date is in the future 32 | - The date is invalid e.g. 31/04/1991 (there are 30 days in April) 33 | - View the optimal layout for the interface depending on their device's screen size 34 | - See hover and focus states for all interactive elements on the page 35 | - **Bonus**: See the age numbers animate to their final number when the form is submitted 36 | 37 | I have ensured to provide an intuitive user experience with responsive design and error handling for accurate age calculation. 38 | 39 | ### How to setup the project 40 | 41 | To set up the project locally, follow these steps: 42 | 43 | 1. Clone the repository using GitHub Desktop or Git Bash: 44 | ```bash 45 | https://github.com/SartHak-0-Sach/Age-calculator-app_frontend_project.git 46 | ``` 47 | 2. Open the project folder in your code editor. 48 | 3. Run the project using a live server extension or deploy it using Netlify, Vercel, or another web hosting and deployment service. 49 | 50 | ### Screenshot 51 | 52 |  53 | 54 | ### Links 55 | 56 | - Solution URL: [link to this repo](https://github.com/SartHak-0-Sach/Age-calculator-app_frontend_project) 57 | - Live Site URL: [live site URL](https://age-calculator-app-frontend.netlify.app/) 58 | 59 | ## My process 60 | 61 | ### Built with 62 | 63 | - Semantic HTML5 markup 64 | - CSS 65 | - Flexbox 66 | - DOM manipulation 67 | - Vanilla JavaScript 68 | 69 | You will find all the required assets in the `/design` folder. The assets are already optimized. 70 | 71 | ### What I learned 72 | 73 | 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 74 | 75 | 76 | js = proud of this function 77 | 78 | ``` 79 | function onError(element, message) { 80 | const inputControl = element.parentElement; 81 | const errorDisplay = inputControl.querySelector(".feedback"); 82 | const input = inputControl.querySelector(".form-control"); 83 | const label = inputControl.querySelector(".form-label"); 84 | label.classList.add("color-red"); 85 | input.classList.add("border-red"); 86 | errorDisplay.innerHTML = `
${message}
`; 87 | inputControl.classList.remove("success"); 88 | } 89 | ``` 90 | 91 | ### Continued development 92 | 93 | 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. 94 | 95 | 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. 96 | 97 | ### Useful resources 98 | 99 | - [mdn documentation DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model) - 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. 100 | - [Harkirat Singh course notes](https://github.com/SartHak-0-Sach/harkirat-singh-course_code_and_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. 101 | - [My development code and notes](https://github.com/SartHak-0-Sach/cwh-web-dev-playlist_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.✨💫 102 | 103 | ## Author 104 | 105 | Sarthak Sachdev 106 | - Website - [Sarthak Sachdev](https://itsmesarthak.netlify.app/) 107 | - LeetCode - [@sarthak_sachdev](https://leetcode.com/u/sarthak_sachdev/) 108 | - Twitter - [@sarthak_sach69](https://www.twitter.com/sarthak_sach69) 109 | 110 | ## Acknowledgments 111 | 112 | 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. 113 | 114 | ## Got feedback for me? 115 | 116 | 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. 117 | 118 | If you liked this project make sure to spread the word and share it with all your friends. 119 | 120 | **Happy calculating!** ☺️🚀 121 | -------------------------------------------------------------------------------- /assets/fonts/OFL.txt: -------------------------------------------------------------------------------- 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. 94 | -------------------------------------------------------------------------------- /assets/fonts/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/assets/fonts/Poppins-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/assets/fonts/Poppins-BoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/assets/fonts/Poppins-ExtraBold.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/assets/fonts/Poppins-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/assets/fonts/Poppins-Italic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/assets/fonts/Poppins-Regular.ttf -------------------------------------------------------------------------------- /assets/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/assets/images/favicon-32x32.png -------------------------------------------------------------------------------- /assets/images/icon-arrow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /design/active-states.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/design/active-states.jpg -------------------------------------------------------------------------------- /design/desktop-completed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/design/desktop-completed.jpg -------------------------------------------------------------------------------- /design/desktop-design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/design/desktop-design.jpg -------------------------------------------------------------------------------- /design/desktop-error-empty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/design/desktop-error-empty.jpg -------------------------------------------------------------------------------- /design/desktop-error-invalid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/design/desktop-error-invalid.jpg -------------------------------------------------------------------------------- /design/desktop-error-whole-form.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/design/desktop-error-whole-form.jpg -------------------------------------------------------------------------------- /design/desktop-preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/design/desktop-preview.jpg -------------------------------------------------------------------------------- /design/mobile-design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/all-my-frontend-mini-projects/Age-calculator-app_frontend_project/d655a224b139b37f5955ad8fd5ffaab65d8ee1cd/design/mobile-design.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |${message}
`; 71 | inputControl.classList.remove("success"); 72 | } 73 | 74 | function onSuccess(element) { 75 | const inputControl = element.parentElement; 76 | const errorDisplay = inputControl.querySelector(".feedback"); 77 | const input = inputControl.querySelector(".form-control"); 78 | const label = inputControl.querySelector(".form-label"); 79 | label.classList.remove("color-red"); 80 | input.classList.remove("border-red"); 81 | errorDisplay.innerHTML = ""; 82 | } 83 | 84 | function validateForm(arr) { 85 | if (arr[1] === 3 && arr[0] > 30) { 86 | onError(dayInput, "Must be a valid day"); 87 | } else { 88 | arr[0] > 31 || isNaN(arr[0]) 89 | ? onError(dayInput, "Must be a valid day") 90 | : onSuccess(dayInput); 91 | arr[1] > 12 - 1 || isNaN(arr[1]) 92 | ? onError(monthInput, "Must be a valid month") 93 | : onSuccess(monthInput); 94 | arr[2] > new Date().getFullYear() || isNaN(arr[2]) 95 | ? onError(yearInput, "Must be in the past") 96 | : onSuccess(yearInput); 97 | } 98 | 99 | const hasErrors = 100 | dayInput.classList.contains("border-red") || 101 | monthInput.classList.contains("border-red") || 102 | yearInput.classList.contains("border-red"); 103 | 104 | return hasErrors; // If returns true will not calculate age 105 | } 106 | 107 | function showResult() { 108 | if (validateForm(getInputValues())) { 109 | return; 110 | } else { 111 | calculateAge(); 112 | } 113 | } 114 | 115 | calculateBtn.addEventListener("click", showResult); 116 | 117 | document.addEventListener("keypress", function (e) { 118 | if (e.key === "Enter") { 119 | showResult(); 120 | } 121 | }); -------------------------------------------------------------------------------- /style-guide.md: -------------------------------------------------------------------------------- 1 | # Front-end Style Guide 2 | 3 | ## Layout 4 | 5 | The designs were created to the following widths: 6 | 7 | - Mobile: 375px 8 | - Desktop: 1440px 9 | 10 | ## Colors 11 | 12 | ### Primary 13 | 14 | - Purple: hsl(259, 100%, 65%) 15 | - Light red: hsl(0, 100%, 67%) 16 | 17 | ### Neutral 18 | 19 | - White: hsl(0, 0%, 100%) 20 | - Off white: hsl(0, 0%, 94%) 21 | - Light grey: hsl(0, 0%, 86%) 22 | - Smokey grey: hsl(0, 1%, 44%) 23 | - Off black: hsl(0, 0%, 8%) 24 | 25 | ## Typography 26 | 27 | ### Body Copy 28 | 29 | - Font size (inputs): 32px 30 | 31 | ### Font 32 | 33 | - Family: [Poppins](https://fonts.google.com/specimen/Poppins) 34 | - Weights: 400i, 700, 800i 35 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,700;1,400;1,800&display=swap"); 2 | 3 | :root { 4 | --primary-purple: hsl(259, 100%, 65%); 5 | --primary-red-light: hsl(0, 100%, 67%); 6 | --secundary-white: hsl(0, 0%, 100%); 7 | --secundary-off-white: hsl(0, 0%, 94%); 8 | --secundary-light-gray: hsl(0, 0%, 86%); 9 | --scundary-smokey-gray: hsl(0, 1%, 44%); 10 | --scundary-off-black: hsl(0, 0%, 8%); 11 | --transition: all 0.4s ease; 12 | } 13 | 14 | * { 15 | margin: 0; 16 | padding: 0; 17 | box-sizing: border-box; 18 | } 19 | 20 | body { 21 | overflow: hidden; 22 | font-size: 32px; 23 | font-family: "Poppins", sans-serif !important; 24 | } 25 | 26 | main { 27 | width: 100vw; 28 | height: 100vh; 29 | background-color: var(--secundary-off-white); 30 | } 31 | 32 | .wrapper { 33 | width: 45vw; 34 | max-width: 900px; 35 | height: 70vh; 36 | min-height: 580px; 37 | max-height: 600px; 38 | background-color: var(--secundary-white); 39 | border-radius: 20px 20px 200px 20px; 40 | padding: 50px 40px; 41 | transition: var(--transition); 42 | } 43 | 44 | .wrapper:hover { 45 | box-shadow: 0 2px 5px 2px var(--secundary-light-gray); 46 | } 47 | 48 | form { 49 | margin-bottom: 60px !important; 50 | transition: var(--transition); 51 | } 52 | 53 | label { 54 | font-size: 0.45em; 55 | font-weight: 600; 56 | color: var(--scundary-smokey-gray); 57 | letter-spacing: 2px; 58 | transition: var(--transition); 59 | } 60 | 61 | input::placeholder { 62 | font-size: 34px; 63 | color: var(--scundary-smokey-gray) !important; 64 | font-weight: 600; 65 | transition: var(--transition); 66 | } 67 | 68 | input:focus { 69 | border-color: var(--primary-purple) !important; 70 | border-width: 2px !important; 71 | outline: 0 !important; 72 | box-shadow: none !important; 73 | transition: var(--transition); 74 | } 75 | 76 | input { 77 | height: 60px !important; 78 | padding: 20px !important; 79 | display: flex; 80 | align-items: center; 81 | font-size: 34px !important; 82 | font-weight: 600 !important; 83 | color: var(--scundary-off-black) !important; 84 | transition: var(--transition); 85 | } 86 | 87 | input::-webkit-outer-spin-button, 88 | input::-webkit-inner-spin-button { 89 | -webkit-appearance: none; 90 | margin: 0; 91 | } 92 | 93 | .icon-btn { 94 | background-color: var(--primary-purple); 95 | border-radius: 100%; 96 | height: auto; 97 | width: 3em; 98 | padding: 17px; 99 | position: relative; 100 | top: -60px; 101 | right: -80%; 102 | cursor: pointer; 103 | transition: var(--transition); 104 | } 105 | 106 | .icon-btn:hover { 107 | background-color: var(--scundary-off-black); 108 | } 109 | 110 | .validation-text { 111 | margin-top: 5px; 112 | font-size: 12px; 113 | margin-bottom: -22px; 114 | display: none; 115 | } 116 | 117 | hr { 118 | width: 90%; 119 | transition: var(--transition); 120 | } 121 | 122 | h1, 123 | span { 124 | font-size: 2em; 125 | font-weight: 800; 126 | font-style: italic; 127 | transition: var(--transition); 128 | } 129 | 130 | .age-info { 131 | margin-top: -60px !important; 132 | } 133 | 134 | .color-purple { 135 | color: var(--primary-purple); 136 | } 137 | 138 | .color-red { 139 | color: var(--primary-red-light); 140 | } 141 | 142 | /* Dynamic classes */ 143 | 144 | .border-red { 145 | border-color: var(--primary-red-light) !important; 146 | } 147 | 148 | .error { 149 | display: block; 150 | } 151 | 152 | .success { 153 | display: none; 154 | } 155 | 156 | /* Footer */ 157 | .attribution { 158 | position: absolute; 159 | bottom: .8rem; 160 | left: 50%; 161 | transform: translateX(-50%); 162 | font-size: 11px; 163 | text-align: center; 164 | } 165 | 166 | .attribution a { 167 | color: hsl(228, 45%, 44%); 168 | } 169 | 170 | /* Media queries */ 171 | 172 | @media (max-width: 1200px) { 173 | form { 174 | margin-bottom: 50px; 175 | } 176 | 177 | h1, 178 | span { 179 | font-size: 1.8em; 180 | } 181 | 182 | hr { 183 | width: 100%; 184 | } 185 | 186 | .icon-btn { 187 | width: 2em; 188 | padding: 12px; 189 | top: -50px; 190 | right: -50%; 191 | transform: translateX(-50%); 192 | } 193 | 194 | .age-info { 195 | margin-top: -40px !important; 196 | } 197 | 198 | } 199 | 200 | @media (max-width: 992px) { 201 | 202 | h1, 203 | span { 204 | font-size: 1.6em; 205 | } 206 | 207 | .wrapper { 208 | width: 60vw; 209 | } 210 | 211 | } 212 | 213 | @media (max-width: 768px) { 214 | input { 215 | padding: 10px !important; 216 | font-size: 20px !important; 217 | } 218 | 219 | input::placeholder { 220 | font-size: 20px; 221 | } 222 | } 223 | 224 | @media (max-width: 576px) { 225 | .wrapper { 226 | width: 95vw; 227 | } 228 | 229 | .age-info { 230 | margin-top: 35px; 231 | } 232 | 233 | .validation-text { 234 | font-size: 10px; 235 | } 236 | } 237 | 238 | @media (max-width: 360px) { 239 | 240 | h1, 241 | span { 242 | font-size: 1.2em; 243 | } 244 | 245 | .wrapper { 246 | padding: 50px 20px; 247 | } 248 | 249 | label { 250 | font-size: 0.4em; 251 | } 252 | 253 | input { 254 | font-size: 16px !important; 255 | } 256 | 257 | input::placeholder { 258 | font-size: 16px; 259 | } 260 | 261 | } 262 | --------------------------------------------------------------------------------