I used flexbox to build 3 column layout (now it contains 9 tiles).
Each tile has 33.3333% width. When you click on the tile, then it will be extended to 66.666%.
So we have the grid as in the example below:
(A) In the beginning, all tiles are closed. Each tile has 33.3% width.
(B) After click 4th element (an also another elements from column 1), the 4th element will be animated from left to right (width: 66.6%). All elements after clicked item moves right 1 column.
(C) After click 5th element (an also another elements from column 2), the 5th element will be animated from left to right (width: 66.6%). All elements after clicked item moves right 1 column.
(D) After click 6th element (an also another elements from column 3), the 6th element will be animated from right to left (width: 66.6%). The previous item (in example 5th will go to the next row). All other elements after clicked item moves right.
To summarise, each clicked element stay on the same row (initial position row) and can move elements before/after to the next row.
I suppose that might be connected with the "order" css property row.
I would like to make a nice animation with changing tile width and the effect if we move tiles position. Do you have any idea how I can achieve it?