Exactly. This is what CSS Animations [1] were made for.
And you don't even need to do collision detection, as CSS can already alternate directions and loop infinitely.
https://bouncing-logo-css.glitch.me/
Just needed a tiny bit of JS to set the sizes and randomise the logo colour.
[1] https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animati...