A mass suspended on a spring oscillates under the action of the Earth's gravity. The assembly is composed of two parts, the "base", which is grounded, and the "mass", which is suspended on top of the spring. At time zero the spring length equals it's natural length1, so the spring is always under compression. An ideal (massless) spring is modeled. There is no damping, so the total mechanical energy of the system remains constant. The two parts are connected through a cylindrical joint. Since the center of mass of the slider and the two points of connection of the spring are perfectly aligned with the gravity vector, the cylindrical joint does not experience force or torque.
The two videos below show the isometric-view of the assembly. The Earth's gravity points to global negative Y-axis. The left video shows the spring force in the reference frame of the base (red), and the base weight vector (white)2. The video on the right shows the spring force in the reference frame of the slider, along with weight and d'Alembert force. Since angular acceleration iz zero, the d'Alembert torque is also zero.