jljorgenson18 / simplesmoothscroll Goto Github PK
View Code? Open in Web Editor NEWA module to simply scroll to an element on the page in a butter smooth fashion
Home Page: https://jljorgenson18.github.io/simplesmoothscroll/
License: MIT License
A module to simply scroll to an element on the page in a butter smooth fashion
Home Page: https://jljorgenson18.github.io/simplesmoothscroll/
License: MIT License
Try to get PhantomJS working with it. It may need a polyfill for request animation frame
When I initially wrote this, I used some pretty crappy variable names that weren't very descriptive. Time to simplify everything and have a more descriptive flow.
Add the ability to load in smoothScroll in a way that doesn't require a bundler. Ultimately, all of the utility functions should be in an anonymous function as not to invade the global scope and then the main smoothScroll function should be exported.
When scrolling to an element on the page, there is a currently a check to see if the bottom of the window has been hit. As of right now, hitting the bottom is not smooth because sss thinks it still needs to scroll to that target element. The distance between the bottom of the page, the target element, and the window height should all be factored in to find the appropriate distance.
As of right now, the math is somewhat unclear. The easing function using trig should be abstracted out.
Referencing pageYOffset requires layout calculations (https://gist.github.com/paulirish/5d52fb081b3570c81e3a). A better approach would be to see how close the result of the easing function is close to '1.' We can add a percentage buffer to handle rounding errors which should stop the need to reference pageYOffset.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.