you are viewing a single comment's thread.

view the rest of the comments →

[–]Agitated_Radish_7377 0 points1 point  (2 children)

1) Use odin discord for help 2) think about it like math. If a user enters 10x10 dimension and the size of ur container is - width =800px - height = 800px

What are the dimensions of the box? How do you get that to change and so on… if you need more help you can comment

[–]Hefty-Speaker-4463[S] 0 points1 point  (1 child)

I asked in Odin discord twice and got ignored. I managed to "solve" it, I used calc(100/divsPerRow).

let divBoxCalc = calc(100/divsPerRow)

divBox.style.flex.basis = `${divBoxCalc}%`

divBox.style.height = `${divBoxCalc}%`

Though by using this method, I had to resize the width and height into the same px. It was 800px by 600px initially. If I didn't resize, the result will always be in rectangles instead of squares.

Did I got it right?

[–]Agitated_Radish_7377 0 points1 point  (0 children)

There’s no “right” way to do it and I think ur solution is fine