Can I shift a float 1 using a float 2 as the UV?

I’ve not been able to directly do as I’ve shown above but I think I’ve got something that works for what I want. I’ve lerped between red and blue here as a proxy for if it’s travelling left/right or up/down and by how much. I’ve then taken the ddx and ddy to show the edges of each and if they’re moving together or apart. I’ve then added these values for the red mask and blue mask to get the edges of each cell and if they’re colliding or moving apart. I think from here I can fake what I was hoping to achieve above although at the moment the lines are quite thin and I’d like to expand them a bit more.