23 | See how experienced developers solve problems in real-time. Watching scripted tutorials is great,
24 | but understanding how developers think is invaluable.
25 |
26 |
27 |
28 |
29 |
Try it free 7 days then $20/mo. thereafter
30 |
31 |
42 |
By clicking the button, you are agreeing to our Terms and Services
43 |
44 |
45 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Intro Component Signup Form
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 | Enroll in our coding course with ease using the Intro Component Signup Form!
25 |
26 | This signup component allows users to-
27 | - View the optimal layout for the site depending on their device's screen size
28 | - See hover states for all interactive elements on the page
29 | - Receive error messages when the form is submitted if any input field is empty or if the email address is not formatted correctly.
30 |
31 | ### How to setup the project
32 |
33 | To set up the project locally, follow these steps:
34 |
35 | 1. Clone the repository using GitHub Desktop or Git Bash:
36 | ```bash
37 | git clone https://github.com/SartHak-0-Sach/Intro-component-signup-form_frontend_project.git
38 | ```
39 | 2. Open the project folder in your code editor.
40 | 3. Run the project using a live server extension or deploy it using Netlify, Vercel, or another web hosting and deployment service.
41 |
42 | ### Screenshot
43 |
44 | 
45 |
46 | ### Links
47 |
48 | - Solution URL: [GitHub Repository](https://github.com/SartHak-0-Sach/Intro-component-signup-form_frontend_project)
49 | - Live Site URL: [Live Site](https://signup-form-intro-component.netlify.app/)
50 |
51 | ## My process
52 |
53 | ### Built with
54 |
55 | - HTML5
56 | - CSS3
57 | - JavaScript
58 |
59 | You will find all the required assets in the `/design` folder. The assets are already optimized.
60 |
61 | There is also a `style-guide.md` file containing the information you'll need, such as color palette and fonts.
62 |
63 | ### What I learned
64 |
65 | This project taught me how to use input validation using JavaScript which was implemented to validate first name, last name and email. Following snippet is one good example of the same-
66 |
67 | ```js
68 | function validateFirstName(firstname) {
69 | let regex = /^[\w'\-,.][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*(){}|~<>;:[\]]{2,}$/;
70 |
71 | if (regex.test(firstname) === true) {
72 | nameerror.style.visibility = "hidden";
73 | erroricon1.style.visibility = "hidden";
74 | } else {
75 | nameerror.style.visibility = "visible";
76 | erroricon1.style.visibility = "visible";
77 | inputFirstName.style.border = "1px solid Red";
78 | }
79 | }
80 |
81 | function validateLasttName(lastname) {
82 | let regex = /^[\w'\-,.][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*(){}|~<>;:[\]]{2,}$/;
83 |
84 | if (regex.test(lastname) === true) {
85 | lastnameerror.style.visibility = "hidden";
86 | erroricon2.style.visibility = "hidden";
87 | } else {
88 | lastnameerror.style.visibility = "visible";
89 | erroricon2.style.visibility = "visible";
90 | inputLastName.style.border = "1px solid Red";
91 | }
92 | }
93 | ```
94 |
95 | ### Continued development
96 |
97 | 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.
98 |
99 | 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.
100 |
101 | ### Useful resources
102 |
103 | - [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.
104 | - [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.✨💫
105 | - [MDN documentation hover state for CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/:hover) - This is an amazing article which helped me finally understand hover states. I'd recommend it to anyone still learning this concept.
106 |
107 | ## Author
108 |
109 | Sarthak Sachdev
110 | - Website - [Sarthak Sachdev](https://itsmesarthak.netlify.app/)
111 | - LeetCode - [@sarthak_sachdev](https://leetcode.com/u/sarthak_sachdev/)
112 | - Twitter - [@sarthak_sach69](https://www.twitter.com/sarthak_sach69)
113 |
114 | ## Acknowledgments
115 |
116 | 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.
117 |
118 | ## Got feedback for me?
119 |
120 | 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.
121 |
122 | If you liked this project make sure to spread the word and share it with all your friends.
123 |
124 | **Happy coding!** ☺️🚀
125 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | margin: 0;
4 | padding: 0;
5 | }
6 |
7 | .attribution { font-size: 0.5rem; text-align: center; }
8 | .attribution a { color: hsl(228, 45%, 44%); }
9 |
10 |
11 | :root{
12 | /* ### Primary */
13 |
14 | --primary-Red: hsl(0, 100%, 74%);
15 | --primary-Green: hsl(154, 59%, 51%);
16 |
17 | /* ### Accent */
18 |
19 | --accent-Blue: hsl(248, 32%, 49%);
20 |
21 | /* ### Neutral */
22 |
23 | --neutral-DarkBlue: hsl(249, 10%, 26%);
24 | --neutral-Grayish-Blue: hsl(246, 25%, 77%);
25 |
26 | }
27 |
28 | body{
29 | font-family: "Poppins", sans-serif;
30 | min-height: 100vh;
31 | margin-top: -25px
32 | }
33 |
34 | .main-container {
35 | width: 100%;
36 | height: 100%;
37 | display: flex;
38 | flex-direction: column;
39 | align-items: center;
40 | background-image: url(images/bg-intro-mobile.png);
41 | background-color: var(--primary-Red);
42 | padding: 100px 20px 20px 20px;
43 | }
44 |
45 | .text-container{
46 | display: flex;
47 | flex-direction: column;
48 | text-align: center;
49 | align-items: center;
50 | justify-content: center;
51 | color: white;
52 | gap: 20px;
53 | margin-bottom: 50px;
54 | line-height: 1.5;
55 | }
56 |
57 | .title{
58 | font-size: 1.5rem;
59 | width: 90%;
60 | font-weight: 700;
61 | }
62 |
63 | .description{
64 | font-size: 1rem;
65 | width: 90%;
66 | text-align: center;
67 | opacity: 80%;
68 | font-weight: 600;
69 | }
70 |
71 | .purple-button{
72 | background-color: var(--accent-Blue);
73 | color: white;
74 | padding: 20px 60px;
75 | border-radius: 10px;
76 | text-align: center;
77 | font-weight: 200;
78 | font-size: 1rem;
79 | box-shadow: 0px 5px 5px hsl(0, 36%, 50%);;
80 | margin-bottom: 20px;
81 | }
82 |
83 | .form-container{
84 | display: flex;
85 | flex-direction: column;
86 | background-color: white;
87 | padding: 20px;
88 | min-height: 400px;
89 | border-radius: 10px;
90 | margin-bottom: 50px;
91 | position: relative;
92 | }
93 |
94 | form{
95 | display: flex;
96 | flex-direction: column;
97 | justify-content: space-evenly;
98 | }
99 |
100 | input{
101 | width: 100%;
102 | height: 50px;
103 | padding-left: 20px;
104 | border-radius: 5px;
105 | border:1px solid rgb(197, 197, 197);
106 | outline: none;
107 | font-size: 1rem;
108 | }
109 |
110 | input:focus{
111 | border: 1px solid;
112 | }
113 |
114 | .input-wrapper{
115 | position: relative;
116 | }
117 |
118 | #erroricon1, #erroricon2, #erroricon3, #erroricon4{
119 | color: #191919;
120 | position: absolute;
121 | right: 12px;
122 | top: 50%;
123 | transform: translateY(-50%);
124 | visibility: hidden;
125 | }
126 |
127 |
128 | #nameerror, #lastnameerror, #emailerror, #passerror{
129 | color: var(--primary-Red);
130 | font-size: 0.7rem;
131 | font-style: italic;
132 | margin: 5px 0px;
133 | text-align: right;
134 | visibility: hidden;
135 | }
136 |
137 |
138 |
139 | #button{
140 | background-color: var(--primary-Green);
141 | padding: 15px 10px;
142 | font-size: 0.8rem;
143 | color: white;
144 | margin-bottom: 15px;
145 | border-radius: 5px;
146 | cursor: pointer;
147 | }
148 |
149 | .disclaimer{
150 | font-size: 0.6rem;
151 | color: rgb(197, 184, 184);
152 | text-align: center;
153 | padding: 0 30px
154 | }
155 |
156 | span{
157 | color: var(--primary-Red);
158 | font-weight: 600;
159 | }
160 |
161 | #button:hover{
162 | background-color: hsl(154, 66%, 69%);
163 | }
164 |
165 | .attribution{
166 | position: absolute;
167 | transform: translate(-50%, -50%);
168 |
169 | }
170 |
171 | /* ------------------------------MEDIA QUERIES-------------------------- */
172 |
173 | @media screen and (min-width:900px) {
174 | .main-container {
175 | width: 100%;
176 | min-height: 100vh;
177 | display: flex;
178 | flex-direction: row;
179 | align-items: center;
180 | justify-content: center;
181 | gap: 60px;
182 | background-image: url(images/bg-intro-desktop.png);
183 | background-color: var(--primary-Red);
184 | position: relative;
185 | }
186 |
187 | .text-container{
188 | display: flex;
189 | flex-direction: column;
190 | align-items: flex-start;
191 | justify-content: left;
192 | text-align: left;
193 | width: 40%;
194 | color: white;
195 | gap: 20px;
196 | margin-bottom: 50px;
197 | line-height: 1.5;
198 |
199 | }
200 |
201 | .title{
202 | font-size: 2.5rem;
203 | text-align: left;
204 | font-weight: 700;
205 | line-height: 1.2;
206 | }
207 |
208 | .description{
209 | font-size: 1rem;
210 | text-align: left;
211 | opacity: 80%;
212 | font-weight: 600;
213 | }
214 |
215 | .right-main-container{
216 | width: 40%;
217 | height: auto;
218 | }
219 |
220 | .purple-button{
221 | background-color: var(--accent-Blue);
222 | color: white;
223 | padding: 20px 60px;
224 | border-radius: 10px;
225 | text-align: center;
226 | font-weight: 200;
227 | font-size: 1rem;
228 | box-shadow: 0px 5px 5px hsl(0, 36%, 50%);
229 | margin-bottom: 20px;
230 | }
231 |
232 | .form-container{
233 | display: flex;
234 | flex-direction: column;
235 | background-color: white;
236 | min-height: 500px;
237 | border-radius: 10px;
238 | padding: 30px;
239 | box-shadow: 0px 5px 5px hsl(0, 36%, 50%);
240 |
241 | }
242 |
243 | form{
244 | display: flex;
245 | flex-direction: column;
246 | justify-content: space-between;
247 | }
248 |
249 | input{
250 | padding: 30px 20px;
251 | border-radius: 5px;
252 | outline: none;
253 | }
254 |
255 | button{
256 | background-color: var(--primary-Green);
257 | padding: 15px 10px;
258 | font-size: 0.8rem;
259 | color: white;
260 | margin-bottom: 15px;
261 | border-radius: 5px;
262 | }
263 |
264 | .disclaimer{
265 | font-size: 0.6rem;
266 | color: rgb(197, 184, 184);
267 | text-align: center;
268 | padding: 0 30px
269 | }
270 |
271 | span{
272 | color: var(--primary-Red);
273 | font-weight: 600;
274 | }
275 |
276 | .attribution{
277 | position: absolute;
278 | bottom: 0;
279 | left: 50%;
280 | transform: translate(-50%, -50%);
281 | }
282 | }
283 |
--------------------------------------------------------------------------------