Guys, hello everyone. There is a small site on which I want to make a calculator. The problem is that the calculator will consist of several stages:
- Select box type
- The choice of box size (depends on the type of box, i.e. each type has its own dimensions)
- The choice of filling (Depends on the size of the box, for each size of its content)
And so on, only 6-7 stages. The problem is that I really don't want to write a huge function containing only "if - else if". I thought to do the following: make a JSON file that will store all the information, and from there it will be parsed through js. Here are only torment me with doubts, am I doing the right thing? Or is there a more rational way?
The simplest thing I thought to do was create divs that I would open and hide, depending on what the user chooses. But then it turns out that you need to create a lot of divs, which can have a bad effect on the site loading, and this is not good.
Tell me, please, what is more correct to choose in this case? Thank you in advance! :)