├── .eslintrc ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build ├── asscroll.js └── asscroll.min.js ├── css ├── index.css └── scrollTop.css ├── docs ├── README.hbs ├── banner.jpg └── scope.hbs ├── package-lock.json ├── package.json ├── src ├── Controller.js ├── E.js ├── Events.js ├── Scrollbar.js ├── index.js ├── store.js └── utils │ └── debounce.js ├── types ├── Controller.d.ts ├── E.d.ts ├── Events.d.ts ├── Scrollbar.d.ts ├── index.d.ts ├── store.d.ts └── utils │ └── debounce.d.ts └── webpack.config.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": "standard", 4 | "env": { 5 | "browser": true, 6 | "commonjs": true, 7 | "es6": true, 8 | "node": true 9 | }, 10 | "globals": { 11 | "store": true 12 | }, 13 | "rules": { 14 | "no-tabs": "off", 15 | "indent": ["error", "tab", { 16 | "SwitchCase": 1 17 | }], 18 | "eol-last": "off", 19 | "quotes": "off", 20 | "no-floating-decimal": "off", 21 | "space-before-function-paren": ["error", { 22 | "anonymous": "ignore", 23 | "named": "never", 24 | "asyncArrow": "always" 25 | }] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | mix-manifest.json 3 | demo 4 | .npmrc 5 | .vscode -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 🍑 Changelog 2 | === 3 | 4 | ## 2.0.0 - 06/05/2021 5 | _This release includes some breaking changes - see "Updated" below._ 6 | 7 | - Removed support for IE11 and updated targeted browser compatibility, resulting in a package size reduction of over 30% 8 | - Added JSDoc to enable auto-completion and type-hinting. This is also used to generate accurate README documentation 9 | - The check to determine screen refresh rate only runs briefly after initialising ASScroll, stopping continuous calls to `performance.now()` thus slightly increasing performance 10 | 11 | ### New 12 | - The container element and scroll element(s) can now be sent to ASScroll as `HTMLElement` / `NodeList` meaning you can pre-select rather than make ASScroll select them again via `document.querySelector()` ([#47](https://github.com/ashthornton/asscroll/issues/47)) 13 | - Exposed `maxScroll`, `containerElement`, `scrollElements` and `isHorizontal` 14 | - Added `scrollEnd` event which fires when the lerped scroll position reaches its target 15 | - Added example to show how ASScroll works with PJAX navigation 16 | - Added example showing ASScroll + DOM/WebGL syncing 17 | 18 | ### Updated 19 | - `ASScroll.scrollPos` and `ASScroll.smoothScrollPos` have been renamed to `ASScroll.targetPos` and `ASScroll.currentPos` respectively. This is to better represent what these values mean 20 | - `ASScroll.targetPos` and `ASScroll.currentPos` now return positive values rather than the negative Y translate value used to transform the scroll element(s). This should make it more intuitive when using these values in your own code 21 | - `ASScroll.onRaf()` and `ASScroll.onResize()` have been renamed to `ASScroll.update()` and `ASScroll.resize()` respectively 22 | - `ASScroll.enable()` and `ASScroll.disable()` now accept an object as their parameter so you can pass only the options you need to 23 | - The `element` and `innerElement` options have been renamed to `containerElement` and `scrollElements` respectively 24 | - The `disableOnTouch` option has been renamed to `touchScrollType` - see [docs](https://github.com/ashthornton/asscroll#touch-devices) for more info 25 | 26 | ### Fixed 27 | - Scrollbar did not match the mouse position when dragging which caused scroll jumps ([#12](https://github.com/ashthornton/asscroll/issues/12)) 28 | - Using `