How to change div width by dragging


I would like to get the effect similar to the animation below:

Screen Recording 2020-06-10 at 11.57.54

  1. Click to the custom elements on the border
  2. Drag & resize div inside container (only width)

Do I need a custom Js code for this?