codeforcauseorg / edu-client

Product focuses on 100% education as well as upskilling developing countries and rural areas.
https://educlient.codeforcause.org/
MIT License
128 stars 148 forks source link

Convert Scroll To Top button as a FAB #277

Closed dhwaj1902 closed 3 years ago

dhwaj1902 commented 3 years ago

Currently, the scroll to top button is at the bottom of the page, and we have to add ScrollToTop Component on every page separately. Like this: image

There can be a FAB(Floating Action Button) at the right bottom side of the screen, which is activated whenever the screen scroll is greater than some value, say 400. Like this:

if (window.pageYOffset > 400) {
      ...
}

And I can implement it in such a way that we do not need to separately include on each and every page.

rizwan2000rm commented 3 years ago

Yes I think floating button would be nice.

Just make sure it doesn't appear until you actually scroll down.

Abhijay007 commented 3 years ago

@dhwaj1902 you can close this issue now :)