Input: pink shaft.
This is a simple way to convert rotary motion to reciprocating motion. Both input and output shafts are in line with each other.
The right half of the device is a spatial reciprocator. Rotating the input crank causes its link to oscillate. A second connecting link then converts that oscillation into the desired in-line output motion.
Rotary axes of the pink shaft and the orange crank, axis ot revolution joint between the orange crank and violet part, axis ot revolution joint between the pink shaft and grey part must be concurrent.