Attaching Input to Main Robot

While watching many videos, I saw the the input moved upwards when it came into contact with the purple blocks and green blocks.
It moved upward more for purple, obviously because of size.

My question is, how did others build the input to move upward so it could intake both purple and green cubes.

Thanks