{"bugs":{"url":"https://github.com/michalsnik/aos/issues"},"dist":{"shasum":"476b2b7fd187175462983619893cc2a71811b607","tarball":"https://registry.npmjs.org/aos/-/aos-3.0.0-beta.1.tgz","fileCount":8,"integrity":"sha512-uYk/YstQFrl2eVDX9fuOLVz+OVRZUNzb/UlmZuKc/WCoR5wQa0PepL0FxO4RrRVLseGmPnQsjoZlqpzDyhe9Lw==","signatures":[{"sig":"MEUCIG+AWushqd+rPg5O+qREfpizBmcIjGLmLtLoUnGzDO1CAiEAzZWvFTB9vg/dXfw3ZVWzHWCoZXfeiG7WlaLbCL8qKrc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":143058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLCPdCRA9TVsSAnZWagAAl+YP/1Hj0UTbWVZDRoAl8U3T\nAfHUbev1HbmpDwKOEAff6tKywexScIMHnMSolOqaWzubMl34OcnWS0OS69DJ\nlDMC5Ida7UTwubGup5LUQrp6FX9SQg2tHSdY8YhriYFvJZvCkwHt/A3CQlSb\neXE61Dz4WO2elj8oPv3aC493izbO7rKJwx9F3xsjRyItjmNjmBo2D/VmLzu3\n5MwsjRq3YRZd/Yjqz0nwwM/kyrkWDIk0p3Hw6GngpPOixt0Bnngp8raTukYO\nfSGIDNB9j7/8UCEF++B9NmGqahkZY2AxSTPBJhYW5ZpiE4dzukyuqN57FJW3\n6sv1Uhsrzh7XsdcGhV1CQQrNSLlliYWbfFhBeAnY/9LjqqrsWimI2yaPPKbb\nwNSrPP5LTaJ98qoEm2CB2yt0pyk09geFTJD62eNEkCIb7MJiDsjOpO673iTJ\n2+2j5LEYzI/6jD+751Dniqy6gSbFyqBJa33cXf20CW4JIc+hGfncxe7NQQX8\n2YcVgxcqYdh7UDUwfzsEgQiNizuFHAdxU+HgRhVFd5ULvik1sF/Kz+aU7DgF\nPE3oT+XTgHBubnrfBOE53xMRBQsfq15sqO1WAqyoOPoLkbK9vT6DfaVlrfEW\nbJ7oyYm0c8SvcOEeI5KkA7iDBRfExxAa5FhYkqRzIBQlHVe6cA+D2VafFCtW\nDjfN\r\n=OTGP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/aos.cjs.js","name":"aos","files":["dist"],"author":{"name":"Michał Sajnóg","email":"michal.sajnog@hotmail.com"},"module":"dist/aos.esm.js","readme":"[![AOS - Animate on scroll library](https://s32.postimg.org/ktvt59hol/aos_header.png)](http://michalsnik.github.io/aos/)\n\n[![NPM version](https://img.shields.io/npm/v/aos.svg?style=flat)](https://npmjs.org/package/aos)\n[![NPM downloads](https://img.shields.io/npm/dm/aos.svg?style=flat)](https://npmjs.org/package/aos)\n[![Build Status](https://travis-ci.org/michalsnik/aos.svg?branch=master)](https://travis-ci.org/michalsnik/aos)\n[![Gitter](https://badges.gitter.im/michalsnik/aos.svg)](https://gitter.im/michalsnik/aos?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n\n[![Twitter Follow](https://img.shields.io/twitter/follow/michalsnik.svg?style=social)](https://twitter.com/michalsnik) [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/home?status=AOS%20-%20Animate%20on%20Scroll%20library%0Ahttps%3A//github.com/michalsnik/aos)\n\n👉 To get a better understanding how this actually works, I encourage you to check [my post on CSS-tricks](https://css-tricks.com/aos-css-driven-scroll-animation-library/).\n\n---\n\n### 🚀 [Demo](http://michalsnik.github.io/aos/)\n\n### 🌟 Codepen Examples\n- [Different built-in animations](http://codepen.io/michalsnik/pen/WxNdvq)\n- [With anchor setting in use](http://codepen.io/michalsnik/pen/jrOYVO)\n- [With anchor-placement and different easings](http://codepen.io/michalsnik/pen/EyxoNm)\n- [With simple custom animations](http://codepen.io/michalsnik/pen/WxvNvE)\n\n---\n\n## ⚙ Installation\n\nAdd styles in `<head>`:\n\n```html\n  <link rel=\"stylesheet\" href=\"https://unpkg.com/aos@next/dist/aos.css\" />\n```\n\nAdd script right before closing `</body>` tag:\n```html\n  <script src=\"https://unpkg.com/aos@next/dist/aos.js\"></script>\n```\n\nYou can also use:\n\n* `yarn add aos@next`\n* `npm install --save aos@next`\n\n## 🤔 How to use it?\n\n### 1. Initialize AOS:\n\n```html\n<script>\n  AOS.init();\n  \n  // You can also pass an optional settings object\n  // below listed default settings\n  AOS.init({\n    offset: 120, // offset (in px) from the original trigger point\n    delay: 0, // values from 0 to 3000, with step 50ms\n    easing: 'ease', // default easing for AOS animations\n    duration: 400, // values from 0 to 3000, with step 50ms\n    disable: false, // accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function\n    once: false, // whether animation should happen only once - while scrolling down\n    mirror: false, // whether elements should animate out while scrolling past them\n    startEvent: 'DOMContentLoaded', // name of the event dispatched on the document, that AOS should initialize on\n    animatedClassName: 'aos-animate', // class applied on animation\n    initClassName: 'aos-init', // class applied after initialization\n    useClassNames: false // if true, will add content of `data-aos` as classes on scroll\n  });\n</script>\n```\n\n### 2. Add attributes on HTML elements:\n\n```html\n  <div data-aos=\"fade-in\"></div>\n```\n\n[See full list of all animations, easings and anchor placements](https://github.com/michalsnik/aos#-animations)\n\n\n#### Available attributes\n\nYou can overwrite some of the global settings on per-element basis by using following attributes:\n* `data-aos-offset`\n* `data-aos-duration`\n* `data-aos-easing`\n* `data-aos-delay`\n* `data-aos-once`\n* `data-aos-mirror`\n\nThere are also few settings that can be used only on per-element basis:\n* `data-aos-anchor` - element whose offset will be used to trigger animation instead of an actual one\n* `data-aos-anchor-placement` (default `top-bottom`) - defines which position of the element regarding to window should trigger the animation. `top-bottom` means that the animation will be triggered once top of the element hits bottom of the screen.\n\nExamples:\n```html\n<div data-aos=\"fade-zoom-in\" data-aos-offset=\"200\" data-aos-easing=\"ease-in-sine\" data-aos-duration=\"600\"></div>\n  \n<div data-aos=\"flip-left\" data-aos-delay=\"100\" data-aos-anchor=\".example-selector\"></div>\n\n<div data-aos=\"fade-up\" data-aos-anchor-placement=\"top-center\"></div>\n```\n\n### API\n\nAOS object is exposed as a global variable, for now there are three methods available:\n\n  * `init` - initialize AOS\n  * `refresh` - recalculate all offsets and positions of elements (called on window resize)\n  * `refreshHard` - reinit array with AOS elements and trigger `refresh` (called on DOM changes that are related to `aos` elements)\n\nExample execution:\n```javascript\n  AOS.refresh();\n```\n\nBy default AOS is watching for DOM changes and if there are any new elements loaded asynchronously or when something is removed from DOM it calls `refreshHard` automatically. In browsers that don't support `MutationObserver` like IE you might need to call `AOS.refreshHard()` by yourself.\n\n`refresh` method is called on window resize and so on, as it doesn't require to build new store with AOS elements and should be as light as possible.\n\n\n### JS Events\n\nAOS dispatches two events on document: `aos:in` and `aos:out` whenever any element animates in or out, so that you can do extra stuff in JS:\n```js\ndocument.addEventListener('aos:in', ({ detail }) => {\n  console.log('animated in', detail);\n});\n\ndocument.addEventListener('aos:out', ({ detail }) => {\n  console.log('animated out', detail);\n});\n```\n\nYou can also tell AOS to trigger custom event on specific element, by setting `data-aos-id` attribute:\n```html\n<div data-aos=\"fade-in\" data-aos-id=\"super-duper\"></div>\n```\n\nThen you'll be able to listen for two custom events then:\n- `aos:in:super-duper`\n- `aos:out:super-duper`\n\n### Recepies:\n\n#### Integrating external CSS animation library (e.g. Animate.css):\nUse `animatedClassName` to change default behaviour of AOS, to apply class names placed inside `data-aos` on scroll.\n\n```html\n<div data-aos=\"fadeInUp\"></div>\n```\n\n```js\nAOS.init({\n  useClassNames: true,\n  initClassName: false,\n  animatedClassName: 'animated',\n});\n```\n\nThe above element will get two classes: `animated` and `fadeInUp`. Using different combinations of the three above settings, you should be able to integrate any external CSS animation library.\n\nExternal libraries however don't care too much about animation state before the actual animation. So if you want those elements to be not visible before scrolling, you might need to add similar styles:\n```css\n[data-aos] {\n  visibility: hidden;\n}\n[data-aos].animated {\n  visibility: visible;\n}\n```\n\n### Caveats:\n\n#### setting: duration:\n*Duration accept values from 50 to 3000, with step 50ms, it's because duration of animation is handled by css, and to not make css longer than it is already I created implementations only in this range. I think this should be good for almost all cases.\n\nIf not, you may write simple CSS on your page that will add another duration option value available, for example:\n\n```css\n  body[data-aos-duration='4000'] [data-aos], [data-aos][data-aos][data-aos-duration='4000']{\n    transition-duration: 4000ms;\n  }\n```\n\nThis code will add 4000ms duration available for you to set on AOS elements, or to set as global duration while initializing AOS script.\n\nNotice that double `[data-aos][data-aos]` - it's not a mistake, it is a trick, to make individual settings more important than global, without need to write ugly \"!important\" there :)\n\n#### setting: startEvent:\nIf you set `startEvent: 'load'` it will add event listener on `window` instead of `document`.\n\n### 👻 Animations\n\nThere are serveral predefined animations you can use already:\n\n  * Fade animations:\n    * fade\n    * fade-up\n    * fade-down\n    * fade-left\n    * fade-right\n    * fade-up-right\n    * fade-up-left\n    * fade-down-right\n    * fade-down-left\n\n  * Flip animations:\n    * flip-up\n    * flip-down\n    * flip-left\n    * flip-right\n\n  * Slide animations:\n    * slide-up\n    * slide-down\n    * slide-left\n    * slide-right\n\n  * Zoom animations:\n    * zoom-in\n    * zoom-in-up\n    * zoom-in-down\n    * zoom-in-left\n    * zoom-in-right\n    * zoom-out\n    * zoom-out-up\n    * zoom-out-down\n    * zoom-out-left\n    * zoom-out-right\n\n### Anchor placement:\n\n  * top-bottom\n  * top-center\n  * top-top\n  * center-bottom\n  * center-center\n  * center-top\n  * bottom-bottom\n  * bottom-center\n  * bottom-top\n\n\n### Easing functions:\n\nYou can choose one of these timing function to animate elements nicely:\n\n  * linear\n  * ease\n  * ease-in\n  * ease-out\n  * ease-in-out\n  * ease-in-back\n  * ease-out-back\n  * ease-in-out-back\n  * ease-in-sine\n  * ease-out-sine\n  * ease-in-out-sine\n  * ease-in-quad\n  * ease-out-quad\n  * ease-in-out-quad\n  * ease-in-cubic\n  * ease-out-cubic\n  * ease-in-out-cubic\n  * ease-in-quart\n  * ease-out-quart\n  * ease-in-out-quart\n\n## ✌️ [Contributing](CONTRIBUTING.md)\n\n## ❔Questions\n\nIf you have any questions, ideas or whatsoever, please check [AOS contribution guide](CONTRIBUTING.md) and don't hesitate to create new issues.\n","browser":"dist/aos.js","gitHead":"4f9b53deb166b7d9ff1cd0c4884db347b55aa823","license":"MIT","scripts":{"dev":"npm-run-all --parallel serve watch","lint":"eslint src cypress demo scripts","test":"yarn lint && NODE_ENV=test node ./scripts/run-cypress-tests.js","build":"NODE_ENV=production rollup -c","serve":"node ./scripts/start-server.js","watch":"NODE_ENV=dev rollup -c -w","prepare":"npm run build","test:dev":"cypress open"},"_npmUser":{"name":"michalsnik","email":"msajnog93@gmail.com"},"homepage":"http://michalsnik.github.io/aos/","repository":{"url":"git+https://github.com/michalsnik/aos.git","type":"git"},"_npmVersion":"6.0.1","description":"Animate on scroll library","directories":{},"maintainers":[{"name":"michalsnik","email":"msajnog93@gmail.com"}],"_nodeVersion":"8.7.0","dependencies":{"lodash.debounce":"^4.0.8","lodash.throttle":"^4.1.1","classlist-polyfill":"^1.2.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"eslint":"^4.19.1","rollup":"^0.58.2","cssnano":"^3.10.0","cypress":"^2.1.0","node-sass":"^4.9.0","babel-core":"^6.26.3","live-server":"github:tapio/live-server#master","npm-run-all":"^4.1.3","autoprefixer":"^8.4.1","babel-eslint":"^8.2.3","babel-preset-env":"^1.7.0","rollup-plugin-babel":"^3.0.4","rollup-plugin-uglify":"^3.0.0","rollup-plugin-postcss":"^1.6.1","eslint-config-prettier":"^2.9.0","eslint-plugin-prettier":"^2.6.0","rollup-plugin-commonjs":"^9.1.3","rollup-plugin-node-resolve":"^3.3.0","babel-plugin-external-helpers":"^6.22.0","babel-plugin-transform-object-assign":"^6.22.0"},"_npmOperationalInternal":{"tmp":"tmp/aos_3.0.0-beta.1_1529619421164_0.3221016696672314","host":"s3://npm-registry-packages"},"_id":"aos@3.0.0-beta.1","version":"3.0.0-beta.1"}