How can I change my Javasscript logic based on breakpoints and element sizes?

I’m trying to figure out how to do just that. I’m storing meta-data in each DIV block with the current X and Y values as well as which direction that particular block can move. For example any given block can only move in one direction, so I might store the word “up” if that block can move up, it’s a quick test.

What I’m finding is that I can’t use abstract concepts to do this. For example I can’t just store “this is on grid position B4” as B4 still has to be related to absolute X,Y values. And the X,Y values are based on the size of the grid blocks.

I just need to put it all together. What would you store in the array if not just X,Y values and which block is stored there?