Sorry but sand physics is probably doable in a few kb (yes, that's kilobytes) of JS.
This is different and simpler but just 140 bytes (not k): https://codepen.io/KilledByAPixel/pen/WNGQWZG
Nothing in that game justifies being more than 1mb (being very generous...) minified as a browser app.