Hi Matthieu,
Unfortunately we cannot help with implementing a custom solution that was found online as this isn’t theme related – meaning that if you can get the solution to work in a twenty series WP theme, the exact method would work in GeneratePress.
A lot of these Codepen solutions you see might need some extra tweak to work in a WordPress environment as well.
If you are not comfortable with implementing a custom solution like this, I would recommend just going with a slider plugin like Smart Slider 3.
Hope this helps and thanks for your understanding π