I’m almost done with my Twitch API Project but had a question regarding CSS Grid/Flexbox.
Right now when I decrease the width of the browser to lower than 506px the games-row collapses and no longer aligns properly with the rest of the columns.
How do I get it so that when the games-row collapses, it just increases the height of the whole row so that all the information is still properly aligned?
Adding the suggested CSS code helps keep everything in the rows aligned but I actually want the rows to wrap while still being aligned.
For instance, when the row with username CRETETION, and the game “Tom Clancy’s The Division” collapses into 2 rows, I want the username, status, and viewers of that row to take up 2 rows (1 row with the information, and a blank row below it) so all the rows are still aligned.
The way you did it right now it’s impossible. You currently have only 2 rows: title row and content row and what you think are individual rows are just a text in column. For example add border to .user-game and see that it’s just a one single element.
Your problem is in your javascript. Currently you’re going through columns and filling them with spans. What you should do is create rows consisting of username, status, game and viewers and appending those rows to .main (or any other container).
So I updated my JS using .insertAdjacentHTML with template literals (thanks again for the suggestion/insight) but now I am unable to access any of the elements I have created using .insertAdjacentHTML (line 48-51 in my JS). Is there a different method of selecting elements created using .insertAdjacentHTML that I am unaware of?
You probably don’t need to fetch data each time user click “Online”/“Offline”/“All”, just filtering local data would be enough and it would be much much faster.