Hello Developers! Are you looking to create a sleek and professional Sign in & Sign up form for your website? In today’s digital landscape, user-friendly and visually appealing forms are essential for providing a seamless user experience. Our step-by-step tutorial blog will guide you through the process of creating a visually appealing and responsive Sign in & Sign up form using HTML, CSS, and JS.
I. Setting Up the Project | HTML JS CSS
To begin, let’s set up the project by following these steps:
- Create a New HTML File:
Start by creating a new HTML file using your preferred code editor. This file will serve as the foundation for your Sign in & Sign up form. - Linking Font Awesome Libraries and CSS Stylesheet:
Incorporate Font Awesome libraries by linking the necessary CSS file in the head section of your HTML file. This will provide access to a wide range of icons that can be used in your form. Additionally, link an external CSS stylesheet to style the form elements and layout.
II. Creating the Sign in Form
The Sign in form is crucial for users who already have an account. Follow these steps to create an attractive and functional Sign in form:
- Structure the HTML Form:
Use the HTML form element to create the structure of the Sign in form. Include input fields for the username and password, along with a submit button. - Styling the Input Fields and Icons:
Utilize CSS to style the input fields, such as setting appropriate font sizes, colors, and padding. Enhance the visual appeal by incorporating Font Awesome icons alongside the input fields. - Adding Social Media Icons:
Enhance the Sign in form by including social media icons, enabling users to sign in using their preferred social platform. Use Font Awesome icons or other icon libraries to add social media icons and link them to the respective sign-in functionalities. - Styling the Sign in Form:
Apply CSS styles to the Sign in form container, input fields, buttons, and social media icons to create a cohesive and visually appealing design. Use CSS properties like background color, border radius, and box-shadow to add depth and visual interest.
III. Creating the Sign up Form
The Sign up form is crucial for new users who want to create an account. Follow these steps to create an enticing and user-friendly Sign up form:
- Structure the HTML Form:
Use the HTML form element to structure the Sign up form. Include input fields for the username, email, and password, along with a submit button. - Styling the Input Fields and Icons:
Apply CSS styles to the input fields, similar to the Sign in form, to ensure consistency in design. Add icons to the input fields for a visually appealing touch. - Adding Social Media Icons:
Just like in the Sign in form, include social media icons in the Sign up form to offer users the option to sign up using their preferred social platform. - Styling the Sign up Form:
Use CSS to style the Sign up form, maintaining a cohesive design with the Sign in form. Pay attention to the placement of form elements, color schemes, and typography.
IV. Building the Panel Container
To provide a smooth transition between the Sign in and Sign up forms, let’s create a panel container:
- Structure the HTML for the Panel Container:
Create a container element that will hold the panels for signing in and signing up. Use HTML elements such as divs to structure the panels. - Styling the Panels for Sign in and Sign up:
Apply CSS styles to the panels, setting their width, height, and positioning. Use CSS properties like flexbox or grid to align the panels horizontally or vertically, depending on your desired layout. Apply appropriate background colors, borders, and spacing to differentiate between the Sign in and Sign up panels.
V. Adding Functionality with JavaScript To enhance the user experience
let’s incorporate JavaScript to allow seamless switching between the Sign in and Sign up panels:
- Linking the JavaScript File: Create a new JavaScript file and link it to your HTML file. This will enable us to add functionality to the form.
- Implementing Panel Switching: Use JavaScript to add event listeners to the Sign in and Sign up buttons within the panels. When clicked, these buttons will toggle between the Sign in and Sign up panels, providing a smooth transition.
- Validating User Input: Utilize JavaScript to validate user input, ensuring that the required fields are filled out correctly before submitting the form. Implement validation checks for the username, password, and email fields.
VI. Testing and Responsiveness
To ensure that your Sign in & Sign up form works flawlessly across different devices, it’s essential to test its responsiveness:
- Testing on Various Devices: Open your form on different devices such as desktops, laptops, tablets, and mobile devices. Check if the layout and functionality remain consistent and user-friendly across all screen sizes.
- Implementing Media Queries: Use CSS media queries to adjust the layout and styling of your form based on the screen size. This ensures that the form remains visually appealing and functional on devices of all dimensions.
Conclusion: Creating a sleek and professional Sign in & Sign up form using HTML, CSS, and JS is an essential step in designing a user-friendly website. By following our step-by-step tutorial, you’ll be able to create a visually appealing and responsive form, incorporating stylish input fields, social media icons, and seamless panel switching. Remember to test your form on various devices
Video Tutorial
Source Codes
index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" /> <link rel="stylesheet" href="styles.css"> <title>signin-signup</title> </head> <body> <div class="container"> <div class="signin-signup"> <form action="" class="sign-in-form"> <h2 class="title">Sign in</h2> <div class="input-field"> <i class="fas fa-user"></i> <input type="text" placeholder="Username"> </div> <div class="input-field"> <i class="fas fa-lock"></i> <input type="password" placeholder="Password"> </div> <input type="submit" value="Login" class="btn"> <p class="social-text">Or Sign in with social platform</p> <div class="social-media"> <a href="#" class="social-icon"> <i class="fab fa-facebook"></i> </a> <a href="" class="social-icon"> <i class="fab fa-twitter"></i> </a> <a href="" class="social-icon"> <i class="fab fa-google"></i> </a> <a href="" class="social-icon"> <i class="fab fa-linkedin-in"></i> </a> </div> <p class="account-text">Don't have an account? <a href="#" id="sign-up-btn2">Sign up</a></p> </form> <form action="" class="sign-up-form"> <h2 class="title">Sign up</h2> <div class="input-field"> <i class="fas fa-user"></i> <input type="text" placeholder="Username"> </div> <div class="input-field"> <i class="fas fa-envelope"></i> <input type="text" placeholder="Email"> </div> <div class="input-field"> <i class="fas fa-lock"></i> <input type="password" placeholder="Password"> </div> <input type="submit" value="Sign up" class="btn"> <p class="social-text">Or Sign in with social platform</p> <div class="social-media"> <a href="#" class="social-icon"> <i class="fab fa-facebook"></i> </a> <a href="" class="social-icon"> <i class="fab fa-twitter"></i> </a> <a href="" class="social-icon"> <i class="fab fa-google"></i> </a> <a href="" class="social-icon"> <i class="fab fa-linkedin-in"></i> </a> </div> <p class="account-text">Already have an account? <a href="#" id="sign-in-btn2">Sign in</a></p> </form> </div> <div class="panels-container"> <div class="panel left-panel"> <div class="content"> <h3>Member of Brand?</h3> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque accusantium dolor, eos incidunt minima iure?</p> <button class="btn" id="sign-in-btn">Sign in</button> </div> <img src="signin.svg" alt="" class="image"> </div> <div class="panel right-panel"> <div class="content"> <h3>New to Brand?</h3> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque accusantium dolor, eos incidunt minima iure?</p> <button class="btn" id="sign-up-btn">Sign up</button> </div> <img src="signup.svg" alt="" class="image"> </div> </div> </div> <script src="app.js"></script> </body> </html>
styles.css
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; } body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #444; } .container { position: relative; width: 70vw; height: 80vh; background: #fff; border-radius: 15px; box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.3), 0 6px 20px 0 rgba(0, 0, 0, 0.3); overflow: hidden; } .container::before { content: ""; position: absolute; top: 0; left: -50%; width: 100%; height: 100%; background: linear-gradient(-45deg, #df4adf, #520852); z-index: 6; transform: translateX(100%); transition: 1s ease-in-out; } .signin-signup { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-around; z-index: 5; } form { display: flex; align-items: center; justify-content: center; flex-direction: column; width: 40%; min-width: 238px; padding: 0 10px; } form.sign-in-form { opacity: 1; transition: 0.5s ease-in-out; transition-delay: 1s; } form.sign-up-form { opacity: 0; transition: 0.5s ease-in-out; transition-delay: 1s; } .title { font-size: 35px; color: #df4adf; margin-bottom: 10px; } .input-field { width: 100%; height: 50px; background: #f0f0f0; margin: 10px 0; border: 2px solid #df4adf; border-radius: 50px; display: flex; align-items: center; } .input-field i { flex: 1; text-align: center; color: #666; font-size: 18px; } .input-field input { flex: 5; background: none; border: none; outline: none; width: 100%; font-size: 18px; font-weight: 600; color: #444; } .btn { width: 150px; height: 50px; border: none; border-radius: 50px; background: #df4adf; color: #fff; font-weight: 600; margin: 10px 0; text-transform: uppercase; cursor: pointer; } .btn:hover { background: #c03cc0; } .social-text { margin: 10px 0; font-size: 16px; } .social-media { display: flex; justify-content: center; } .social-icon { height: 45px; width: 45px; display: flex; align-items: center; justify-content: center; color: #444; border: 1px solid #444; border-radius: 50px; margin: 0 5px; } a { text-decoration: none; } .social-icon:hover { color: #df4adf; border-color: #df4adf; } .panels-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-around; } .panel { display: flex; flex-direction: column; align-items: center; justify-content: space-around; width: 35%; min-width: 238px; padding: 0 10px; text-align: center; z-index: 6; } .left-panel { pointer-events: none; } .content { color: #fff; transition: 1.1s ease-in-out; transition-delay: 0.5s; } .panel h3 { font-size: 24px; font-weight: 600; } .panel p { font-size: 15px; padding: 10px 0; } .image { width: 100%; transition: 1.1s ease-in-out; transition-delay: 0.4s; } .left-panel .image, .left-panel .content { transform: translateX(-200%); } .right-panel .image, .right-panel .content { transform: translateX(0); } .account-text { display: none; } /*Animation*/ .container.sign-up-mode::before { transform: translateX(0); } .container.sign-up-mode .right-panel .image, .container.sign-up-mode .right-panel .content { transform: translateX(200%); } .container.sign-up-mode .left-panel .image, .container.sign-up-mode .left-panel .content { transform: translateX(0); } .container.sign-up-mode form.sign-in-form { opacity: 0; } .container.sign-up-mode form.sign-up-form { opacity: 1; } .container.sign-up-mode .right-panel { pointer-events: none; } .container.sign-up-mode .left-panel { pointer-events: all; } /*Responsive*/ @media (max-width:779px) { .container { width: 100vw; height: 100vh; } } @media (max-width:635px) { .container::before { display: none; } form { width: 80%; } form.sign-up-form { display: none; } .container.sign-up-mode2 form.sign-up-form { display: flex; opacity: 1; } .container.sign-up-mode2 form.sign-in-form { display: none; } .panels-container { display: none; } .account-text { display: initial; margin-top: 30px; } } @media (max-width:320px) { form { width: 90%; } }
app.js
const sign_in_btn = document.querySelector("#sign-in-btn"); const sign_up_btn = document.querySelector("#sign-up-btn"); const container = document.querySelector(".container"); const sign_in_btn2 = document.querySelector("#sign-in-btn2"); const sign_up_btn2 = document.querySelector("#sign-up-btn2"); sign_up_btn.addEventListener("click", () => { container.classList.add("sign-up-mode"); }); sign_in_btn.addEventListener("click", () => { container.classList.remove("sign-up-mode"); }); sign_up_btn2.addEventListener("click", () => { container.classList.add("sign-up-mode2"); }); sign_in_btn2.addEventListener("click", () => { container.classList.remove("sign-up-mode2"); });
Don’t forget to Subscribe to our YouTube Channel for more.
You are the best and you can do everything
Thank you For your hard work over the years!
Thank you For your hard work over the years! For this, we give you the opportunity.
Push it to the limit cool Wolf! You are the best and you can do everything! It’ll all work out very very very soon!
I visited multiple blogs еxcept the audio quality fоr audio songs
existing аt tһis web ⲣage іs genuinely excellent.
Normally I do not read article on blogs, but I would like
to say that this write-up very compelled me to check out and do so!
Your writing style has been surprised me. Thank you, quite great article.
I could not refrain from commenting. Perfectly written!
Pretty nice post. I just stumbled upon your weblog and wished to say that I’ve truly enjoyed browsing your blog posts.
After all I will be subscribing to your feed and I
hope you write again very soon!
Appreciate this post. Will try it out.
Thank you for sharing your thoughts. I truly appreciate your efforts and I am waiting for your further write ups thank you once again.
I have read a few good stuff here. Definitely worth bookmarking for revisiting.
I wonder how a lot effort you put to create such
a magnificent informative web site.
Thanks for sharing your thoughts about DEANED.
Regards
Remarkable issues here. I am very satisfied to peer your article.
Thank you so much and I’m having a look forward to
touch you. Will you please drop me a e-mail?
Good way of explaining, and nice piece of writing to get information about my presentation subject matter,
which i am going to convey in institution of higher education.
Hi there, just became alert to your blog through Google, and found that it is really informative.
I am going to watch out for brussels. I will be grateful if you continue this in future.
Lots of people will be benefited from your writing.
Cheers!
Unquestionably believe that which you said. Your favorite reason appeared to be on the web the easiest
thing to be aware of. I say to you, I definitely get irked while people consider worries that they just don’t know about.
You managed to hit the nail upon the top as well as
defined out the whole thing without having side-effects , people could take a signal.
Will probably be back to get more. Thanks
Thanks for another informative web site. The place else may just I get that kind of information written in such an ideal manner?
I’ve a project that I’m simply now operating on, and I have been on the glance out for such info.
It’s going to be end of mine day, except before
end I am reading this wonderful paragraph to improve my
knowledge.
I don’t even know how I ended up here, but I thought this publish was great.
I don’t understand who you are but definitely you’re going to a well-known blogger for those who
aren’t already. Cheers!
It’s difficult to find knowledgeable people in this particular topic, however,
you sound like you know what you’re talking about!
Thanks
Very shortly this web site will be famous amid all blogging visitors, due to it’s fastidious articles
Simply want to say your article is as astounding.
The clarity in your post is simply excellent and
i can assume you’re an expert on this subject.
Fine with your permission allow me to grab your feed to keep
updated with forthcoming post. Thanks a million and please continue the enjoyable work.
I always used to read article in news papers but now as I
am a user of net so from now I am using net for articles or
reviews, thanks to web.
I like what you guys tend to be up too. This kind of clever work and reporting!
Keep up the great works guys I’ve incorporated you guys to my personal blogroll.
This is the right site for everyone who hopes to find out about this topic.
You know so much its almost tough to argue with you (not that I personally will need to…HaHa).
You certainly put a fresh spin on a subject that has been written about for a long time.
Wonderful stuff, just wonderful!
I enjoy what you guys are usually up too. This sort of clever work and coverage!
Keep up the great works guys I’ve included you guys to my personal blogroll.
whoah this blog is excellent i like reading your posts.
Stay up the great work! You realize, many persons are
searching around for this information, you could aid
them greatly.
It’s really very complex in this full of activity life to listen news on TV, therefore I just use
the web for that purpose, and take the latest news.
Hello to every , as I am genuinely keen of reading this web site’s post to be updated
daily. It includes nice information.
Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.
I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience
with something like this. Please let me know if you run into
anything. I truly enjoy reading your blog and I look forward to your new updates.
Hi there very cool blog!! Guy .. Beautiful ..
Amazing .. I’ll bookmark your web site and take the feeds also?
I am glad to search out a lot of helpful info here in the put up, we want work out extra techniques
on this regard, thank you for sharing. . . . .
.
We are a group of volunteers and starting a new scheme in our community.
Your web site provided us with valuable information to work on.
You’ve done an impressive job and our entire community will be thankful to you.
What’s up, every time i used to check blog posts here early in the
break of day, since i like to gain knowledge of more
and more.
Hi, I do think this is a great website. I stumbledupon it 😉 I am going
to revisit once again since I book-marked it. Money and freedom is the best way to change, may
you be rich and continue to guide other people.
I think the admin of this web site is in fact working hard in favor of his website, since
here every data is quality based information.
Hi there, You have done a fantastic job. I will certainly digg it
and personally recommend to my friends. I’m sure they’ll be benefited from this site.
You really make it seem so easy with your presentation but
I find this matter to be really something which I think I would never understand.
It seems too complex and extremely broad for me. I am looking forward for your next post, I’ll
try to get the hang of it!
Hi there, I want to subscribe for this web site to obtain latest updates, therefore where can i do
it please help.
I am really thankful to the owner of this web page who has shared this great article at
at this place.
It’s very simple to find out any matter on web as compared to
books, as I found this paragraph at this web site.
This is a topic which is close to my heart… Thank you!
Where are your contact details though?
I go to see every day a few sites and blogs to read
articles, however this weblog gives quality based articles.
Excellent post. I was checking constantly this blog and I’m impressed!
Very helpful info specifically the last part 🙂 I care for such info
much. I was looking for this particular info for a long time.
Thank you and best of luck.
Hurrah, that’s what I was searching for, what a information! present here at this web site,
thanks admin of this site.
Definitely, what a great blog and revealing posts, I definitely will bookmark your site. Best Regards!
I think this is one of the most important info
for me. And i’m glad reading your article. But wanna remark on few general things,
The web site style is wonderful, the articles is really excellent :
D. Good job, cheers
We’re a gaggle of volunteers and opening a new scheme in our community.
Your site offered us with useful information to work on.
You’ve done a formidable activity and our whole group can be grateful to you.
I’ll right away take hold of your rss as I can not find your
email subscription hyperlink or e-newsletter
service. Do you’ve any? Kindly let me recognize so that I may just
subscribe. Thanks.
It’s an amazing article designed for all the web visitors; they will
take advantage from it I am sure.
Appreciating the dedication you put into your blog and in depth information you provide.
It’s good to come across a blog every once in a while that isn’t the
same old rehashed material. Great read! I’ve saved your site and I’m adding your RSS feeds to my
Google account.
This site was… how do you say it? Relevant!! Finally I’ve found something that helped me.
Thanks a lot!
Saved as a favorite, I really like your website!