Improved Smooth Scroll
The sample in this codepen hides the obvious. If you want to use it, a variable in the function must be silenced, or rather commented out:
// var target = document.querySelector(".last");
If the line remains, the function will allways have .last as it's target ... (sic).
After this small revision you can use the function, like this: