rotating cuboid form

How we can create a single box rotate form using HTML CSS JS? Solution: Check out this Rotating Cuboid Form With CSS and JavaScript, Rotate Cube Fields.

Previously I have shared many form programs, but this is a rotating cube form. Basically, we use the form in websites to collecting or checking user’s data, which could be personal details, bank details, interest, or anything else. And commonly form take an area and show all the fields on a single page, some show partly in a multi-step form. But this unique form with a single box and button, after filling details and pressing the next button the box will rotate like a cuboid and reveal another field.

Today you will learn to create Rotate Cube Fields as a form. Basically, there is a rectangular box with a button on the right side actually, the box is an input field with a placeholder and the button is to submit or go next. When you will put characters in the box and click on the button, then the box will rotate like a 3D cube and reveal another field. There are 5 input fields for name, email, country, state, and number. Also, There is counting text in the top of the box, for indicating the process.

So, Today I am sharing Rotating Cuboid Form With CSS and JavaScript. There I have used CSS for creating the elements and JavaScript for a little bit functioning. There I have not used jQuery or any other JS library, this is a pure JavaScript and CSS program. You can create it a lot better after modification, also you can use it on your website or project.

If you are thinking now how this 3D cube form actually is, then see the preview given below.

Preview Of Rotate 3D Cube Input Fields

See this video preview to getting an idea of how this cuboid form looks like.

Live Demo

Now you can see this visually, also you can see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

Rotating Cuboid Form With CSS and JavaScript Source Code

Before sharing source code, let’s talk about it. First I have created a main div named container, and placed div sets with inputs inside it. Inside a div, I have placed an input and another div for the button. Also, I have created extra divs for other elements like progress text, and end welcome button. In the HTML file, I have linked other files like CSS and JS.

Now using CSS I have placed all the elements in the right place, as you can see in the preview. There I have used CSS transform-style: preserve-3d; command in every element using selector method. I have done basic works like position, size, margin, padding, etc. Also, I have used other command like perspective and transform for 3D rotating cube.

JavaScript handling here next, progress features in the program. There I have used JS if{} else{} commands and also used for loop to run the function till the end of inputs. Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files. First for HTML, second for CSS, and the third file for JavaScript. Follow the steps to creating this without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put the codes given below.

function.js

The final step, create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created Rotating Cuboid Form With CSS and JavaScript, Rotate Cube Fields. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

2 COMMENTS

  1. Hi Shaan
    Please How do I go Ahead and send this to an Email with PHP or other methods ?
    Your help will be really appreciated
    Thanks

LEAVE A REPLY

Please enter your comment!
Please enter your name here