The physics simulation is achieved with Matter.js. To make the ball bounce on text, the size and position of the divs were calculated into the canvas to create the collision bodies. When the window resizes, the canvas will get rerendered to re-calibrate.
Besides canvas, I also used the Framer Motion library to create smooth transitions and parallax scrolling effects.