{"_id":"@deli/locomotive-scroll","_rev":"1-f29b1914364cfcee36c0a4fb04bf7fb0","name":"@deli/locomotive-scroll","dist-tags":{"latest":"3.1.5"},"versions":{"3.1.5":{"name":"@deli/locomotive-scroll","version":"3.1.5","description":"Detection of elements in viewport & smooth scrolling with parallax effects.","repository":{"type":"git","url":"git+https://github.com/locomotivemtl/locomotive-scroll.git"},"author":{"name":"Locomotive","email":"info@locomotive.ca","url":"https://locomotive.ca"},"license":"MIT","main":"dist/locomotive-scroll.js","module":"dist/locomotive-scroll.esm.js","dependencies":{"smoothscroll-polyfill":"^0.4.4","virtual-scroll":"git+https://github.com/ayamflow/virtual-scroll.git"},"devDependencies":{"@modularbp/gulp":"^1.0.5","@modularbp/gulp-build":"^1.0.1","@modularbp/gulp-error":"^1.0.3","@modularbp/gulp-js":"^1.0.8","@modularbp/gulp-notify":"^1.0.3","@modularbp/gulp-sass":"^1.0.7","@modularbp/gulp-serve":"^1.0.5","@modularbp/gulp-svg":"^1.0.5","@modularbp/gulp-watch":"^1.0.5","gulp-header":"^2.0.9","mbp":"^1.1.3","merge-stream":"^2.0.0","normalize.css":"*"},"bugs":{"url":"https://github.com/locomotivemtl/locomotive-scroll/issues"},"homepage":"https://github.com/locomotivemtl/locomotive-scroll#readme","directories":{"doc":"docs"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"gitHead":"29d07a8af14e4d9f81212a79e0ec208dbe93d451","_id":"@deli/locomotive-scroll@3.1.5","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-l6ZtsT1gJgd6yFIef1lS6oCL2igyUhN/NdV6SodDVEbvvm2qZVKZRBoIVFa7VPNB/pXPgRL2TP1YP/vChbotow==","shasum":"34d9a5a3b47dba911f8fdb6c7be5715b8dc45a4d","tarball":"https://registry.npmjs.org/@deli/locomotive-scroll/-/locomotive-scroll-3.1.5.tgz","fileCount":25,"unpackedSize":179118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIAiCCRA9TVsSAnZWagAAjbQP/2e0ily4bo1l/uArDRzn\nz2jZiCm0WhKS8VIhYV+eqdjsZHXnqgLaR1ohWk+lmIDr1jCEIObesNL1AMlf\n5HKwsXhW/TuUr0E5gdNUTOvq71VOV3GktTVvOgQILxc6NJN80onNIOX2K7UZ\nQO92v1duqc0OjH+NxGwj5oubbrx1oDw+g7Mlo/RPzdod30Frz2tiokot6Haw\nWQDcXswoTnMIJ+ObblJZ7IIiwgSSpncKM8zbzKLJoJJ6zKXn1QyGXVkDu/Y8\nejuLGrMJ+d787QhRy6elIQwkaMCQDTlFF+uSd4mtcbrj2udkeVeP49lk1s0X\ngt3XPp8s1dxUfuZyeTN5r2qTC3xvjK3eyJ/dkVRKGTQApOzoI63iZv45aswn\nzAGZ4IQbeMFVpKtGEJWg9gWVIfVaK5Jf6/c81/9fxLv7prORV6QECO6qvbFf\nKQ0ghPgmUc4lA0M8Y4NGoOUVcbp/ubOnhnCChttoGX03PjVlba2EKAPJ9Lmh\nSDefhf3+arYkNIsZnRtRkB/9S5U3SH1nsor1a5DfZ8OnCjIWBZ9ldseCxOgf\ndZo9bqv1kox5DD5FPptTKj4prKmAeXzzeiu031C6uFZp0+y7Vqmqgv5AKv9x\n2TaEJlxVJtjVx53FZAm+jTw2dGdJUz5VwkKMzYmMUeapGxul7b2WvKMgWXZG\nSVQT\r\n=/tKb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqTwMp39TEJZolmt3RBS//WbPgNq/8OFRo0uYmlU9AtAiEA1YEGic5Rr+5L2P4wNUk0o22RSKdgRlonTgLbo4e+gGY="}]},"maintainers":[{"name":"okg","email":"gawwad.co@gmail.com"}],"_npmUser":{"name":"okg","email":"gawwad.co@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/locomotive-scroll_3.1.5_1579157633751_0.8175574322275299"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-16T06:53:53.609Z","3.1.5":"2020-01-16T06:53:53.916Z","modified":"2022-04-05T03:40:39.284Z"},"maintainers":[{"name":"okg","email":"gawwad.co@gmail.com"}],"description":"Detection of elements in viewport & smooth scrolling with parallax effects.","homepage":"https://github.com/locomotivemtl/locomotive-scroll#readme","repository":{"type":"git","url":"git+https://github.com/locomotivemtl/locomotive-scroll.git"},"author":{"name":"Locomotive","email":"info@locomotive.ca","url":"https://locomotive.ca"},"bugs":{"url":"https://github.com/locomotivemtl/locomotive-scroll/issues"},"license":"MIT","readme":"<p align=\"center\">\n    <a href=\"https://github.com/locomotivemtl/locomotive-boilerplate\">\n        <img src=\"https://user-images.githubusercontent.com/4596862/58807621-67aeec00-85e6-11e9-8e3a-3fe4123ee76c.png\" height=\"140\">\n    </a>\n</p>\n<h1 align=\"center\">Locomotive Scroll</h1>\n<p align=\"center\">Detection of elements in viewport & smooth scrolling with parallax effects.</p>\n\n## Installation\n```sh\nnpm install locomotive-scroll\n```\n\n## Usage\n```js\nimport LocomotiveScroll from 'locomotive-scroll';\n\nconst scroll = new LocomotiveScroll();\n```\n```html\n<h1 data-scroll>Hello</h1>\n<p data-scroll>Text</p>\n```\n\n#### With smooth scrolling\n```js\nimport LocomotiveScroll from 'locomotive-scroll';\n\nconst scroll = new LocomotiveScroll({\n    el: document.querySelector('#js-scroll'),\n    smooth: true\n});\n```\n```html\n<h1 data-scroll data-scroll-speed=\"1\">Hello</h1>\n<p data-scroll data-scroll-speed=\"2\">Text</p>\n```\n\n#### With methods\n```js\nimport LocomotiveScroll from 'locomotive-scroll';\n\nconst scroll = new LocomotiveScroll();\nconst target = document.querySelector('#js-target');\n\nscroll.scrollTo(target);\n```\n\n#### With events\n```js\nimport LocomotiveScroll from 'locomotive-scroll';\n\nconst scroll = new LocomotiveScroll();\n\nscroll.on('call', (func) => {\n    // Using modularJS\n    this.call(...func);\n    // Using jQuery events\n    $(document).trigger(func);\n    // Or do it your own way 😎\n});\n```\n```html\n<!-- Using modularJS -->\n<div data-scroll data-scroll-call=\"function, module\">Trigger</div>\n<!-- Using jQuery events -->\n<div data-scroll data-scroll-call=\"EVENT_NAME\">Trigger</div>\n<!-- Or do it your own way 😎 -->\n<div data-scroll data-scroll-call=\"{y,o,l,o}\">Trigger</div>\n```\n\n## Instance options\n| Option | Type | Default | Description |\n| ------ | ---- | ------- | ----------- |\n| `el` | `object` | `document` | Scroll container element. |\n| `name` | `string` | `'scroll'` | Data attribute prefix (`data-scroll-xxxx`). |\n| `offset` | `array` | `0` | In-view trigger offset. |\n| `repeat` | `boolean` | `false` | Repeat in-view detection. |\n| `smooth` | `boolean` | `false` | Smooth scrolling. |\n| `smoothMobile` | `boolean` | `false` | Smooth scrolling on iOS and Android devices. |\n| `direction` | `string` | `vertical` | Scroll direction. |\n| `inertia` | `number` | `1` | Lerp intensity. |\n| `getDirection` | `boolean` | `false` | Add direction to scroll event. |\n| `getSpeed` | `boolean` | `false` | Add speed to scroll event. |\n| `class` | `string` | `is-inview` | Element in-view class. |\n| `initClass` | `string` | `has-scroll-init` | Initialize class. |\n| `scrollingClass` | `string` | `has-scroll-scrolling` | Is scrolling class. |\n| `draggingClass` | `string` | `has-scroll-dragging` | Is dragging class. |\n| `smoothClass` | `string` | `has-scroll-smooth` | Has smooth scrolling class. |\n| `scrollbarClass` | `string` | `c-scrollbar` | Scrollbar element class. |\n\n## Element attributes\n| Attribute | Values | Description |\n| --------- | ------ | ----------- |\n| `data-scroll` |  | Detect if in-view. |\n| `data-scroll-section` |  | Defines a scrollable section. Splitting your page into sections may improve performance. |\n| `data-scroll-class` | `string` | Element in-view class. |\n| `data-scroll-offset` | `string` | Element in-view trigger offset (ex.: `\"10\"`, `\"100,50%\"`, `\"25%, 15%\"`). |\n| `data-scroll-repeat` | `true`, `false` | Element in-view detection repeat. |\n| `data-scroll-call` | `string` | Element in-view trigger call event. |\n| `data-scroll-speed` | `number` | Element parallax speed. A negative value will reverse the direction. |\n| `data-scroll-target` | `string` | Target element's in-view position. |\n| `data-scroll-position` | `top`, `bottom` | Window position of in-view trigger. |\n| `data-scroll-direction` | `vertical`, `horizontal` | Element's parallax direction. |\n| `data-scroll-delay` | `number` | Element's parallax lerp delay. |\n| `data-scroll-sticky` |  | Sticky element. Starts and stops at `data-scroll-target` position. |\n\n## Instance methods\n| Method | Description | Arguments |\n| ------ | ----------- | --------- |\n| `init()` | Reinitializes the scroll. | |\n| `on(eventName, function)` | Listen [instance events] ⬇. | |\n| `update()` | Updates all element positions.  | |\n| `destroy()` | Destroys the scroll events. | |\n| `start()` | Restarts the scroll events. | |\n| `stop()` | Stops the scroll events. | |\n| `scrollTo(target, offset)` | Scroll to an element. | `target`: dom `object`, selector `string`, `top` or `bottom`  `offset`: `number` |\n\n## Instance events\n| Event | Arguments | Description |\n| ----- | --------- | ----------- |\n| `scroll` | `obj` | Returns scroll instance (position, limit, speed, direction). |\n| `call` | `func` | Trigger if in-view. Returns your `string` or `array` if contains `,`. |\n\n## Dependencies\n| Name | Description |\n| ---- | ----------- |\n| [Virtual Scroll] | Custom scroll event with inertia/momentum. |\n| [modularScroll] | Elements in viewport detection. Forked from it, not a dependency. |\n\n[instance events]: #instance-events\n[Virtual Scroll]: https://github.com/ayamflow/virtual-scroll\n[modularScroll]:  https://github.com/modularorg/modularscroll\n","readmeFilename":"README.md"}