This version is old school.
Please find jQuery plugins on npm.
iTopPage - imageless 'Top of the Page' plugin for jQuery
Showing a colored gradient box with a white arrow from a specified point, when user scrolling down to the bottom of the page.