diff --git a/SUPPORT.md b/.github/contributing.md similarity index 59% rename from SUPPORT.md rename to .github/contributing.md index 3ac7048..6cf9168 100644 --- a/SUPPORT.md +++ b/.github/contributing.md @@ -1,14 +1,17 @@ # Bugs, Questions, and Feature Requests -You can ask questions and get help from a community of developers on [GitHub Issues](https://github.com/cferdinandi/smooth-scroll/issues). +Report bugs, ask questions, and request features using [GitHub Issues](https://github.com/cferdinandi/smooth-scroll/issues). -**Before posting, do a search to make sure your issue or question hasn't already been reported or discussed.** If no matching issue exists, go ahead and create one. Please be sure to include all of the following: +**Before posting, do a search to make sure your issue or question hasn't already been reported or discussed.** If no matching issue exists, go ahead and create one. + +**Please be sure to include all of the following:** 1. A clear, descriptive title (ie. "A bug" is not a good title). 2. [A reduced test case.](https://css-tricks.com/reduced-test-cases/) - Clearly demonstrate the bug or issue. - Include the bare minimum HTML, CSS, and JavaScript required to demonstrate the bug. - - A link to your production site is not a reduced test case. + - A link to your production site is **not** a reduced test case. + - You can create one by [forking this CodePen](https://codepen.io/cferdinandi/pen/RqGLpz). 3. The browser and OS that you're using. Duplicates and issues without a reduced test case may be closed without comment. \ No newline at end of file diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100755 index 0000000..664bfaa --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,3 @@ + + +**Test case:** https://codepen.io/cferdinandi/pen/RqGLpz \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..42b06b4 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,13 @@ +on: push +name: publish on release +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: publish + uses: actions/npm@master + env: + NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + with: + args: publish diff --git a/README.md b/README.md index 61f8f46..ed77c95 100755 --- a/README.md +++ b/README.md @@ -1,15 +1,32 @@ +**DEPRECATION NOTICE:** + +Smooth Scroll is, without a doubt, my most popular and widely used plugin. + +But in the time since I created it, a CSS-only method for smooth scrolling has emerged, and now has fantastic browser support. It can do things this plugin can't (like scrolling to anchor links from another page), and addresses bugs and limitations in the plugin that I have never gotten around to fixing. + +This plugin has run its course, and the browser now offers a better, more feature rich and resilient solution out-of-the-box. + +Learn [how to animate scrolling to anchor links with one line of CSS](https://gomakethings.com/how-to-animate-scrolling-to-anchor-links-with-one-line-of-css/), and [how to prevent anchor links from scrolling behind fixed or sticky headers](https://gomakethings.com/how-to-prevent-anchor-links-from-scrolling-behind-a-sticky-header-with-one-line-of-css/). + +Thanks for the years of support! + +--- + # Smooth Scroll [![Build Status](https://travis-ci.org/cferdinandi/smooth-scroll.svg)](https://travis-ci.org/cferdinandi/smooth-scroll) A lightweight script to animate scrolling to anchor links. Smooth Scroll works great with [Gumshoe](https://github.com/cferdinandi/gumshoe). -[Download Smooth Scroll](https://github.com/cferdinandi/smooth-scroll/archive/master.zip) / [View the demo](http://cferdinandi.github.io/smooth-scroll/) +**[View the Demo on CodePen →](https://codepen.io/cferdinandi/pen/wQzrdM)** +[Getting Started](#getting-started) | [Scroll Speed](#scroll-speed) | [Easing Options](#easing-options) | [API](#api) | [What's new?](#whats-new) | [Known Issues](#known-issues) | [Browser Compatibility](#browser-compatibility) | [License](#license) -
+*__Quick aside:__ you might not need this library. There's [a native CSS way to handle smooth scrolling](https://gomakethings.com/smooth-scrolling-links-with-only-css/) that might fit your needs.* -### Want to learn how to write your own vanilla JS plugins? Check out my [Vanilla JS Pocket Guides series](https://gomakethings.com/guides/) and level-up as a web developer. 🚀
+### Want to learn how to write your own vanilla JS plugins? Check out my [Vanilla JS Pocket Guides](https://vanillajsguides.com/) or join the [Vanilla JS Academy](https://vanillajsacademy.com) and level-up as a web developer. 🚀 + +
## Getting Started @@ -18,12 +35,43 @@ Compiled and production-ready code can be found in the `dist` directory. The `sr ### 1. Include Smooth Scroll on your site. -There are two versions of Smooth Scroll: the standalone version, and one that comes preloaded with polyfills for the `closest()` and `requestAnimationFrame()` methods, which are only supported in newer browsers. +There are two versions of Smooth Scroll: the standalone version, and one that comes preloaded with polyfills for `closest()`, `requestAnimationFrame()`, and `CustomEvent()`, which are only supported in newer browsers. If you're including your own polyfills or don't want to enable this feature for older browsers, use the standalone version. Otherwise, use the version with polyfills. +**Direct Download** + +You can [download the files directly from GitHub](https://github.com/cferdinandi/smooth-scroll/archive/master.zip). + ```html - + +``` + +**CDN** + +You can also use the [jsDelivr CDN](https://cdn.jsdelivr.net/gh/cferdinandi/smooth-scroll/dist/). I recommend linking to a specific version number or version range to prevent major updates from breaking your site. Smooth Scroll uses semantic versioning. + +```html + + + + + + + + + + + + +``` + +**NPM** + +You can also use NPM (or your favorite package manager). + +```bash +npm install smooth-scroll ``` ### 2. Add the markup to your HTML. @@ -52,53 +100,122 @@ In the footer of your page, after the content, initialize Smooth Scroll by passi -## Installing with Package Managers +## Scroll Speed + +Smooth Scroll allows you to adjust the speed of your animations with the `speed` option. -You can install Smooth Scroll with your favorite package manager or module loader directly from NPM. +This a number representing the amount of time in milliseconds that it should take to scroll 1000px. Scroll distances shorter than that will take less time, and scroll distances longer than that will take more time. The default is 300ms. +```js +var scroll = new SmoothScroll('a[href*="#"]', { + speed: 300 +}); ``` -npm install smooth-scroll + +If you want all of your animations to take exactly the same amount of time (the value you set for `speed`), set the `speedAsDuration` option to `true`. + +```js +// All animations will take exactly 500ms +var scroll = new SmoothScroll('a[href*="#"]', { + speed: 500, + speedAsDuration: true +}); ``` +## Easing Options + +Smooth Scroll comes with about a dozen common easing patterns. [Here's a demo of the different patterns.](https://codepen.io/cferdinandi/pen/jQMGaB) + +**Linear** +*Moves at the same speed from start to finish.* + +- `Linear` + -## Working with the Source Files +**Ease-In** +*Gradually increases in speed.* -If you would prefer, you can work with the development code in the `src` directory using the included [Gulp build system](http://gulpjs.com/). This compiles, lints, and minifies code. +- `easeInQuad` +- `easeInCubic` +- `easeInQuart` +- `easeInQuint` -### Dependencies -Make sure these are installed first. -* [Node.js](http://nodejs.org) -* [Gulp](http://gulpjs.com) `sudo npm install -g gulp` +**Ease-In-Out** +*Gradually increases in speed, peaks, and then gradually slows down.* -### Quick Start +- `easeInOutQuad` +- `easeInOutCubic` +- `easeInOutQuart` +- `easeInOutQuint` -1. In bash/terminal/command line, `cd` into your project directory. -2. Run `npm install` to install required files. -3. When it's done installing, run one of the task runners to get going: - * `gulp` manually compiles files. - * `gulp watch` automatically compiles files when changes are made and applies changes using [LiveReload](http://livereload.com/). +**Ease-Out** +*Gradually decreases in speed.* + +- `easeOutQuad` +- `easeOutCubic` +- `easeOutQuart` +- `easeOutQuint` + + +You can also pass in your own custom easing pattern [using the `customEasing` option](#global-settings). + +```js +var scroll = new SmoothScroll('a[href*="#"]', { + // Function. Custom easing pattern + // If this is set to anything other than null, will override the easing option above + customEasing: function (time) { + + // return + + // Example: easeInOut Quad + return time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; + + } +}); +``` -## Options and Settings + +## API Smooth Scroll includes smart defaults and works right out of the box. But if you want to customize things, it also has a robust API that provides multiple ways for you to adjust the default options and settings. -### Global Settings +### Options and Settings -You can pass options and callbacks into Smooth Scroll through the `init()` function: +You can pass options and callbacks into Smooth Scroll when instantiating. ```javascript var scroll = new SmoothScroll('a[href*="#"]', { + // Selectors ignore: '[data-scroll-ignore]', // Selector for links to ignore (must be a valid CSS selector) header: null, // Selector for fixed headers (must be a valid CSS selector) + topOnEmptyHash: true, // Scroll to the top of the page for links with href="#" + + // Speed & Duration + speed: 500, // Integer. Amount of time in milliseconds it should take to scroll 1000px + speedAsDuration: false, // If true, use speed as the total duration of the scroll animation + durationMax: null, // Integer. The maximum amount of time the scroll animation should take + durationMin: null, // Integer. The minimum amount of time the scroll animation should take + clip: true, // If true, adjust scroll distance to prevent abrupt stops near the bottom of the page + offset: function (anchor, toggle) { + + // Integer or Function returning an integer. How far to offset the scrolling anchor location in pixels + // This example is a function, but you could do something as simple as `offset: 25` + + // An example returning different values based on whether the clicked link was in the header nav or not + if (toggle.classList.closest('.my-header-nav')) { + return 25; + } else { + return 50; + } + + }, - // Speed & Easing - speed: 500, // Integer. How fast to complete the scroll in milliseconds - offset: 0, // Integer or Function returning an integer. How far to offset the scrolling anchor location in pixels + // Easing easing: 'easeInOutCubic', // Easing pattern to use customEasing: function (time) { @@ -112,53 +229,50 @@ var scroll = new SmoothScroll('a[href*="#"]', { }, - // Callback API - before: function (anchor, toggle) {}, // Callback to run before scroll - after: function (anchor, toggle) {} // Callback to run after scroll -}); -``` - -#### Easing Options - -Some common easing patterns are included by default, but you can also pass in your own custom easing pattern using the `customEasing` option noted above. + // History + updateURL: true, // Update the URL on scroll + popstate: true, // Animate scrolling with the forward/backward browser buttons (requires updateURL to be true) -**Linear** -*Moves at the same speed from start to finish.* + // Custom Events + emitEvents: true // Emit custom events -* `Linear` +}); +``` +### Custom Events -**Ease-In** -*Gradually increases in speed.* +Smooth Scroll emits three custom events: -* `easeInQuad` -* `easeInCubic` -* `easeInQuart` -* `easeInQuint` +- `scrollStart` is emitted when the scrolling animation starts. +- `scrollStop` is emitted when the scrolling animation stops. +- `scrollCancel` is emitted if the scrolling animation is canceled. +All three events are emitted on the `document` element and bubble up. You can listen for them with the `addEventListener()` method. The `event.detail` object includes the `anchor` and `toggle` elements for the animation. -**Ease-In-Out** -*Gradually increases in speed, peaks, and then gradually slows down.* +```js +// Log scroll events +var logScrollEvent = function (event) { -* `easeInOutQuad` -* `easeInOutCubic` -* `easeInOutQuart` -* `easeInOutQuint` + // The event type + console.log('type:', event.type); + // The anchor element being scrolled to + console.log('anchor:', event.detail.anchor); -**Ease-Out** -*Gradually decreases in speed.* + // The anchor link that triggered the scroll + console.log('toggle:', event.detail.toggle); -* `easeOutQuad` -* `easeOutCubic` -* `easeOutQuart` -* `easeOutQuint` +}; -Learn more about the different easing patterns and what they do at [easings.net](http://easings.net/). +// Listen for scroll events +document.addEventListener('scrollStart', logScrollEvent, false); +document.addEventListener('scrollStop', logScrollEvent, false); +document.addEventListener('scrollCancel', logScrollEvent, false); +``` -### Use Smooth Scroll events in your own scripts +### Methods -You can also call Smooth Scroll's methods in your own scripts. +Smooth Scroll also exposes several public methods. #### animateScroll() Animate scrolling to an anchor. @@ -166,8 +280,8 @@ Animate scrolling to an anchor. ```javascript var scroll = new SmoothScroll(); scroll.animateScroll( - anchor, // Node to scroll to. ex. document.querySelector( '#bazinga' ) - toggle, // Node that toggles the animation, OR an integer. ex. document.querySelector( '#toggle' ) + anchor, // Node to scroll to. ex. document.querySelector('#bazinga') + toggle, // Node that toggles the animation, OR an integer. ex. document.querySelector('#toggle') options // Classes and callbacks. Same options as those passed into the init() function. ); ``` @@ -176,18 +290,18 @@ scroll.animateScroll( ```javascript var scroll = new SmoothScroll(); -var anchor = document.querySelector( '#bazinga' ); -scroll.animateScroll( anchor ); +var anchor = document.querySelector('#bazinga'); +scroll.animateScroll(anchor); ``` **Example 2** ```javascript var scroll = new SmoothScroll(); -var anchor = document.querySelector( '#bazinga' ); +var anchor = document.querySelector('#bazinga'); var toggle = document.querySelector('#toggle'); var options = { speed: 1000, easing: 'easeOutCubic' }; -scroll.animateScroll( anchor, toggle, options ); +scroll.animateScroll(anchor, toggle, options); ``` **Example 3** @@ -195,7 +309,7 @@ scroll.animateScroll( anchor, toggle, options ); ```javascript // You can optionally pass in a y-position to scroll to as an integer var scroll = new SmoothScroll(); -scroll.animateScroll( 750 ); +scroll.animateScroll(750); ``` #### cancelScroll() @@ -208,16 +322,8 @@ scroll.cancelScroll(); ***Note:*** *This does not handle focus management. The user will stop in place, and focus will remain on the anchor link that triggered the scroll.* -#### init() -Initialize Smooth Scroll. This is called automatically when you setup your `new SmoothScroll` object, but can be used to reinitialize your instance. - -```javascript -var scroll = new SmoothScroll(); -scroll.init('.some-selector'); -``` - #### destroy() -Destroy the current `smoothScroll.init()`. This is called automatically during the `init` function to remove any existing initializations. +Destroy the current initialization. This is called automatically in the `init` method to remove any existing initializations. ```javascript var scroll = new SmoothScroll(); @@ -244,42 +350,22 @@ If you have multiple fixed headers, pass in the last one in the markup. ``` -## Migrating to Smooth Scroll 12 from Older Versions - -### New Features - -- You can now initialize multiple instances of Smooth Scroll with different selectors and options: - ```js - var scrollFast = new SmoothScroll('.scroll-fast', {speed: 100}); - var scrollSlow = new SmoothScroll('.scroll-slow', {speed: 5000}); - ``` -- The new `cancelScroll()` method lets you programatically cancel a scroll-in-progress. -- Scrolling animation is now powered by `requestAnimationFrame()`, resulting in smoother scrolling and better performance. -- Smooth Scroll now supports Reduced Motion (currently a Safari-only feature). If the visitor has indicated that they [prefer reduced motion](https://css-tricks.com/smooth-scrolling-accessibility/), Smooth Scroll will jump to the anchor link as normal instead of animating the scroll. -### Breaking Changes +## What's new? -- You no longer initialize Smooth Scroll via `smoothScroll.init()`. You must now instantiate a new JavaScript object: `new SmoothScroll()`. -- There is no longer a default selector. You should pass in a selector as the first argument when setting up your constructor: `new SmoothScroll('.my-selector')`. -- The `data-options` feature has been deprecated, as the same effect can be achieved by initializing the plugin with different selectors. +Scroll duration now varies based on distance traveled. If you want to maintain the old scroll animation duration behavior, set the `speedAsDuration` option to `true`. -## Browser Compatibility - -Smooth Scroll works in all modern browsers, and IE 9 and above. - -Smooth Scroll is built with modern JavaScript APIs, and uses progressive enhancement. If the JavaScript file fails to load, or if your site is viewed on older and less capable browsers, anchor links will jump the way they normally would. - -### Polyfills - -Support back to IE9 requires polyfills for the `closest()` and `requestAnimationFrame()` methods. Without them, support starts with Edge. +## Known Issues -Use the included polyfills version of Smooth Scroll, or include your own. +### Reduce Motion Settings +This isn't really an "issue" so-much as a question I get a lot. +Smooth Scroll respects [the `Reduce Motion` setting](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion) available in certain operating systems. In browsers that surface that setting, Smooth Scroll will not run and will revert to the default "jump to location" anchor link behavior. -## Known Issues +I've decided to respect user preferences of developer desires here. This is *not* a configurable setting. ### `` styling @@ -289,77 +375,27 @@ If the `` element has been assigned a height of `100%` or `overflow: hidde Animated scrolling links at the very bottom of the page (example: a "scroll to top" link) will stop animated almost immediately after they start when using certain easing patterns. This is an issue that's been around for a while and I've yet to find a good fix for it. I've found that `easeOut*` easing patterns work as expected, but other patterns can cause issues. [See this discussion for more details.](https://github.com/cferdinandi/smooth-scroll/issues/49) -### Styling with IDs - -If you use an ID to style an element in your CSS, and that same element is targeted by an anchor link that you're scrolling to with Smooth Scroll, you will experience a temporary loss of styling. - -Smooth Scroll temporarily removes the ID to prevent the page from jumping when the URL changes, and then adds it back. Use a class instead of an ID to avoid this issue. - -```css -/* Instead of this */ -#some-element { - background-color: purple; -} - -/* Do this */ -.some-element { - background-color: purple; -} -``` - - - -## Extras - -Frequently asked questions, code snippets, and more to help you get the most out of Smooth Scroll. - ### Scrolling to an anchor link on another page This, unfortunately, cannot be done well. Most browsers instantly jump you to the anchor location when you load a page. You could use `scrollTo(0, 0)` to pull users back up to the top, and then manually use the `animateScroll()` method, but in my experience, it results in a visible jump on the page that's a worse experience than the default browser behavior. -### Scrolling without updating the URL - -Smooth Scroll is designed to progressively enhance anchor links while offloading as much to the browser as possible. In it's current implementation, it relies on `hashchange` events (which occur whenever a `#` changes in the URL) to trigger the scrolling behavior. -A benefit of this approach is that it preserves browser history and let's users navigate between anchors with the forward and back buttons on the browsers, just like you would normally. -*However*, I know certain front-end frameworks also use URL hashes for their own internal processes. While I view this as an anti-pattern, and won't bake hashless anchor links into Smooth Scroll's core, you can enable scrolling without updating the URL via the Smooth Scroll API. - -Here's a relatively lightweight helper function that listens for click events and uses the `animateScroll()` method to scroll to the anchor. If you use this, you **should not** pass a selector into `new SmoothScroll()`. - -```js -var scroll = new SmoothScroll(); +## Browser Compatibility -var smoothScrollWithoutHash = function (selector, settings) { - /** - * If smooth scroll element clicked, animate scroll - */ - var clickHandler = function (event) { - var toggle = event.target.closest( selector ); - console.log(toggle); - if ( !toggle || toggle.tagName.toLowerCase() !== 'a' ) return; - console.log(toggle.hash); - var anchor = document.querySelector( toggle.hash ); - if ( !anchor ) return; - - event.preventDefault(); // Prevent default click event - scroll.animateScroll( anchor, toggle, settings || {} ); // Animate scroll - }; - - window.addEventListener('click', clickHandler, false ); -}; +Smooth Scroll works in all modern browsers, and IE 9 and above. -// Run our function -smoothScrollWithoutHash( 'a[href*="#"]' ); -``` +Smooth Scroll is built with modern JavaScript APIs, and uses progressive enhancement. If the JavaScript file fails to load, or if your site is viewed on older and less capable browsers, anchor links will jump the way they normally would. +*__Note:__ Smooth Scroll will not run—even in supported browsers—if users have `Reduce Motion` enabled. [Learn more in the "Known Issues" section.](#reduce-motion-settings)* +### Polyfills -## Support +Support back to IE9 requires polyfills for `closest()`, `requestAnimationFrame()`, and `CustomEvent()`. Without them, support starts with Edge. -Please review the [support guidelines](SUPPORT.md). +Use the included polyfills version of Smooth Scroll, or include your own. diff --git a/dist/js/smooth-scroll.js b/dist/js/smooth-scroll.js deleted file mode 100755 index dec5cb4..0000000 --- a/dist/js/smooth-scroll.js +++ /dev/null @@ -1,576 +0,0 @@ -/*! - * smooth-scroll v12.1.5: Animate scrolling to anchor links - * (c) 2017 Chris Ferdinandi - * MIT License - * http://github.com/cferdinandi/smooth-scroll - */ - -(function (root, factory) { - if ( typeof define === 'function' && define.amd ) { - define([], (function () { - return factory(root); - })); - } else if ( typeof exports === 'object' ) { - module.exports = factory(root); - } else { - root.SmoothScroll = factory(root); - } -})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) { - - 'use strict'; - - // - // Feature Test - // - - var supports = - 'querySelector' in document && - 'addEventListener' in window && - 'requestAnimationFrame' in window && - 'closest' in window.Element.prototype; - - - // - // Default settings - // - - var defaults = { - // Selectors - ignore: '[data-scroll-ignore]', - header: null, - - // Speed & Easing - speed: 500, - offset: 0, - easing: 'easeInOutCubic', - customEasing: null, - - // Callback API - before: function () {}, - after: function () {} - }; - - - // - // Utility Methods - // - - /** - * Merge two or more objects. Returns a new object. - * @param {Object} objects The objects to merge together - * @returns {Object} Merged values of defaults and options - */ - var extend = function () { - - // Variables - var extended = {}; - var deep = false; - var i = 0; - var length = arguments.length; - - // Merge the object into the extended object - var merge = function (obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - extended[prop] = obj[prop]; - } - } - }; - - // Loop through each object and conduct a merge - for ( ; i < length; i++ ) { - var obj = arguments[i]; - merge(obj); - } - - return extended; - - }; - - /** - * Get the height of an element. - * @param {Node} elem The element to get the height of - * @return {Number} The element's height in pixels - */ - var getHeight = function (elem) { - return parseInt(window.getComputedStyle(elem).height, 10); - }; - - /** - * Escape special characters for use with querySelector - * @param {String} id The anchor ID to escape - * @author Mathias Bynens - * @link https://github.com/mathiasbynens/CSS.escape - */ - var escapeCharacters = function (id) { - - // Remove leading hash - if (id.charAt(0) === '#') { - id = id.substr(1); - } - - var string = String(id); - var length = string.length; - var index = -1; - var codeUnit; - var result = ''; - var firstCodeUnit = string.charCodeAt(0); - while (++index < length) { - codeUnit = string.charCodeAt(index); - // Note: there’s no need to special-case astral symbols, surrogate - // pairs, or lone surrogates. - - // If the character is NULL (U+0000), then throw an - // `InvalidCharacterError` exception and terminate these steps. - if (codeUnit === 0x0000) { - throw new InvalidCharacterError( - 'Invalid character: the input contains U+0000.' - ); - } - - if ( - // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is - // U+007F, […] - (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F || - // If the character is the first character and is in the range [0-9] - // (U+0030 to U+0039), […] - (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) || - // If the character is the second character and is in the range [0-9] - // (U+0030 to U+0039) and the first character is a `-` (U+002D), […] - ( - index === 1 && - codeUnit >= 0x0030 && codeUnit <= 0x0039 && - firstCodeUnit === 0x002D - ) - ) { - // http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point - result += '\\' + codeUnit.toString(16) + ' '; - continue; - } - - // If the character is not handled by one of the above rules and is - // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or - // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to - // U+005A), or [a-z] (U+0061 to U+007A), […] - if ( - codeUnit >= 0x0080 || - codeUnit === 0x002D || - codeUnit === 0x005F || - codeUnit >= 0x0030 && codeUnit <= 0x0039 || - codeUnit >= 0x0041 && codeUnit <= 0x005A || - codeUnit >= 0x0061 && codeUnit <= 0x007A - ) { - // the character itself - result += string.charAt(index); - continue; - } - - // Otherwise, the escaped character. - // http://dev.w3.org/csswg/cssom/#escape-a-character - result += '\\' + string.charAt(index); - - } - - return '#' + result; - - }; - - /** - * Calculate the easing pattern - * @link https://gist.github.com/gre/1650294 - * @param {String} type Easing pattern - * @param {Number} time Time animation should take to complete - * @returns {Number} - */ - var easingPattern = function (settings, time) { - var pattern; - - // Default Easing Patterns - if (settings.easing === 'easeInQuad') pattern = time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuad') pattern = time * (2 - time); // decelerating to zero velocity - if (settings.easing === 'easeInOutQuad') pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInCubic') pattern = time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutCubic') pattern = (--time) * time * time + 1; // decelerating to zero velocity - if (settings.easing === 'easeInOutCubic') pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInQuart') pattern = time * time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuart') pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity - if (settings.easing === 'easeInOutQuart') pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInQuint') pattern = time * time * time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuint') pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity - if (settings.easing === 'easeInOutQuint') pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration - - // Custom Easing Patterns - if (!!settings.customEasing) pattern = settings.customEasing(time); - - return pattern || time; // no easing, no acceleration - }; - - /** - * Determine the document's height - * @returns {Number} - */ - var getDocumentHeight = function () { - return Math.max( - document.body.scrollHeight, document.documentElement.scrollHeight, - document.body.offsetHeight, document.documentElement.offsetHeight, - document.body.clientHeight, document.documentElement.clientHeight - ); - }; - - /** - * Calculate how far to scroll - * @param {Element} anchor The anchor element to scroll to - * @param {Number} headerHeight Height of a fixed header, if any - * @param {Number} offset Number of pixels by which to offset scroll - * @returns {Number} - */ - var getEndLocation = function (anchor, headerHeight, offset) { - var location = 0; - if (anchor.offsetParent) { - do { - location += anchor.offsetTop; - anchor = anchor.offsetParent; - } while (anchor); - } - location = Math.max(location - headerHeight - offset, 0); - return location; - }; - - /** - * Get the height of the fixed header - * @param {Node} header The header - * @return {Number} The height of the header - */ - var getHeaderHeight = function (header) { - return !header ? 0 : (getHeight(header) + header.offsetTop); - }; - - /** - * Bring the anchored element into focus - * @param {Node} anchor The anchor element - * @param {Number} endLocation The end location to scroll to - * @param {Boolean} isNum If true, scroll is to a position rather than an element - */ - var adjustFocus = function (anchor, endLocation, isNum) { - - // Don't run if scrolling to a number on the page - if (isNum) return; - - // Otherwise, bring anchor element into focus - anchor.focus(); - if (document.activeElement.id !== anchor.id) { - anchor.setAttribute('tabindex', '-1'); - anchor.focus(); - anchor.style.outline = 'none'; - } - window.scrollTo(0 , endLocation); - - }; - - /** - * Check to see if user prefers reduced motion - * @param {Object} settings Script settings - */ - var reduceMotion = function (settings) { - if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { - return true; - } - return false; - }; - - - // - // SmoothScroll Constructor - // - - var SmoothScroll = function (selector, options) { - - // - // Variables - // - - var smoothScroll = {}; // Object for public APIs - var settings, anchor, toggle, fixedHeader, headerHeight, eventTimeout, animationInterval; - - - // - // Methods - // - - /** - * Cancel a scroll-in-progress - */ - smoothScroll.cancelScroll = function () { - // clearInterval(animationInterval); - cancelAnimationFrame(animationInterval); - }; - - /** - * Start/stop the scrolling animation - * @param {Node|Number} anchor The element or position to scroll to - * @param {Element} toggle The element that toggled the scroll event - * @param {Object} options - */ - smoothScroll.animateScroll = function (anchor, toggle, options) { - - // Local settings - var animateSettings = extend(settings || defaults, options || {}); // Merge user options with defaults - - // Selectors and variables - var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; - var anchorElem = isNum || !anchor.tagName ? null : anchor; - if (!isNum && !anchorElem) return; - var startLocation = window.pageYOffset; // Current location on the page - if (animateSettings.header && !fixedHeader) { - // Get the fixed header if not already set - fixedHeader = document.querySelector( animateSettings.header ); - } - if (!headerHeight) { - // Get the height of a fixed header if one exists and not already set - headerHeight = getHeaderHeight(fixedHeader); - } - var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof animateSettings.offset === 'function' ? animateSettings.offset() : animateSettings.offset), 10)); // Location to scroll to - var distance = endLocation - startLocation; // distance to travel - var documentHeight = getDocumentHeight(); - var timeLapsed = 0; - var start, percentage, position; - - /** - * Stop the scroll animation when it reaches its target (or the bottom/top of page) - * @param {Number} position Current position on the page - * @param {Number} endLocation Scroll to location - * @param {Number} animationInterval How much to scroll on this loop - */ - var stopAnimateScroll = function (position, endLocation) { - - // Get the current location - var currentLocation = window.pageYOffset; - - // Check if the end location has been reached yet (or we've hit the end of the document) - if ( position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight )) { - - // Clear the animation timer - smoothScroll.cancelScroll(); - - // Bring the anchored element into focus - adjustFocus(anchor, endLocation, isNum); - - // Run callback after animation complete - animateSettings.after(anchor, toggle); - - // Reset start - start = null; - - return true; - - } - }; - - /** - * Loop scrolling animation - */ - var loopAnimateScroll = function (timestamp) { - if (!start) { start = timestamp; } - timeLapsed += timestamp - start; - percentage = (timeLapsed / parseInt(animateSettings.speed, 10)); - percentage = (percentage > 1) ? 1 : percentage; - position = startLocation + (distance * easingPattern(animateSettings, percentage)); - window.scrollTo(0, Math.floor(position)); - if (!stopAnimateScroll(position, endLocation)) { - window.requestAnimationFrame(loopAnimateScroll); - start = timestamp; - } - }; - - /** - * Reset position to fix weird iOS bug - * @link https://github.com/cferdinandi/smooth-scroll/issues/45 - */ - if (window.pageYOffset === 0) { - window.scrollTo( 0, 0 ); - } - - // Run callback before animation starts - animateSettings.before(anchor, toggle); - - // Start scrolling animation - smoothScroll.cancelScroll(); - window.requestAnimationFrame(loopAnimateScroll); - - - }; - - /** - * Handle has change event - */ - var hashChangeHandler = function (event) { - - // Only run if there's an anchor element to scroll to - if (!anchor) return; - - // Reset the anchor element's ID - anchor.id = anchor.getAttribute('data-scroll-id'); - - // Scroll to the anchored content - smoothScroll.animateScroll(anchor, toggle); - - // Reset anchor and toggle - anchor = null; - toggle = null; - - }; - - /** - * If smooth scroll element clicked, animate scroll - */ - var clickHandler = function (event) { - - // Don't run if the user prefers reduced motion - if (reduceMotion(settings)) return; - - // Don't run if right-click or command/control + click - if (event.button !== 0 || event.metaKey || event.ctrlKey) return; - - // Check if a smooth scroll link was clicked - toggle = event.target.closest(selector); - if (!toggle || toggle.tagName.toLowerCase() !== 'a' || event.target.closest(settings.ignore)) return; - - // Only run if link is an anchor and points to the current page - if (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return; - - // Get the sanitized hash - var hash; - try { - hash = escapeCharacters(decodeURIComponent(toggle.hash)); - } catch(e) { - hash = escapeCharacters(toggle.hash); - } - - // If the hash is empty, scroll to the top of the page - if (hash === '#') { - - // Prevent default link behavior - event.preventDefault(); - - // Set the anchored element - anchor = document.body; - - // Save or create the ID as a data attribute and remove it (prevents scroll jump) - var id = anchor.id ? anchor.id : 'smooth-scroll-top'; - anchor.setAttribute('data-scroll-id', id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - // Otherwise, update the hash - if (window.location.hash.substring(1) === id) { - hashChangeHandler(); - } else { - window.location.hash = id; - } - - return; - - } - - // Get the anchored element - anchor = document.querySelector(hash); - - // If anchored element exists, save the ID as a data attribute and remove it (prevents scroll jump) - if (!anchor) return; - anchor.setAttribute('data-scroll-id', anchor.id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - if (toggle.hash === window.location.hash) { - event.preventDefault(); - hashChangeHandler(); - } - - }; - - /** - * On window scroll and resize, only run events at a rate of 15fps for better performance - */ - var resizeThrottler = function (event) { - if (!eventTimeout) { - eventTimeout = setTimeout((function() { - eventTimeout = null; // Reset timeout - headerHeight = getHeaderHeight(fixedHeader); // Get the height of a fixed header if one exists - }), 66); - } - }; - - /** - * Destroy the current initialization. - */ - smoothScroll.destroy = function () { - - // If plugin isn't already initialized, stop - if (!settings) return; - - // Remove event listeners - document.removeEventListener('click', clickHandler, false); - window.removeEventListener('resize', resizeThrottler, false); - - // Cancel any scrolls-in-progress - smoothScroll.cancelScroll(); - - // Reset variables - settings = null; - anchor = null; - toggle = null; - fixedHeader = null; - headerHeight = null; - eventTimeout = null; - animationInterval = null; - }; - - /** - * Initialize Smooth Scroll - * @param {Object} options User settings - */ - smoothScroll.init = function (options) { - - // feature test - if (!supports) return; - - // Destroy any existing initializations - smoothScroll.destroy(); - - // Selectors and variables - settings = extend(defaults, options || {}); // Merge user options with defaults - fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header - headerHeight = getHeaderHeight(fixedHeader); - - // When a toggle is clicked, run the click handler - document.addEventListener('click', clickHandler, false); - - // Listen for hash changes - window.addEventListener('hashchange', hashChangeHandler, false); - - // If window is resized and there's a fixed header, recalculate its size - if (fixedHeader) { - window.addEventListener('resize', resizeThrottler, false); - } - - }; - - - // - // Initialize plugin - // - - smoothScroll.init(options); - - - // - // Public APIs - // - - return smoothScroll; - - }; - - return SmoothScroll; - -})); \ No newline at end of file diff --git a/dist/js/smooth-scroll.min.js b/dist/js/smooth-scroll.min.js deleted file mode 100755 index 0cd1cf2..0000000 --- a/dist/js/smooth-scroll.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! smooth-scroll v12.1.5 | (c) 2017 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ -!(function(e,t){"function"==typeof define&&define.amd?define([],(function(){return t(e)})):"object"==typeof exports?module.exports=t(e):e.SmoothScroll=t(e)})("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,(function(e){"use strict";var t="querySelector"in document&&"addEventListener"in e&&"requestAnimationFrame"in e&&"closest"in e.Element.prototype,n={ignore:"[data-scroll-ignore]",header:null,speed:500,offset:0,easing:"easeInOutCubic",customEasing:null,before:function(){},after:function(){}},o=function(){for(var e={},t=0,n=arguments.length;t=1&&t<=31||127==t||0===a&&t>=48&&t<=57||1===a&&t>=48&&t<=57&&45===i?r+="\\"+t.toString(16)+" ":r+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(a):"\\"+n.charAt(a)}return"#"+r},i=function(e,t){var n;return"easeInQuad"===e.easing&&(n=t*t),"easeOutQuad"===e.easing&&(n=t*(2-t)),"easeInOutQuad"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e.easing&&(n=t*t*t),"easeOutCubic"===e.easing&&(n=--t*t*t+1),"easeInOutCubic"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e.easing&&(n=t*t*t*t),"easeOutQuart"===e.easing&&(n=1- --t*t*t*t),"easeInOutQuart"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e.easing&&(n=t*t*t*t*t),"easeOutQuint"===e.easing&&(n=1+--t*t*t*t*t),"easeInOutQuint"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t},u=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},c=function(e,t,n){var o=0;if(e.offsetParent)do{o+=e.offsetTop,e=e.offsetParent}while(e);return o=Math.max(o-t-n,0)},s=function(e){return e?a(e)+e.offsetTop:0},l=function(t,n,o){o||(t.focus(),document.activeElement.id!==t.id&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),e.scrollTo(0,n))},f=function(t){return!!("matchMedia"in e&&e.matchMedia("(prefers-reduced-motion)").matches)};return function(a,d){var m,h,g,p,v,b,y,S={};S.cancelScroll=function(){cancelAnimationFrame(y)},S.animateScroll=function(t,a,r){var f=o(m||n,r||{}),d="[object Number]"===Object.prototype.toString.call(t),h=d||!t.tagName?null:t;if(d||h){var g=e.pageYOffset;f.header&&!p&&(p=document.querySelector(f.header)),v||(v=s(p));var b,y,E,I=d?t:c(h,v,parseInt("function"==typeof f.offset?f.offset():f.offset,10)),O=I-g,A=u(),C=0,w=function(n,o){var r=e.pageYOffset;if(n==o||r==o||(g=A)return S.cancelScroll(),l(t,o,d),f.after(t,a),b=null,!0},Q=function(t){b||(b=t),C+=t-b,y=C/parseInt(f.speed,10),y=y>1?1:y,E=g+O*i(f,y),e.scrollTo(0,Math.floor(E)),w(E,I)||(e.requestAnimationFrame(Q),b=t)};0===e.pageYOffset&&e.scrollTo(0,0),f.before(t,a),S.cancelScroll(),e.requestAnimationFrame(Q)}};var E=function(e){h&&(h.id=h.getAttribute("data-scroll-id"),S.animateScroll(h,g),h=null,g=null)},I=function(t){if(!f()&&0===t.button&&!t.metaKey&&!t.ctrlKey&&(g=t.target.closest(a))&&"a"===g.tagName.toLowerCase()&&!t.target.closest(m.ignore)&&g.hostname===e.location.hostname&&g.pathname===e.location.pathname&&/#/.test(g.href)){var n;try{n=r(decodeURIComponent(g.hash))}catch(e){n=r(g.hash)}if("#"===n){t.preventDefault(),h=document.body;var o=h.id?h.id:"smooth-scroll-top";return h.setAttribute("data-scroll-id",o),h.id="",void(e.location.hash.substring(1)===o?E():e.location.hash=o)}h=document.querySelector(n),h&&(h.setAttribute("data-scroll-id",h.id),h.id="",g.hash===e.location.hash&&(t.preventDefault(),E()))}},O=function(e){b||(b=setTimeout((function(){b=null,v=s(p)}),66))};return S.destroy=function(){m&&(document.removeEventListener("click",I,!1),e.removeEventListener("resize",O,!1),S.cancelScroll(),m=null,h=null,g=null,p=null,v=null,b=null,y=null)},S.init=function(a){t&&(S.destroy(),m=o(n,a||{}),p=m.header?document.querySelector(m.header):null,v=s(p),document.addEventListener("click",I,!1),e.addEventListener("hashchange",E,!1),p&&e.addEventListener("resize",O,!1))},S.init(d),S}})); \ No newline at end of file diff --git a/dist/js/smooth-scroll.polyfills.min.js b/dist/js/smooth-scroll.polyfills.min.js deleted file mode 100755 index d7677aa..0000000 --- a/dist/js/smooth-scroll.polyfills.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! smooth-scroll v12.1.5 | (c) 2017 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ -window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;--t>=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),(function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n=1&&t<=31||127==t||0===i&&t>=48&&t<=57||1===i&&t>=48&&t<=57&&45===r?a+="\\"+t.toString(16)+" ":a+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(i):"\\"+n.charAt(i)}return"#"+a},r=function(e,t){var n;return"easeInQuad"===e.easing&&(n=t*t),"easeOutQuad"===e.easing&&(n=t*(2-t)),"easeInOutQuad"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e.easing&&(n=t*t*t),"easeOutCubic"===e.easing&&(n=--t*t*t+1),"easeInOutCubic"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e.easing&&(n=t*t*t*t),"easeOutQuart"===e.easing&&(n=1- --t*t*t*t),"easeInOutQuart"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e.easing&&(n=t*t*t*t*t),"easeOutQuint"===e.easing&&(n=1+--t*t*t*t*t),"easeInOutQuint"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t},u=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},c=function(e,t,n){var o=0;if(e.offsetParent)do{o+=e.offsetTop,e=e.offsetParent}while(e);return o=Math.max(o-t-n,0)},l=function(e){return e?i(e)+e.offsetTop:0},s=function(t,n,o){o||(t.focus(),document.activeElement.id!==t.id&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),e.scrollTo(0,n))},d=function(t){return!!("matchMedia"in e&&e.matchMedia("(prefers-reduced-motion)").matches)};return function(i,f){var m,h,g,w,p,v,y,b={};b.cancelScroll=function(){cancelAnimationFrame(y)},b.animateScroll=function(t,i,a){var d=o(m||n,a||{}),f="[object Number]"===Object.prototype.toString.call(t),h=f||!t.tagName?null:t;if(f||h){var g=e.pageYOffset;d.header&&!w&&(w=document.querySelector(d.header)),p||(p=l(w));var v,y,A,E=f?t:c(h,p,parseInt("function"==typeof d.offset?d.offset():d.offset,10)),S=E-g,I=u(),q=0,F=function(n,o){var a=e.pageYOffset;if(n==o||a==o||(g=I)return b.cancelScroll(),s(t,o,f),d.after(t,i),v=null,!0},O=function(t){v||(v=t),q+=t-v,y=q/parseInt(d.speed,10),y=y>1?1:y,A=g+S*r(d,y),e.scrollTo(0,Math.floor(A)),F(A,E)||(e.requestAnimationFrame(O),v=t)};0===e.pageYOffset&&e.scrollTo(0,0),d.before(t,i),b.cancelScroll(),e.requestAnimationFrame(O)}};var A=function(e){h&&(h.id=h.getAttribute("data-scroll-id"),b.animateScroll(h,g),h=null,g=null)},E=function(t){if(!d()&&0===t.button&&!t.metaKey&&!t.ctrlKey&&(g=t.target.closest(i))&&"a"===g.tagName.toLowerCase()&&!t.target.closest(m.ignore)&&g.hostname===e.location.hostname&&g.pathname===e.location.pathname&&/#/.test(g.href)){var n;try{n=a(decodeURIComponent(g.hash))}catch(e){n=a(g.hash)}if("#"===n){t.preventDefault(),h=document.body;var o=h.id?h.id:"smooth-scroll-top";return h.setAttribute("data-scroll-id",o),h.id="",void(e.location.hash.substring(1)===o?A():e.location.hash=o)}h=document.querySelector(n),h&&(h.setAttribute("data-scroll-id",h.id),h.id="",g.hash===e.location.hash&&(t.preventDefault(),A()))}},S=function(e){v||(v=setTimeout((function(){v=null,p=l(w)}),66))};return b.destroy=function(){m&&(document.removeEventListener("click",E,!1),e.removeEventListener("resize",S,!1),b.cancelScroll(),m=null,h=null,g=null,w=null,p=null,v=null,y=null)},b.init=function(i){t&&(b.destroy(),m=o(n,i||{}),w=m.header?document.querySelector(m.header):null,p=l(w),document.addEventListener("click",E,!1),e.addEventListener("hashchange",A,!1),w&&e.addEventListener("resize",S,!1))},b.init(f),b}})); \ No newline at end of file diff --git a/docs/dist/js/smooth-scroll.polyfills.js b/dist/smooth-scroll.js old mode 100755 new mode 100644 similarity index 58% rename from docs/dist/js/smooth-scroll.polyfills.js rename to dist/smooth-scroll.js index 43c14be..4984899 --- a/docs/dist/js/smooth-scroll.polyfills.js +++ b/dist/smooth-scroll.js @@ -1,104 +1,40 @@ -/*! - * smooth-scroll v12.1.5: Animate scrolling to anchor links - * (c) 2017 Chris Ferdinandi - * MIT License - * http://github.com/cferdinandi/smooth-scroll - */ - -/** - * closest() polyfill - * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill - */ -if (window.Element && !Element.prototype.closest) { - Element.prototype.closest = function(s) { - var matches = (this.document || this.ownerDocument).querySelectorAll(s), - i, - el = this; - do { - i = matches.length; - while (--i >= 0 && matches.item(i) !== el) {} - } while ((i < 0) && (el = el.parentElement)); - return el; - }; -} - -/** - * requestAnimationFrame() polyfill - * By Erik Möller. Fixes from Paul Irish and Tino Zijdel. - * @link http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - * @link http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating - * @license MIT - */ -(function() { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || - window[vendors[x]+'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout((function() { callback(currTime + timeToCall); }), - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - } - - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - } -}()); - -(function (root, factory) { - if ( typeof define === 'function' && define.amd ) { - define([], (function () { - return factory(root); - })); - } else if ( typeof exports === 'object' ) { - module.exports = factory(root); - } else { - root.SmoothScroll = factory(root); - } -})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) { - - 'use strict'; - - // - // Feature Test - // - - var supports = - 'querySelector' in document && - 'addEventListener' in window && - 'requestAnimationFrame' in window && - 'closest' in window.Element.prototype; - +/*! SmoothScroll v16.1.4 | (c) 2020 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.SmoothScroll = factory()); +}(this, (function () { 'use strict'; // // Default settings // var defaults = { + // Selectors ignore: '[data-scroll-ignore]', header: null, + topOnEmptyHash: true, - // Speed & Easing + // Speed & Duration speed: 500, + speedAsDuration: false, + durationMax: null, + durationMin: null, + clip: true, offset: 0, + + // Easing easing: 'easeInOutCubic', customEasing: null, - // Callback API - before: function () {}, - after: function () {} + // History + updateURL: true, + popstate: true, + + // Custom Events + emitEvents: true + }; @@ -107,35 +43,43 @@ if (window.Element && !Element.prototype.closest) { // /** - * Merge two or more objects. Returns a new object. - * @param {Object} objects The objects to merge together - * @returns {Object} Merged values of defaults and options + * Check if browser supports required methods + * @return {Boolean} Returns true if all required methods are supported */ - var extend = function () { + var supports = function () { + return ( + 'querySelector' in document && + 'addEventListener' in window && + 'requestAnimationFrame' in window && + 'closest' in window.Element.prototype + ); + }; - // Variables - var extended = {}; - var deep = false; - var i = 0; - var length = arguments.length; - - // Merge the object into the extended object - var merge = function (obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - extended[prop] = obj[prop]; - } + /** + * Merge two or more objects together. + * @param {Object} objects The objects to merge together + * @returns {Object} Merged values of defaults and options + */ + var extend = function () { + var merged = {}; + Array.prototype.forEach.call(arguments, function (obj) { + for (var key in obj) { + if (!obj.hasOwnProperty(key)) return; + merged[key] = obj[key]; } - }; + }); + return merged; + }; - // Loop through each object and conduct a merge - for ( ; i < length; i++ ) { - var obj = arguments[i]; - merge(obj); + /** + * Check to see if user prefers reduced motion + * @param {Object} settings Script settings + */ + var reduceMotion = function () { + if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { + return true; } - - return extended; - + return false; }; /** @@ -149,9 +93,9 @@ if (window.Element && !Element.prototype.closest) { /** * Escape special characters for use with querySelector - * @param {String} id The anchor ID to escape * @author Mathias Bynens * @link https://github.com/mathiasbynens/CSS.escape + * @param {String} id The anchor ID to escape */ var escapeCharacters = function (id) { @@ -222,6 +166,7 @@ if (window.Element && !Element.prototype.closest) { } + // Return sanitized hash return '#' + result; }; @@ -229,8 +174,8 @@ if (window.Element && !Element.prototype.closest) { /** * Calculate the easing pattern * @link https://gist.github.com/gre/1650294 - * @param {String} type Easing pattern - * @param {Number} time Time animation should take to complete + * @param {Object} settings Easing pattern + * @param {Number} time Time animation should take to complete * @returns {Number} */ var easingPattern = function (settings, time) { @@ -270,12 +215,14 @@ if (window.Element && !Element.prototype.closest) { /** * Calculate how far to scroll - * @param {Element} anchor The anchor element to scroll to - * @param {Number} headerHeight Height of a fixed header, if any - * @param {Number} offset Number of pixels by which to offset scroll + * Clip support added by robjtede - https://github.com/cferdinandi/smooth-scroll/issues/405 + * @param {Element} anchor The anchor element to scroll to + * @param {Number} headerHeight Height of a fixed header, if any + * @param {Number} offset Number of pixels by which to offset scroll + * @param {Boolean} clip If true, adjust scroll distance to prevent abrupt stops near the bottom of the page * @returns {Number} */ - var getEndLocation = function (anchor, headerHeight, offset) { + var getEndLocation = function (anchor, headerHeight, offset, clip) { var location = 0; if (anchor.offsetParent) { do { @@ -284,7 +231,10 @@ if (window.Element && !Element.prototype.closest) { } while (anchor); } location = Math.max(location - headerHeight - offset, 0); - return location; + if (clip) { + location = Math.min(location, getDocumentHeight() - window.innerHeight); + } + return location; }; /** @@ -296,6 +246,66 @@ if (window.Element && !Element.prototype.closest) { return !header ? 0 : (getHeight(header) + header.offsetTop); }; + /** + * Calculate the speed to use for the animation + * @param {Number} distance The distance to travel + * @param {Object} settings The plugin settings + * @return {Number} How fast to animate + */ + var getSpeed = function (distance, settings) { + var speed = settings.speedAsDuration ? settings.speed : Math.abs(distance / 1000 * settings.speed); + if (settings.durationMax && speed > settings.durationMax) return settings.durationMax; + if (settings.durationMin && speed < settings.durationMin) return settings.durationMin; + return parseInt(speed, 10); + }; + + var setHistory = function (options) { + + // Make sure this should run + if (!history.replaceState || !options.updateURL || history.state) return; + + // Get the hash to use + var hash = window.location.hash; + hash = hash ? hash : ''; + + // Set a default history + history.replaceState( + { + smoothScroll: JSON.stringify(options), + anchor: hash ? hash : window.pageYOffset + }, + document.title, + hash ? hash : window.location.href + ); + + }; + + /** + * Update the URL + * @param {Node} anchor The anchor that was scrolled to + * @param {Boolean} isNum If true, anchor is a number + * @param {Object} options Settings for Smooth Scroll + */ + var updateURL = function (anchor, isNum, options) { + + // Bail if the anchor is a number + if (isNum) return; + + // Verify that pushState is supported and the updateURL option is enabled + if (!history.pushState || !options.updateURL) return; + + // Update URL + history.pushState( + { + smoothScroll: JSON.stringify(options), + anchor: anchor.id + }, + document.title, + anchor === document.documentElement ? '#top' : '#' + anchor.id + ); + + }; + /** * Bring the anchored element into focus * @param {Node} anchor The anchor element @@ -304,12 +314,17 @@ if (window.Element && !Element.prototype.closest) { */ var adjustFocus = function (anchor, endLocation, isNum) { + // Is scrolling to top of page, blur + if (anchor === 0) { + document.body.focus(); + } + // Don't run if scrolling to a number on the page if (isNum) return; // Otherwise, bring anchor element into focus anchor.focus(); - if (document.activeElement.id !== anchor.id) { + if (document.activeElement !== anchor) { anchor.setAttribute('tabindex', '-1'); anchor.focus(); anchor.style.outline = 'none'; @@ -319,14 +334,22 @@ if (window.Element && !Element.prototype.closest) { }; /** - * Check to see if user prefers reduced motion - * @param {Object} settings Script settings + * Emit a custom event + * @param {String} type The event type + * @param {Object} options The settings object + * @param {Node} anchor The anchor element + * @param {Node} toggle The toggle element */ - var reduceMotion = function (settings) { - if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { - return true; - } - return false; + var emitEvent = function (type, options, anchor, toggle) { + if (!options.emitEvents || typeof window.CustomEvent !== 'function') return; + var event = new CustomEvent(type, { + bubbles: true, + detail: { + anchor: anchor, + toggle: toggle + } + }); + document.dispatchEvent(event); }; @@ -341,7 +364,7 @@ if (window.Element && !Element.prototype.closest) { // var smoothScroll = {}; // Object for public APIs - var settings, anchor, toggle, fixedHeader, headerHeight, eventTimeout, animationInterval; + var settings, toggle, fixedHeader, animationInterval; // @@ -351,9 +374,11 @@ if (window.Element && !Element.prototype.closest) { /** * Cancel a scroll-in-progress */ - smoothScroll.cancelScroll = function () { - // clearInterval(animationInterval); + smoothScroll.cancelScroll = function (noEvent) { cancelAnimationFrame(animationInterval); + animationInterval = null; + if (noEvent) return; + emitEvent('scrollCancel', settings); }; /** @@ -364,26 +389,27 @@ if (window.Element && !Element.prototype.closest) { */ smoothScroll.animateScroll = function (anchor, toggle, options) { + // Cancel any in progress scrolls + smoothScroll.cancelScroll(); + // Local settings - var animateSettings = extend(settings || defaults, options || {}); // Merge user options with defaults + var _settings = extend(settings || defaults, options || {}); // Merge user options with defaults // Selectors and variables var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; var anchorElem = isNum || !anchor.tagName ? null : anchor; if (!isNum && !anchorElem) return; var startLocation = window.pageYOffset; // Current location on the page - if (animateSettings.header && !fixedHeader) { + if (_settings.header && !fixedHeader) { // Get the fixed header if not already set - fixedHeader = document.querySelector( animateSettings.header ); - } - if (!headerHeight) { - // Get the height of a fixed header if one exists and not already set - headerHeight = getHeaderHeight(fixedHeader); + fixedHeader = document.querySelector(_settings.header); } - var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof animateSettings.offset === 'function' ? animateSettings.offset() : animateSettings.offset), 10)); // Location to scroll to + var headerHeight = getHeaderHeight(fixedHeader); + var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof _settings.offset === 'function' ? _settings.offset(anchor, toggle) : _settings.offset), 10), _settings.clip); // Location to scroll to var distance = endLocation - startLocation; // distance to travel var documentHeight = getDocumentHeight(); var timeLapsed = 0; + var speed = getSpeed(distance, _settings); var start, percentage, position; /** @@ -398,19 +424,20 @@ if (window.Element && !Element.prototype.closest) { var currentLocation = window.pageYOffset; // Check if the end location has been reached yet (or we've hit the end of the document) - if ( position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight )) { + if (position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight)) { // Clear the animation timer - smoothScroll.cancelScroll(); + smoothScroll.cancelScroll(true); // Bring the anchored element into focus adjustFocus(anchor, endLocation, isNum); - // Run callback after animation complete - animateSettings.after(anchor, toggle); + // Emit a custom event + emitEvent('scrollStop', _settings, anchor, toggle); // Reset start start = null; + animationInterval = null; return true; @@ -423,12 +450,12 @@ if (window.Element && !Element.prototype.closest) { var loopAnimateScroll = function (timestamp) { if (!start) { start = timestamp; } timeLapsed += timestamp - start; - percentage = (timeLapsed / parseInt(animateSettings.speed, 10)); + percentage = speed === 0 ? 0 : (timeLapsed / speed); percentage = (percentage > 1) ? 1 : percentage; - position = startLocation + (distance * easingPattern(animateSettings, percentage)); + position = startLocation + (distance * easingPattern(_settings, percentage)); window.scrollTo(0, Math.floor(position)); if (!stopAnimateScroll(position, endLocation)) { - window.requestAnimationFrame(loopAnimateScroll); + animationInterval = window.requestAnimationFrame(loopAnimateScroll); start = timestamp; } }; @@ -438,36 +465,24 @@ if (window.Element && !Element.prototype.closest) { * @link https://github.com/cferdinandi/smooth-scroll/issues/45 */ if (window.pageYOffset === 0) { - window.scrollTo( 0, 0 ); + window.scrollTo(0, 0); } - // Run callback before animation starts - animateSettings.before(anchor, toggle); + // Update the URL + updateURL(anchor, isNum, _settings); - // Start scrolling animation - smoothScroll.cancelScroll(); - window.requestAnimationFrame(loopAnimateScroll); - - - }; - - /** - * Handle has change event - */ - var hashChangeHandler = function (event) { - - // Only run if there's an anchor element to scroll to - if (!anchor) return; - - // Reset the anchor element's ID - anchor.id = anchor.getAttribute('data-scroll-id'); + // If the user prefers reduced motion, jump to location + if (reduceMotion()) { + adjustFocus(anchor, Math.floor(endLocation), false); + return; + } - // Scroll to the anchored content - smoothScroll.animateScroll(anchor, toggle); + // Emit a custom event + emitEvent('scrollStart', _settings, anchor, toggle); - // Reset anchor and toggle - anchor = null; - toggle = null; + // Start scrolling animation + smoothScroll.cancelScroll(true); + window.requestAnimationFrame(loopAnimateScroll); }; @@ -476,11 +491,16 @@ if (window.Element && !Element.prototype.closest) { */ var clickHandler = function (event) { - // Don't run if the user prefers reduced motion - if (reduceMotion(settings)) return; + // Don't run if event was canceled but still bubbled up + // By @mgreter - https://github.com/cferdinandi/smooth-scroll/pull/462/ + if (event.defaultPrevented) return; + + // Don't run if right-click or command/control + click or shift + click + if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey) return; - // Don't run if right-click or command/control + click - if (event.button !== 0 || event.metaKey || event.ctrlKey) return; + // Check if event.target has closest() method + // By @totegi - https://github.com/cferdinandi/smooth-scroll/pull/401/ + if (!('closest' in event.target)) return; // Check if a smooth scroll link was clicked toggle = event.target.closest(selector); @@ -489,7 +509,7 @@ if (window.Element && !Element.prototype.closest) { // Only run if link is an anchor and points to the current page if (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return; - // Get the sanitized hash + // Get an escaped version of the hash var hash; try { hash = escapeCharacters(decodeURIComponent(toggle.hash)); @@ -497,58 +517,46 @@ if (window.Element && !Element.prototype.closest) { hash = escapeCharacters(toggle.hash); } - // If the hash is empty, scroll to the top of the page + // Get the anchored element + var anchor; if (hash === '#') { - - // Prevent default link behavior - event.preventDefault(); - - // Set the anchored element - anchor = document.body; - - // Save or create the ID as a data attribute and remove it (prevents scroll jump) - var id = anchor.id ? anchor.id : 'smooth-scroll-top'; - anchor.setAttribute('data-scroll-id', id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - // Otherwise, update the hash - if (window.location.hash.substring(1) === id) { - hashChangeHandler(); - } else { - window.location.hash = id; - } - - return; - + if (!settings.topOnEmptyHash) return; + anchor = document.documentElement; + } else { + anchor = document.querySelector(hash); } + anchor = !anchor && hash === '#top' ? document.documentElement : anchor; - // Get the anchored element - anchor = document.querySelector(hash); - - // If anchored element exists, save the ID as a data attribute and remove it (prevents scroll jump) + // If anchored element exists, scroll to it if (!anchor) return; - anchor.setAttribute('data-scroll-id', anchor.id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - if (toggle.hash === window.location.hash) { - event.preventDefault(); - hashChangeHandler(); - } + event.preventDefault(); + setHistory(settings); + smoothScroll.animateScroll(anchor, toggle); }; /** - * On window scroll and resize, only run events at a rate of 15fps for better performance + * Animate scroll on popstate events */ - var resizeThrottler = function (event) { - if (!eventTimeout) { - eventTimeout = setTimeout((function() { - eventTimeout = null; // Reset timeout - headerHeight = getHeaderHeight(fixedHeader); // Get the height of a fixed header if one exists - }), 66); + var popstateHandler = function () { + + // Stop if history.state doesn't exist (ex. if clicking on a broken anchor link). + // fixes `Cannot read property 'smoothScroll' of null` error getting thrown. + if (history.state === null) return; + + // Only run if state is a popstate record for this instantiation + if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return; + + // Get the anchor + var anchor = history.state.anchor; + if (typeof anchor === 'string' && anchor) { + anchor = document.querySelector(escapeCharacters(history.state.anchor)); + if (!anchor) return; } + + // Animate scroll to anchor link + smoothScroll.animateScroll(anchor, null, {updateURL: false}); + }; /** @@ -561,29 +569,27 @@ if (window.Element && !Element.prototype.closest) { // Remove event listeners document.removeEventListener('click', clickHandler, false); - window.removeEventListener('resize', resizeThrottler, false); + window.removeEventListener('popstate', popstateHandler, false); // Cancel any scrolls-in-progress smoothScroll.cancelScroll(); // Reset variables settings = null; - anchor = null; toggle = null; fixedHeader = null; - headerHeight = null; - eventTimeout = null; animationInterval = null; + }; /** * Initialize Smooth Scroll * @param {Object} options User settings */ - smoothScroll.init = function (options) { + var init = function () { // feature test - if (!supports) return; + if (!supports()) throw 'Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.'; // Destroy any existing initializations smoothScroll.destroy(); @@ -591,17 +597,13 @@ if (window.Element && !Element.prototype.closest) { // Selectors and variables settings = extend(defaults, options || {}); // Merge user options with defaults fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header - headerHeight = getHeaderHeight(fixedHeader); // When a toggle is clicked, run the click handler document.addEventListener('click', clickHandler, false); - // Listen for hash changes - window.addEventListener('hashchange', hashChangeHandler, false); - - // If window is resized and there's a fixed header, recalculate its size - if (fixedHeader) { - window.addEventListener('resize', resizeThrottler, false); + // If updateURL and popState are enabled, listen for pop events + if (settings.updateURL && settings.popstate) { + window.addEventListener('popstate', popstateHandler, false); } }; @@ -611,7 +613,7 @@ if (window.Element && !Element.prototype.closest) { // Initialize plugin // - smoothScroll.init(options); + init(); // @@ -624,4 +626,4 @@ if (window.Element && !Element.prototype.closest) { return SmoothScroll; -})); \ No newline at end of file +}))); diff --git a/dist/smooth-scroll.min.js b/dist/smooth-scroll.min.js new file mode 100644 index 0000000..b3d1fe0 --- /dev/null +++ b/dist/smooth-scroll.min.js @@ -0,0 +1,2 @@ +/*! SmoothScroll v16.1.4 | (c) 2020 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).SmoothScroll=t()}(this,(function(){"use strict";var e={ignore:"[data-scroll-ignore]",header:null,topOnEmptyHash:!0,speed:500,speedAsDuration:!1,durationMax:null,durationMin:null,clip:!0,offset:0,easing:"easeInOutCubic",customEasing:null,updateURL:!0,popstate:!0,emitEvents:!0},t=function(){var e={};return Array.prototype.forEach.call(arguments,(function(t){for(var n in t){if(!t.hasOwnProperty(n))return;e[n]=t[n]}})),e},n=function(e){"#"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),o=n.length,a=-1,i="",r=n.charCodeAt(0);++a=1&&t<=31||127==t||0===a&&t>=48&&t<=57||1===a&&t>=48&&t<=57&&45===r?i+="\\"+t.toString(16)+" ":i+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(a):"\\"+n.charAt(a)}return"#"+i},o=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},a=function(e){return e?(t=e,parseInt(window.getComputedStyle(t).height,10)+e.offsetTop):0;var t},i=function(e,t,n){0===e&&document.body.focus(),n||(e.focus(),document.activeElement!==e&&(e.setAttribute("tabindex","-1"),e.focus(),e.style.outline="none"),window.scrollTo(0,t))},r=function(e,t,n,o){if(t.emitEvents&&"function"==typeof window.CustomEvent){var a=new CustomEvent(e,{bubbles:!0,detail:{anchor:n,toggle:o}});document.dispatchEvent(a)}};return function(s,c){var u,l,d,f,m={};m.cancelScroll=function(e){cancelAnimationFrame(f),f=null,e||r("scrollCancel",u)},m.animateScroll=function(n,s,c){m.cancelScroll();var l=t(u||e,c||{}),h="[object Number]"===Object.prototype.toString.call(n),p=h||!n.tagName?null:n;if(h||p){var w=window.pageYOffset;l.header&&!d&&(d=document.querySelector(l.header));var g,y,v,S=a(d),E=h?n:function(e,t,n,a){var i=0;if(e.offsetParent)do{i+=e.offsetTop,e=e.offsetParent}while(e);return i=Math.max(i-t-n,0),a&&(i=Math.min(i,o()-window.innerHeight)),i}(p,S,parseInt("function"==typeof l.offset?l.offset(n,s):l.offset,10),l.clip),b=E-w,O=o(),I=0,M=function(e,t){var n=t.speedAsDuration?t.speed:Math.abs(e/1e3*t.speed);return t.durationMax&&n>t.durationMax?t.durationMax:t.durationMin&&n1?1:y),window.scrollTo(0,Math.floor(v)),function(e,t){var o=window.pageYOffset;if(e==t||o==t||(w=O)return m.cancelScroll(!0),i(n,t,h),r("scrollStop",l,n,s),g=null,f=null,!0}(v,E)||(f=window.requestAnimationFrame(A),g=e)};0===window.pageYOffset&&window.scrollTo(0,0),function(e,t,n){t||history.pushState&&n.updateURL&&history.pushState({smoothScroll:JSON.stringify(n),anchor:e.id},document.title,e===document.documentElement?"#top":"#"+e.id)}(n,h,l),"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches?i(n,Math.floor(E),!1):(r("scrollStart",l,n,s),m.cancelScroll(!0),window.requestAnimationFrame(A))}};var h=function(e){if(!e.defaultPrevented&&!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)&&"closest"in e.target&&(l=e.target.closest(s))&&"a"===l.tagName.toLowerCase()&&!e.target.closest(u.ignore)&&l.hostname===window.location.hostname&&l.pathname===window.location.pathname&&/#/.test(l.href)){var t,o;try{t=n(decodeURIComponent(l.hash))}catch(e){t=n(l.hash)}if("#"===t){if(!u.topOnEmptyHash)return;o=document.documentElement}else o=document.querySelector(t);(o=o||"#top"!==t?o:document.documentElement)&&(e.preventDefault(),function(e){if(history.replaceState&&e.updateURL&&!history.state){var t=window.location.hash;t=t||"",history.replaceState({smoothScroll:JSON.stringify(e),anchor:t||window.pageYOffset},document.title,t||window.location.href)}}(u),m.animateScroll(o,l))}},p=function(){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(u)){var e=history.state.anchor;"string"==typeof e&&e&&!(e=document.querySelector(n(history.state.anchor)))||m.animateScroll(e,null,{updateURL:!1})}};m.destroy=function(){u&&(document.removeEventListener("click",h,!1),window.removeEventListener("popstate",p,!1),m.cancelScroll(),u=null,l=null,d=null,f=null)};return function(){if(!("querySelector"in document&&"addEventListener"in window&&"requestAnimationFrame"in window&&"closest"in window.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";m.destroy(),u=t(e,c||{}),d=u.header?document.querySelector(u.header):null,document.addEventListener("click",h,!1),u.updateURL&&u.popstate&&window.addEventListener("popstate",p,!1)}(),m}})); diff --git a/dist/js/smooth-scroll.polyfills.js b/dist/smooth-scroll.polyfills.js old mode 100755 new mode 100644 similarity index 52% rename from dist/js/smooth-scroll.polyfills.js rename to dist/smooth-scroll.polyfills.js index 43c14be..3c98174 --- a/dist/js/smooth-scroll.polyfills.js +++ b/dist/smooth-scroll.polyfills.js @@ -1,104 +1,111 @@ -/*! - * smooth-scroll v12.1.5: Animate scrolling to anchor links - * (c) 2017 Chris Ferdinandi - * MIT License - * http://github.com/cferdinandi/smooth-scroll - */ - -/** - * closest() polyfill - * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill - */ -if (window.Element && !Element.prototype.closest) { - Element.prototype.closest = function(s) { - var matches = (this.document || this.ownerDocument).querySelectorAll(s), - i, - el = this; - do { - i = matches.length; - while (--i >= 0 && matches.item(i) !== el) {} - } while ((i < 0) && (el = el.parentElement)); - return el; - }; -} - -/** - * requestAnimationFrame() polyfill - * By Erik Möller. Fixes from Paul Irish and Tino Zijdel. - * @link http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - * @link http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating - * @license MIT - */ -(function() { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || - window[vendors[x]+'CancelRequestAnimationFrame']; - } +/*! SmoothScroll v16.1.4 | (c) 2020 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.SmoothScroll = factory()); +}(this, (function () { 'use strict'; - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout((function() { callback(currTime + timeToCall); }), - timeToCall); - lastTime = currTime + timeToCall; - return id; + /** + * closest() polyfill + * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill + */ + if (window.Element && !Element.prototype.closest) { + Element.prototype.closest = function(s) { + var matches = (this.document || this.ownerDocument).querySelectorAll(s), + i, + el = this; + do { + i = matches.length; + while (--i >= 0 && matches.item(i) !== el) {} + } while ((i < 0) && (el = el.parentElement)); + return el; }; } - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - } -}()); - -(function (root, factory) { - if ( typeof define === 'function' && define.amd ) { - define([], (function () { - return factory(root); - })); - } else if ( typeof exports === 'object' ) { - module.exports = factory(root); - } else { - root.SmoothScroll = factory(root); - } -})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) { + /** + * CustomEvent() polyfill + * https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill + */ + (function () { - 'use strict'; + if (typeof window.CustomEvent === "function") return false; - // - // Feature Test - // + function CustomEvent(event, params) { + params = params || { bubbles: false, cancelable: false, detail: undefined }; + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); + return evt; + } - var supports = - 'querySelector' in document && - 'addEventListener' in window && - 'requestAnimationFrame' in window && - 'closest' in window.Element.prototype; + CustomEvent.prototype = window.Event.prototype; + window.CustomEvent = CustomEvent; + })(); + + /** + * requestAnimationFrame() polyfill + * By Erik Möller. Fixes from Paul Irish and Tino Zijdel. + * @link http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + * @link http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating + * @license MIT + */ + (function() { + var lastTime = 0; + var vendors = ['ms', 'moz', 'webkit', 'o']; + for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { + window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; + window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || + window[vendors[x]+'CancelRequestAnimationFrame']; + } + + if (!window.requestAnimationFrame) { + window.requestAnimationFrame = function(callback, element) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function() { callback(currTime + timeToCall); }, + timeToCall); + lastTime = currTime + timeToCall; + return id; + }; + } + + if (!window.cancelAnimationFrame) { + window.cancelAnimationFrame = function(id) { + clearTimeout(id); + }; + } + }()); // // Default settings // var defaults = { + // Selectors ignore: '[data-scroll-ignore]', header: null, + topOnEmptyHash: true, - // Speed & Easing + // Speed & Duration speed: 500, + speedAsDuration: false, + durationMax: null, + durationMin: null, + clip: true, offset: 0, + + // Easing easing: 'easeInOutCubic', customEasing: null, - // Callback API - before: function () {}, - after: function () {} + // History + updateURL: true, + popstate: true, + + // Custom Events + emitEvents: true + }; @@ -107,35 +114,43 @@ if (window.Element && !Element.prototype.closest) { // /** - * Merge two or more objects. Returns a new object. - * @param {Object} objects The objects to merge together - * @returns {Object} Merged values of defaults and options + * Check if browser supports required methods + * @return {Boolean} Returns true if all required methods are supported */ - var extend = function () { + var supports = function () { + return ( + 'querySelector' in document && + 'addEventListener' in window && + 'requestAnimationFrame' in window && + 'closest' in window.Element.prototype + ); + }; - // Variables - var extended = {}; - var deep = false; - var i = 0; - var length = arguments.length; - - // Merge the object into the extended object - var merge = function (obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - extended[prop] = obj[prop]; - } + /** + * Merge two or more objects together. + * @param {Object} objects The objects to merge together + * @returns {Object} Merged values of defaults and options + */ + var extend = function () { + var merged = {}; + Array.prototype.forEach.call(arguments, function (obj) { + for (var key in obj) { + if (!obj.hasOwnProperty(key)) return; + merged[key] = obj[key]; } - }; + }); + return merged; + }; - // Loop through each object and conduct a merge - for ( ; i < length; i++ ) { - var obj = arguments[i]; - merge(obj); + /** + * Check to see if user prefers reduced motion + * @param {Object} settings Script settings + */ + var reduceMotion = function () { + if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { + return true; } - - return extended; - + return false; }; /** @@ -149,9 +164,9 @@ if (window.Element && !Element.prototype.closest) { /** * Escape special characters for use with querySelector - * @param {String} id The anchor ID to escape * @author Mathias Bynens * @link https://github.com/mathiasbynens/CSS.escape + * @param {String} id The anchor ID to escape */ var escapeCharacters = function (id) { @@ -222,6 +237,7 @@ if (window.Element && !Element.prototype.closest) { } + // Return sanitized hash return '#' + result; }; @@ -229,8 +245,8 @@ if (window.Element && !Element.prototype.closest) { /** * Calculate the easing pattern * @link https://gist.github.com/gre/1650294 - * @param {String} type Easing pattern - * @param {Number} time Time animation should take to complete + * @param {Object} settings Easing pattern + * @param {Number} time Time animation should take to complete * @returns {Number} */ var easingPattern = function (settings, time) { @@ -270,12 +286,14 @@ if (window.Element && !Element.prototype.closest) { /** * Calculate how far to scroll - * @param {Element} anchor The anchor element to scroll to - * @param {Number} headerHeight Height of a fixed header, if any - * @param {Number} offset Number of pixels by which to offset scroll + * Clip support added by robjtede - https://github.com/cferdinandi/smooth-scroll/issues/405 + * @param {Element} anchor The anchor element to scroll to + * @param {Number} headerHeight Height of a fixed header, if any + * @param {Number} offset Number of pixels by which to offset scroll + * @param {Boolean} clip If true, adjust scroll distance to prevent abrupt stops near the bottom of the page * @returns {Number} */ - var getEndLocation = function (anchor, headerHeight, offset) { + var getEndLocation = function (anchor, headerHeight, offset, clip) { var location = 0; if (anchor.offsetParent) { do { @@ -284,7 +302,10 @@ if (window.Element && !Element.prototype.closest) { } while (anchor); } location = Math.max(location - headerHeight - offset, 0); - return location; + if (clip) { + location = Math.min(location, getDocumentHeight() - window.innerHeight); + } + return location; }; /** @@ -296,6 +317,66 @@ if (window.Element && !Element.prototype.closest) { return !header ? 0 : (getHeight(header) + header.offsetTop); }; + /** + * Calculate the speed to use for the animation + * @param {Number} distance The distance to travel + * @param {Object} settings The plugin settings + * @return {Number} How fast to animate + */ + var getSpeed = function (distance, settings) { + var speed = settings.speedAsDuration ? settings.speed : Math.abs(distance / 1000 * settings.speed); + if (settings.durationMax && speed > settings.durationMax) return settings.durationMax; + if (settings.durationMin && speed < settings.durationMin) return settings.durationMin; + return parseInt(speed, 10); + }; + + var setHistory = function (options) { + + // Make sure this should run + if (!history.replaceState || !options.updateURL || history.state) return; + + // Get the hash to use + var hash = window.location.hash; + hash = hash ? hash : ''; + + // Set a default history + history.replaceState( + { + smoothScroll: JSON.stringify(options), + anchor: hash ? hash : window.pageYOffset + }, + document.title, + hash ? hash : window.location.href + ); + + }; + + /** + * Update the URL + * @param {Node} anchor The anchor that was scrolled to + * @param {Boolean} isNum If true, anchor is a number + * @param {Object} options Settings for Smooth Scroll + */ + var updateURL = function (anchor, isNum, options) { + + // Bail if the anchor is a number + if (isNum) return; + + // Verify that pushState is supported and the updateURL option is enabled + if (!history.pushState || !options.updateURL) return; + + // Update URL + history.pushState( + { + smoothScroll: JSON.stringify(options), + anchor: anchor.id + }, + document.title, + anchor === document.documentElement ? '#top' : '#' + anchor.id + ); + + }; + /** * Bring the anchored element into focus * @param {Node} anchor The anchor element @@ -304,12 +385,17 @@ if (window.Element && !Element.prototype.closest) { */ var adjustFocus = function (anchor, endLocation, isNum) { + // Is scrolling to top of page, blur + if (anchor === 0) { + document.body.focus(); + } + // Don't run if scrolling to a number on the page if (isNum) return; // Otherwise, bring anchor element into focus anchor.focus(); - if (document.activeElement.id !== anchor.id) { + if (document.activeElement !== anchor) { anchor.setAttribute('tabindex', '-1'); anchor.focus(); anchor.style.outline = 'none'; @@ -319,14 +405,22 @@ if (window.Element && !Element.prototype.closest) { }; /** - * Check to see if user prefers reduced motion - * @param {Object} settings Script settings + * Emit a custom event + * @param {String} type The event type + * @param {Object} options The settings object + * @param {Node} anchor The anchor element + * @param {Node} toggle The toggle element */ - var reduceMotion = function (settings) { - if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { - return true; - } - return false; + var emitEvent = function (type, options, anchor, toggle) { + if (!options.emitEvents || typeof window.CustomEvent !== 'function') return; + var event = new CustomEvent(type, { + bubbles: true, + detail: { + anchor: anchor, + toggle: toggle + } + }); + document.dispatchEvent(event); }; @@ -341,7 +435,7 @@ if (window.Element && !Element.prototype.closest) { // var smoothScroll = {}; // Object for public APIs - var settings, anchor, toggle, fixedHeader, headerHeight, eventTimeout, animationInterval; + var settings, toggle, fixedHeader, animationInterval; // @@ -351,9 +445,11 @@ if (window.Element && !Element.prototype.closest) { /** * Cancel a scroll-in-progress */ - smoothScroll.cancelScroll = function () { - // clearInterval(animationInterval); + smoothScroll.cancelScroll = function (noEvent) { cancelAnimationFrame(animationInterval); + animationInterval = null; + if (noEvent) return; + emitEvent('scrollCancel', settings); }; /** @@ -364,26 +460,27 @@ if (window.Element && !Element.prototype.closest) { */ smoothScroll.animateScroll = function (anchor, toggle, options) { + // Cancel any in progress scrolls + smoothScroll.cancelScroll(); + // Local settings - var animateSettings = extend(settings || defaults, options || {}); // Merge user options with defaults + var _settings = extend(settings || defaults, options || {}); // Merge user options with defaults // Selectors and variables var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; var anchorElem = isNum || !anchor.tagName ? null : anchor; if (!isNum && !anchorElem) return; var startLocation = window.pageYOffset; // Current location on the page - if (animateSettings.header && !fixedHeader) { + if (_settings.header && !fixedHeader) { // Get the fixed header if not already set - fixedHeader = document.querySelector( animateSettings.header ); + fixedHeader = document.querySelector(_settings.header); } - if (!headerHeight) { - // Get the height of a fixed header if one exists and not already set - headerHeight = getHeaderHeight(fixedHeader); - } - var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof animateSettings.offset === 'function' ? animateSettings.offset() : animateSettings.offset), 10)); // Location to scroll to + var headerHeight = getHeaderHeight(fixedHeader); + var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof _settings.offset === 'function' ? _settings.offset(anchor, toggle) : _settings.offset), 10), _settings.clip); // Location to scroll to var distance = endLocation - startLocation; // distance to travel var documentHeight = getDocumentHeight(); var timeLapsed = 0; + var speed = getSpeed(distance, _settings); var start, percentage, position; /** @@ -398,19 +495,20 @@ if (window.Element && !Element.prototype.closest) { var currentLocation = window.pageYOffset; // Check if the end location has been reached yet (or we've hit the end of the document) - if ( position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight )) { + if (position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight)) { // Clear the animation timer - smoothScroll.cancelScroll(); + smoothScroll.cancelScroll(true); // Bring the anchored element into focus adjustFocus(anchor, endLocation, isNum); - // Run callback after animation complete - animateSettings.after(anchor, toggle); + // Emit a custom event + emitEvent('scrollStop', _settings, anchor, toggle); // Reset start start = null; + animationInterval = null; return true; @@ -423,12 +521,12 @@ if (window.Element && !Element.prototype.closest) { var loopAnimateScroll = function (timestamp) { if (!start) { start = timestamp; } timeLapsed += timestamp - start; - percentage = (timeLapsed / parseInt(animateSettings.speed, 10)); + percentage = speed === 0 ? 0 : (timeLapsed / speed); percentage = (percentage > 1) ? 1 : percentage; - position = startLocation + (distance * easingPattern(animateSettings, percentage)); + position = startLocation + (distance * easingPattern(_settings, percentage)); window.scrollTo(0, Math.floor(position)); if (!stopAnimateScroll(position, endLocation)) { - window.requestAnimationFrame(loopAnimateScroll); + animationInterval = window.requestAnimationFrame(loopAnimateScroll); start = timestamp; } }; @@ -438,36 +536,24 @@ if (window.Element && !Element.prototype.closest) { * @link https://github.com/cferdinandi/smooth-scroll/issues/45 */ if (window.pageYOffset === 0) { - window.scrollTo( 0, 0 ); + window.scrollTo(0, 0); } - // Run callback before animation starts - animateSettings.before(anchor, toggle); - - // Start scrolling animation - smoothScroll.cancelScroll(); - window.requestAnimationFrame(loopAnimateScroll); - - - }; - - /** - * Handle has change event - */ - var hashChangeHandler = function (event) { + // Update the URL + updateURL(anchor, isNum, _settings); - // Only run if there's an anchor element to scroll to - if (!anchor) return; - - // Reset the anchor element's ID - anchor.id = anchor.getAttribute('data-scroll-id'); + // If the user prefers reduced motion, jump to location + if (reduceMotion()) { + adjustFocus(anchor, Math.floor(endLocation), false); + return; + } - // Scroll to the anchored content - smoothScroll.animateScroll(anchor, toggle); + // Emit a custom event + emitEvent('scrollStart', _settings, anchor, toggle); - // Reset anchor and toggle - anchor = null; - toggle = null; + // Start scrolling animation + smoothScroll.cancelScroll(true); + window.requestAnimationFrame(loopAnimateScroll); }; @@ -476,11 +562,16 @@ if (window.Element && !Element.prototype.closest) { */ var clickHandler = function (event) { - // Don't run if the user prefers reduced motion - if (reduceMotion(settings)) return; + // Don't run if event was canceled but still bubbled up + // By @mgreter - https://github.com/cferdinandi/smooth-scroll/pull/462/ + if (event.defaultPrevented) return; - // Don't run if right-click or command/control + click - if (event.button !== 0 || event.metaKey || event.ctrlKey) return; + // Don't run if right-click or command/control + click or shift + click + if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey) return; + + // Check if event.target has closest() method + // By @totegi - https://github.com/cferdinandi/smooth-scroll/pull/401/ + if (!('closest' in event.target)) return; // Check if a smooth scroll link was clicked toggle = event.target.closest(selector); @@ -489,7 +580,7 @@ if (window.Element && !Element.prototype.closest) { // Only run if link is an anchor and points to the current page if (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return; - // Get the sanitized hash + // Get an escaped version of the hash var hash; try { hash = escapeCharacters(decodeURIComponent(toggle.hash)); @@ -497,58 +588,46 @@ if (window.Element && !Element.prototype.closest) { hash = escapeCharacters(toggle.hash); } - // If the hash is empty, scroll to the top of the page + // Get the anchored element + var anchor; if (hash === '#') { - - // Prevent default link behavior - event.preventDefault(); - - // Set the anchored element - anchor = document.body; - - // Save or create the ID as a data attribute and remove it (prevents scroll jump) - var id = anchor.id ? anchor.id : 'smooth-scroll-top'; - anchor.setAttribute('data-scroll-id', id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - // Otherwise, update the hash - if (window.location.hash.substring(1) === id) { - hashChangeHandler(); - } else { - window.location.hash = id; - } - - return; - + if (!settings.topOnEmptyHash) return; + anchor = document.documentElement; + } else { + anchor = document.querySelector(hash); } + anchor = !anchor && hash === '#top' ? document.documentElement : anchor; - // Get the anchored element - anchor = document.querySelector(hash); - - // If anchored element exists, save the ID as a data attribute and remove it (prevents scroll jump) + // If anchored element exists, scroll to it if (!anchor) return; - anchor.setAttribute('data-scroll-id', anchor.id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - if (toggle.hash === window.location.hash) { - event.preventDefault(); - hashChangeHandler(); - } + event.preventDefault(); + setHistory(settings); + smoothScroll.animateScroll(anchor, toggle); }; /** - * On window scroll and resize, only run events at a rate of 15fps for better performance + * Animate scroll on popstate events */ - var resizeThrottler = function (event) { - if (!eventTimeout) { - eventTimeout = setTimeout((function() { - eventTimeout = null; // Reset timeout - headerHeight = getHeaderHeight(fixedHeader); // Get the height of a fixed header if one exists - }), 66); + var popstateHandler = function () { + + // Stop if history.state doesn't exist (ex. if clicking on a broken anchor link). + // fixes `Cannot read property 'smoothScroll' of null` error getting thrown. + if (history.state === null) return; + + // Only run if state is a popstate record for this instantiation + if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return; + + // Get the anchor + var anchor = history.state.anchor; + if (typeof anchor === 'string' && anchor) { + anchor = document.querySelector(escapeCharacters(history.state.anchor)); + if (!anchor) return; } + + // Animate scroll to anchor link + smoothScroll.animateScroll(anchor, null, {updateURL: false}); + }; /** @@ -561,29 +640,27 @@ if (window.Element && !Element.prototype.closest) { // Remove event listeners document.removeEventListener('click', clickHandler, false); - window.removeEventListener('resize', resizeThrottler, false); + window.removeEventListener('popstate', popstateHandler, false); // Cancel any scrolls-in-progress smoothScroll.cancelScroll(); // Reset variables settings = null; - anchor = null; toggle = null; fixedHeader = null; - headerHeight = null; - eventTimeout = null; animationInterval = null; + }; /** * Initialize Smooth Scroll * @param {Object} options User settings */ - smoothScroll.init = function (options) { + var init = function () { // feature test - if (!supports) return; + if (!supports()) throw 'Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.'; // Destroy any existing initializations smoothScroll.destroy(); @@ -591,17 +668,13 @@ if (window.Element && !Element.prototype.closest) { // Selectors and variables settings = extend(defaults, options || {}); // Merge user options with defaults fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header - headerHeight = getHeaderHeight(fixedHeader); // When a toggle is clicked, run the click handler document.addEventListener('click', clickHandler, false); - // Listen for hash changes - window.addEventListener('hashchange', hashChangeHandler, false); - - // If window is resized and there's a fixed header, recalculate its size - if (fixedHeader) { - window.addEventListener('resize', resizeThrottler, false); + // If updateURL and popState are enabled, listen for pop events + if (settings.updateURL && settings.popstate) { + window.addEventListener('popstate', popstateHandler, false); } }; @@ -611,7 +684,7 @@ if (window.Element && !Element.prototype.closest) { // Initialize plugin // - smoothScroll.init(options); + init(); // @@ -624,4 +697,4 @@ if (window.Element && !Element.prototype.closest) { return SmoothScroll; -})); \ No newline at end of file +}))); diff --git a/dist/smooth-scroll.polyfills.min.js b/dist/smooth-scroll.polyfills.min.js new file mode 100644 index 0000000..575a67b --- /dev/null +++ b/dist/smooth-scroll.polyfills.min.js @@ -0,0 +1,10 @@ +/*! SmoothScroll v16.1.4 | (c) 2020 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).SmoothScroll=t()}(this,(function(){"use strict";window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;--t>=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){if("function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(), +/** + * requestAnimationFrame() polyfill + * By Erik Möller. Fixes from Paul Irish and Tino Zijdel. + * @link http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + * @link http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating + * @license MIT + */ +function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n=1&&t<=31||127==t||0===i&&t>=48&&t<=57||1===i&&t>=48&&t<=57&&45===r?a+="\\"+t.toString(16)+" ":a+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(i):"\\"+n.charAt(i)}return"#"+a},o=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},i=function(e){return e?(t=e,parseInt(window.getComputedStyle(t).height,10)+e.offsetTop):0;var t},a=function(e,t,n){0===e&&document.body.focus(),n||(e.focus(),document.activeElement!==e&&(e.setAttribute("tabindex","-1"),e.focus(),e.style.outline="none"),window.scrollTo(0,t))},r=function(e,t,n,o){if(t.emitEvents&&"function"==typeof window.CustomEvent){var i=new CustomEvent(e,{bubbles:!0,detail:{anchor:n,toggle:o}});document.dispatchEvent(i)}};return function(c,u){var s,l,d,m,f={};f.cancelScroll=function(e){cancelAnimationFrame(m),m=null,e||r("scrollCancel",s)},f.animateScroll=function(n,c,u){f.cancelScroll();var l=t(s||e,u||{}),w="[object Number]"===Object.prototype.toString.call(n),h=w||!n.tagName?null:n;if(w||h){var p=window.pageYOffset;l.header&&!d&&(d=document.querySelector(l.header));var g,y,v,S=i(d),E=w?n:function(e,t,n,i){var a=0;if(e.offsetParent)do{a+=e.offsetTop,e=e.offsetParent}while(e);return a=Math.max(a-t-n,0),i&&(a=Math.min(a,o()-window.innerHeight)),a}(h,S,parseInt("function"==typeof l.offset?l.offset(n,c):l.offset,10),l.clip),b=E-p,A=o(),O=0,C=function(e,t){var n=t.speedAsDuration?t.speed:Math.abs(e/1e3*t.speed);return t.durationMax&&n>t.durationMax?t.durationMax:t.durationMin&&n1?1:y),window.scrollTo(0,Math.floor(v)),function(e,t){var o=window.pageYOffset;if(e==t||o==t||(p=A)return f.cancelScroll(!0),a(n,t,w),r("scrollStop",l,n,c),g=null,m=null,!0}(v,E)||(m=window.requestAnimationFrame(M),g=e)};0===window.pageYOffset&&window.scrollTo(0,0),function(e,t,n){t||history.pushState&&n.updateURL&&history.pushState({smoothScroll:JSON.stringify(n),anchor:e.id},document.title,e===document.documentElement?"#top":"#"+e.id)}(n,w,l),"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches?a(n,Math.floor(E),!1):(r("scrollStart",l,n,c),f.cancelScroll(!0),window.requestAnimationFrame(M))}};var w=function(e){if(!e.defaultPrevented&&!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)&&"closest"in e.target&&(l=e.target.closest(c))&&"a"===l.tagName.toLowerCase()&&!e.target.closest(s.ignore)&&l.hostname===window.location.hostname&&l.pathname===window.location.pathname&&/#/.test(l.href)){var t,o;try{t=n(decodeURIComponent(l.hash))}catch(e){t=n(l.hash)}if("#"===t){if(!s.topOnEmptyHash)return;o=document.documentElement}else o=document.querySelector(t);(o=o||"#top"!==t?o:document.documentElement)&&(e.preventDefault(),function(e){if(history.replaceState&&e.updateURL&&!history.state){var t=window.location.hash;t=t||"",history.replaceState({smoothScroll:JSON.stringify(e),anchor:t||window.pageYOffset},document.title,t||window.location.href)}}(s),f.animateScroll(o,l))}},h=function(){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(s)){var e=history.state.anchor;"string"==typeof e&&e&&!(e=document.querySelector(n(history.state.anchor)))||f.animateScroll(e,null,{updateURL:!1})}};f.destroy=function(){s&&(document.removeEventListener("click",w,!1),window.removeEventListener("popstate",h,!1),f.cancelScroll(),s=null,l=null,d=null,m=null)};return function(){if(!("querySelector"in document&&"addEventListener"in window&&"requestAnimationFrame"in window&&"closest"in window.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";f.destroy(),s=t(e,u||{}),d=s.header?document.querySelector(s.header):null,document.addEventListener("click",w,!1),s.updateURL&&s.popstate&&window.addEventListener("popstate",h,!1)}(),f}})); diff --git a/docs/dist/js/smooth-scroll.js b/docs/dist/js/smooth-scroll.js deleted file mode 100755 index dec5cb4..0000000 --- a/docs/dist/js/smooth-scroll.js +++ /dev/null @@ -1,576 +0,0 @@ -/*! - * smooth-scroll v12.1.5: Animate scrolling to anchor links - * (c) 2017 Chris Ferdinandi - * MIT License - * http://github.com/cferdinandi/smooth-scroll - */ - -(function (root, factory) { - if ( typeof define === 'function' && define.amd ) { - define([], (function () { - return factory(root); - })); - } else if ( typeof exports === 'object' ) { - module.exports = factory(root); - } else { - root.SmoothScroll = factory(root); - } -})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) { - - 'use strict'; - - // - // Feature Test - // - - var supports = - 'querySelector' in document && - 'addEventListener' in window && - 'requestAnimationFrame' in window && - 'closest' in window.Element.prototype; - - - // - // Default settings - // - - var defaults = { - // Selectors - ignore: '[data-scroll-ignore]', - header: null, - - // Speed & Easing - speed: 500, - offset: 0, - easing: 'easeInOutCubic', - customEasing: null, - - // Callback API - before: function () {}, - after: function () {} - }; - - - // - // Utility Methods - // - - /** - * Merge two or more objects. Returns a new object. - * @param {Object} objects The objects to merge together - * @returns {Object} Merged values of defaults and options - */ - var extend = function () { - - // Variables - var extended = {}; - var deep = false; - var i = 0; - var length = arguments.length; - - // Merge the object into the extended object - var merge = function (obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - extended[prop] = obj[prop]; - } - } - }; - - // Loop through each object and conduct a merge - for ( ; i < length; i++ ) { - var obj = arguments[i]; - merge(obj); - } - - return extended; - - }; - - /** - * Get the height of an element. - * @param {Node} elem The element to get the height of - * @return {Number} The element's height in pixels - */ - var getHeight = function (elem) { - return parseInt(window.getComputedStyle(elem).height, 10); - }; - - /** - * Escape special characters for use with querySelector - * @param {String} id The anchor ID to escape - * @author Mathias Bynens - * @link https://github.com/mathiasbynens/CSS.escape - */ - var escapeCharacters = function (id) { - - // Remove leading hash - if (id.charAt(0) === '#') { - id = id.substr(1); - } - - var string = String(id); - var length = string.length; - var index = -1; - var codeUnit; - var result = ''; - var firstCodeUnit = string.charCodeAt(0); - while (++index < length) { - codeUnit = string.charCodeAt(index); - // Note: there’s no need to special-case astral symbols, surrogate - // pairs, or lone surrogates. - - // If the character is NULL (U+0000), then throw an - // `InvalidCharacterError` exception and terminate these steps. - if (codeUnit === 0x0000) { - throw new InvalidCharacterError( - 'Invalid character: the input contains U+0000.' - ); - } - - if ( - // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is - // U+007F, […] - (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F || - // If the character is the first character and is in the range [0-9] - // (U+0030 to U+0039), […] - (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) || - // If the character is the second character and is in the range [0-9] - // (U+0030 to U+0039) and the first character is a `-` (U+002D), […] - ( - index === 1 && - codeUnit >= 0x0030 && codeUnit <= 0x0039 && - firstCodeUnit === 0x002D - ) - ) { - // http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point - result += '\\' + codeUnit.toString(16) + ' '; - continue; - } - - // If the character is not handled by one of the above rules and is - // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or - // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to - // U+005A), or [a-z] (U+0061 to U+007A), […] - if ( - codeUnit >= 0x0080 || - codeUnit === 0x002D || - codeUnit === 0x005F || - codeUnit >= 0x0030 && codeUnit <= 0x0039 || - codeUnit >= 0x0041 && codeUnit <= 0x005A || - codeUnit >= 0x0061 && codeUnit <= 0x007A - ) { - // the character itself - result += string.charAt(index); - continue; - } - - // Otherwise, the escaped character. - // http://dev.w3.org/csswg/cssom/#escape-a-character - result += '\\' + string.charAt(index); - - } - - return '#' + result; - - }; - - /** - * Calculate the easing pattern - * @link https://gist.github.com/gre/1650294 - * @param {String} type Easing pattern - * @param {Number} time Time animation should take to complete - * @returns {Number} - */ - var easingPattern = function (settings, time) { - var pattern; - - // Default Easing Patterns - if (settings.easing === 'easeInQuad') pattern = time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuad') pattern = time * (2 - time); // decelerating to zero velocity - if (settings.easing === 'easeInOutQuad') pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInCubic') pattern = time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutCubic') pattern = (--time) * time * time + 1; // decelerating to zero velocity - if (settings.easing === 'easeInOutCubic') pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInQuart') pattern = time * time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuart') pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity - if (settings.easing === 'easeInOutQuart') pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInQuint') pattern = time * time * time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuint') pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity - if (settings.easing === 'easeInOutQuint') pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration - - // Custom Easing Patterns - if (!!settings.customEasing) pattern = settings.customEasing(time); - - return pattern || time; // no easing, no acceleration - }; - - /** - * Determine the document's height - * @returns {Number} - */ - var getDocumentHeight = function () { - return Math.max( - document.body.scrollHeight, document.documentElement.scrollHeight, - document.body.offsetHeight, document.documentElement.offsetHeight, - document.body.clientHeight, document.documentElement.clientHeight - ); - }; - - /** - * Calculate how far to scroll - * @param {Element} anchor The anchor element to scroll to - * @param {Number} headerHeight Height of a fixed header, if any - * @param {Number} offset Number of pixels by which to offset scroll - * @returns {Number} - */ - var getEndLocation = function (anchor, headerHeight, offset) { - var location = 0; - if (anchor.offsetParent) { - do { - location += anchor.offsetTop; - anchor = anchor.offsetParent; - } while (anchor); - } - location = Math.max(location - headerHeight - offset, 0); - return location; - }; - - /** - * Get the height of the fixed header - * @param {Node} header The header - * @return {Number} The height of the header - */ - var getHeaderHeight = function (header) { - return !header ? 0 : (getHeight(header) + header.offsetTop); - }; - - /** - * Bring the anchored element into focus - * @param {Node} anchor The anchor element - * @param {Number} endLocation The end location to scroll to - * @param {Boolean} isNum If true, scroll is to a position rather than an element - */ - var adjustFocus = function (anchor, endLocation, isNum) { - - // Don't run if scrolling to a number on the page - if (isNum) return; - - // Otherwise, bring anchor element into focus - anchor.focus(); - if (document.activeElement.id !== anchor.id) { - anchor.setAttribute('tabindex', '-1'); - anchor.focus(); - anchor.style.outline = 'none'; - } - window.scrollTo(0 , endLocation); - - }; - - /** - * Check to see if user prefers reduced motion - * @param {Object} settings Script settings - */ - var reduceMotion = function (settings) { - if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { - return true; - } - return false; - }; - - - // - // SmoothScroll Constructor - // - - var SmoothScroll = function (selector, options) { - - // - // Variables - // - - var smoothScroll = {}; // Object for public APIs - var settings, anchor, toggle, fixedHeader, headerHeight, eventTimeout, animationInterval; - - - // - // Methods - // - - /** - * Cancel a scroll-in-progress - */ - smoothScroll.cancelScroll = function () { - // clearInterval(animationInterval); - cancelAnimationFrame(animationInterval); - }; - - /** - * Start/stop the scrolling animation - * @param {Node|Number} anchor The element or position to scroll to - * @param {Element} toggle The element that toggled the scroll event - * @param {Object} options - */ - smoothScroll.animateScroll = function (anchor, toggle, options) { - - // Local settings - var animateSettings = extend(settings || defaults, options || {}); // Merge user options with defaults - - // Selectors and variables - var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; - var anchorElem = isNum || !anchor.tagName ? null : anchor; - if (!isNum && !anchorElem) return; - var startLocation = window.pageYOffset; // Current location on the page - if (animateSettings.header && !fixedHeader) { - // Get the fixed header if not already set - fixedHeader = document.querySelector( animateSettings.header ); - } - if (!headerHeight) { - // Get the height of a fixed header if one exists and not already set - headerHeight = getHeaderHeight(fixedHeader); - } - var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof animateSettings.offset === 'function' ? animateSettings.offset() : animateSettings.offset), 10)); // Location to scroll to - var distance = endLocation - startLocation; // distance to travel - var documentHeight = getDocumentHeight(); - var timeLapsed = 0; - var start, percentage, position; - - /** - * Stop the scroll animation when it reaches its target (or the bottom/top of page) - * @param {Number} position Current position on the page - * @param {Number} endLocation Scroll to location - * @param {Number} animationInterval How much to scroll on this loop - */ - var stopAnimateScroll = function (position, endLocation) { - - // Get the current location - var currentLocation = window.pageYOffset; - - // Check if the end location has been reached yet (or we've hit the end of the document) - if ( position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight )) { - - // Clear the animation timer - smoothScroll.cancelScroll(); - - // Bring the anchored element into focus - adjustFocus(anchor, endLocation, isNum); - - // Run callback after animation complete - animateSettings.after(anchor, toggle); - - // Reset start - start = null; - - return true; - - } - }; - - /** - * Loop scrolling animation - */ - var loopAnimateScroll = function (timestamp) { - if (!start) { start = timestamp; } - timeLapsed += timestamp - start; - percentage = (timeLapsed / parseInt(animateSettings.speed, 10)); - percentage = (percentage > 1) ? 1 : percentage; - position = startLocation + (distance * easingPattern(animateSettings, percentage)); - window.scrollTo(0, Math.floor(position)); - if (!stopAnimateScroll(position, endLocation)) { - window.requestAnimationFrame(loopAnimateScroll); - start = timestamp; - } - }; - - /** - * Reset position to fix weird iOS bug - * @link https://github.com/cferdinandi/smooth-scroll/issues/45 - */ - if (window.pageYOffset === 0) { - window.scrollTo( 0, 0 ); - } - - // Run callback before animation starts - animateSettings.before(anchor, toggle); - - // Start scrolling animation - smoothScroll.cancelScroll(); - window.requestAnimationFrame(loopAnimateScroll); - - - }; - - /** - * Handle has change event - */ - var hashChangeHandler = function (event) { - - // Only run if there's an anchor element to scroll to - if (!anchor) return; - - // Reset the anchor element's ID - anchor.id = anchor.getAttribute('data-scroll-id'); - - // Scroll to the anchored content - smoothScroll.animateScroll(anchor, toggle); - - // Reset anchor and toggle - anchor = null; - toggle = null; - - }; - - /** - * If smooth scroll element clicked, animate scroll - */ - var clickHandler = function (event) { - - // Don't run if the user prefers reduced motion - if (reduceMotion(settings)) return; - - // Don't run if right-click or command/control + click - if (event.button !== 0 || event.metaKey || event.ctrlKey) return; - - // Check if a smooth scroll link was clicked - toggle = event.target.closest(selector); - if (!toggle || toggle.tagName.toLowerCase() !== 'a' || event.target.closest(settings.ignore)) return; - - // Only run if link is an anchor and points to the current page - if (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return; - - // Get the sanitized hash - var hash; - try { - hash = escapeCharacters(decodeURIComponent(toggle.hash)); - } catch(e) { - hash = escapeCharacters(toggle.hash); - } - - // If the hash is empty, scroll to the top of the page - if (hash === '#') { - - // Prevent default link behavior - event.preventDefault(); - - // Set the anchored element - anchor = document.body; - - // Save or create the ID as a data attribute and remove it (prevents scroll jump) - var id = anchor.id ? anchor.id : 'smooth-scroll-top'; - anchor.setAttribute('data-scroll-id', id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - // Otherwise, update the hash - if (window.location.hash.substring(1) === id) { - hashChangeHandler(); - } else { - window.location.hash = id; - } - - return; - - } - - // Get the anchored element - anchor = document.querySelector(hash); - - // If anchored element exists, save the ID as a data attribute and remove it (prevents scroll jump) - if (!anchor) return; - anchor.setAttribute('data-scroll-id', anchor.id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - if (toggle.hash === window.location.hash) { - event.preventDefault(); - hashChangeHandler(); - } - - }; - - /** - * On window scroll and resize, only run events at a rate of 15fps for better performance - */ - var resizeThrottler = function (event) { - if (!eventTimeout) { - eventTimeout = setTimeout((function() { - eventTimeout = null; // Reset timeout - headerHeight = getHeaderHeight(fixedHeader); // Get the height of a fixed header if one exists - }), 66); - } - }; - - /** - * Destroy the current initialization. - */ - smoothScroll.destroy = function () { - - // If plugin isn't already initialized, stop - if (!settings) return; - - // Remove event listeners - document.removeEventListener('click', clickHandler, false); - window.removeEventListener('resize', resizeThrottler, false); - - // Cancel any scrolls-in-progress - smoothScroll.cancelScroll(); - - // Reset variables - settings = null; - anchor = null; - toggle = null; - fixedHeader = null; - headerHeight = null; - eventTimeout = null; - animationInterval = null; - }; - - /** - * Initialize Smooth Scroll - * @param {Object} options User settings - */ - smoothScroll.init = function (options) { - - // feature test - if (!supports) return; - - // Destroy any existing initializations - smoothScroll.destroy(); - - // Selectors and variables - settings = extend(defaults, options || {}); // Merge user options with defaults - fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header - headerHeight = getHeaderHeight(fixedHeader); - - // When a toggle is clicked, run the click handler - document.addEventListener('click', clickHandler, false); - - // Listen for hash changes - window.addEventListener('hashchange', hashChangeHandler, false); - - // If window is resized and there's a fixed header, recalculate its size - if (fixedHeader) { - window.addEventListener('resize', resizeThrottler, false); - } - - }; - - - // - // Initialize plugin - // - - smoothScroll.init(options); - - - // - // Public APIs - // - - return smoothScroll; - - }; - - return SmoothScroll; - -})); \ No newline at end of file diff --git a/docs/dist/js/smooth-scroll.min.js b/docs/dist/js/smooth-scroll.min.js deleted file mode 100755 index 0cd1cf2..0000000 --- a/docs/dist/js/smooth-scroll.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! smooth-scroll v12.1.5 | (c) 2017 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ -!(function(e,t){"function"==typeof define&&define.amd?define([],(function(){return t(e)})):"object"==typeof exports?module.exports=t(e):e.SmoothScroll=t(e)})("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,(function(e){"use strict";var t="querySelector"in document&&"addEventListener"in e&&"requestAnimationFrame"in e&&"closest"in e.Element.prototype,n={ignore:"[data-scroll-ignore]",header:null,speed:500,offset:0,easing:"easeInOutCubic",customEasing:null,before:function(){},after:function(){}},o=function(){for(var e={},t=0,n=arguments.length;t=1&&t<=31||127==t||0===a&&t>=48&&t<=57||1===a&&t>=48&&t<=57&&45===i?r+="\\"+t.toString(16)+" ":r+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(a):"\\"+n.charAt(a)}return"#"+r},i=function(e,t){var n;return"easeInQuad"===e.easing&&(n=t*t),"easeOutQuad"===e.easing&&(n=t*(2-t)),"easeInOutQuad"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e.easing&&(n=t*t*t),"easeOutCubic"===e.easing&&(n=--t*t*t+1),"easeInOutCubic"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e.easing&&(n=t*t*t*t),"easeOutQuart"===e.easing&&(n=1- --t*t*t*t),"easeInOutQuart"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e.easing&&(n=t*t*t*t*t),"easeOutQuint"===e.easing&&(n=1+--t*t*t*t*t),"easeInOutQuint"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t},u=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},c=function(e,t,n){var o=0;if(e.offsetParent)do{o+=e.offsetTop,e=e.offsetParent}while(e);return o=Math.max(o-t-n,0)},s=function(e){return e?a(e)+e.offsetTop:0},l=function(t,n,o){o||(t.focus(),document.activeElement.id!==t.id&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),e.scrollTo(0,n))},f=function(t){return!!("matchMedia"in e&&e.matchMedia("(prefers-reduced-motion)").matches)};return function(a,d){var m,h,g,p,v,b,y,S={};S.cancelScroll=function(){cancelAnimationFrame(y)},S.animateScroll=function(t,a,r){var f=o(m||n,r||{}),d="[object Number]"===Object.prototype.toString.call(t),h=d||!t.tagName?null:t;if(d||h){var g=e.pageYOffset;f.header&&!p&&(p=document.querySelector(f.header)),v||(v=s(p));var b,y,E,I=d?t:c(h,v,parseInt("function"==typeof f.offset?f.offset():f.offset,10)),O=I-g,A=u(),C=0,w=function(n,o){var r=e.pageYOffset;if(n==o||r==o||(g=A)return S.cancelScroll(),l(t,o,d),f.after(t,a),b=null,!0},Q=function(t){b||(b=t),C+=t-b,y=C/parseInt(f.speed,10),y=y>1?1:y,E=g+O*i(f,y),e.scrollTo(0,Math.floor(E)),w(E,I)||(e.requestAnimationFrame(Q),b=t)};0===e.pageYOffset&&e.scrollTo(0,0),f.before(t,a),S.cancelScroll(),e.requestAnimationFrame(Q)}};var E=function(e){h&&(h.id=h.getAttribute("data-scroll-id"),S.animateScroll(h,g),h=null,g=null)},I=function(t){if(!f()&&0===t.button&&!t.metaKey&&!t.ctrlKey&&(g=t.target.closest(a))&&"a"===g.tagName.toLowerCase()&&!t.target.closest(m.ignore)&&g.hostname===e.location.hostname&&g.pathname===e.location.pathname&&/#/.test(g.href)){var n;try{n=r(decodeURIComponent(g.hash))}catch(e){n=r(g.hash)}if("#"===n){t.preventDefault(),h=document.body;var o=h.id?h.id:"smooth-scroll-top";return h.setAttribute("data-scroll-id",o),h.id="",void(e.location.hash.substring(1)===o?E():e.location.hash=o)}h=document.querySelector(n),h&&(h.setAttribute("data-scroll-id",h.id),h.id="",g.hash===e.location.hash&&(t.preventDefault(),E()))}},O=function(e){b||(b=setTimeout((function(){b=null,v=s(p)}),66))};return S.destroy=function(){m&&(document.removeEventListener("click",I,!1),e.removeEventListener("resize",O,!1),S.cancelScroll(),m=null,h=null,g=null,p=null,v=null,b=null,y=null)},S.init=function(a){t&&(S.destroy(),m=o(n,a||{}),p=m.header?document.querySelector(m.header):null,v=s(p),document.addEventListener("click",I,!1),e.addEventListener("hashchange",E,!1),p&&e.addEventListener("resize",O,!1))},S.init(d),S}})); \ No newline at end of file diff --git a/docs/dist/js/smooth-scroll.polyfills.min.js b/docs/dist/js/smooth-scroll.polyfills.min.js deleted file mode 100755 index d7677aa..0000000 --- a/docs/dist/js/smooth-scroll.polyfills.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! smooth-scroll v12.1.5 | (c) 2017 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ -window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;--t>=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),(function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n=1&&t<=31||127==t||0===i&&t>=48&&t<=57||1===i&&t>=48&&t<=57&&45===r?a+="\\"+t.toString(16)+" ":a+=t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(i):"\\"+n.charAt(i)}return"#"+a},r=function(e,t){var n;return"easeInQuad"===e.easing&&(n=t*t),"easeOutQuad"===e.easing&&(n=t*(2-t)),"easeInOutQuad"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e.easing&&(n=t*t*t),"easeOutCubic"===e.easing&&(n=--t*t*t+1),"easeInOutCubic"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e.easing&&(n=t*t*t*t),"easeOutQuart"===e.easing&&(n=1- --t*t*t*t),"easeInOutQuart"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e.easing&&(n=t*t*t*t*t),"easeOutQuint"===e.easing&&(n=1+--t*t*t*t*t),"easeInOutQuint"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t},u=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},c=function(e,t,n){var o=0;if(e.offsetParent)do{o+=e.offsetTop,e=e.offsetParent}while(e);return o=Math.max(o-t-n,0)},l=function(e){return e?i(e)+e.offsetTop:0},s=function(t,n,o){o||(t.focus(),document.activeElement.id!==t.id&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),e.scrollTo(0,n))},d=function(t){return!!("matchMedia"in e&&e.matchMedia("(prefers-reduced-motion)").matches)};return function(i,f){var m,h,g,w,p,v,y,b={};b.cancelScroll=function(){cancelAnimationFrame(y)},b.animateScroll=function(t,i,a){var d=o(m||n,a||{}),f="[object Number]"===Object.prototype.toString.call(t),h=f||!t.tagName?null:t;if(f||h){var g=e.pageYOffset;d.header&&!w&&(w=document.querySelector(d.header)),p||(p=l(w));var v,y,A,E=f?t:c(h,p,parseInt("function"==typeof d.offset?d.offset():d.offset,10)),S=E-g,I=u(),q=0,F=function(n,o){var a=e.pageYOffset;if(n==o||a==o||(g=I)return b.cancelScroll(),s(t,o,f),d.after(t,i),v=null,!0},O=function(t){v||(v=t),q+=t-v,y=q/parseInt(d.speed,10),y=y>1?1:y,A=g+S*r(d,y),e.scrollTo(0,Math.floor(A)),F(A,E)||(e.requestAnimationFrame(O),v=t)};0===e.pageYOffset&&e.scrollTo(0,0),d.before(t,i),b.cancelScroll(),e.requestAnimationFrame(O)}};var A=function(e){h&&(h.id=h.getAttribute("data-scroll-id"),b.animateScroll(h,g),h=null,g=null)},E=function(t){if(!d()&&0===t.button&&!t.metaKey&&!t.ctrlKey&&(g=t.target.closest(i))&&"a"===g.tagName.toLowerCase()&&!t.target.closest(m.ignore)&&g.hostname===e.location.hostname&&g.pathname===e.location.pathname&&/#/.test(g.href)){var n;try{n=a(decodeURIComponent(g.hash))}catch(e){n=a(g.hash)}if("#"===n){t.preventDefault(),h=document.body;var o=h.id?h.id:"smooth-scroll-top";return h.setAttribute("data-scroll-id",o),h.id="",void(e.location.hash.substring(1)===o?A():e.location.hash=o)}h=document.querySelector(n),h&&(h.setAttribute("data-scroll-id",h.id),h.id="",g.hash===e.location.hash&&(t.preventDefault(),A()))}},S=function(e){v||(v=setTimeout((function(){v=null,p=l(w)}),66))};return b.destroy=function(){m&&(document.removeEventListener("click",E,!1),e.removeEventListener("resize",S,!1),b.cancelScroll(),m=null,h=null,g=null,w=null,p=null,v=null,y=null)},b.init=function(i){t&&(b.destroy(),m=o(n,i||{}),w=m.header?document.querySelector(m.header):null,p=l(w),document.addEventListener("click",E,!1),e.addEventListener("hashchange",A,!1),w&&e.addEventListener("resize",S,!1))},b.init(f),b}})); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100755 index 9e1cd08..0000000 --- a/docs/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - Smooth Scroll - - - - - - - - -
- - - -
-

- Linear
- Linear (no other options)
-

- -

- Ease-In
- Quad
- Cubic
- Quart
- Quint -

- -

- Ease-In-Out
- Quad
- Cubic
- Quart
- Quint -

- -

- Ease-Out
- Quad
- Cubic
- Quart
- Quint -

- -

- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
. -

- -

- Non-ASCII Characters
- 中文 -

- -

- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
. -

- -

中文

- -

Bazinga!

- -

- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
. -

- -

Back to the top

-
-
- - - - - - - - \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 2c41489..0b20e1e 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,95 +1,44 @@ /** * Settings + * Turn on/off build features */ var settings = { - scripts: true, // Turn on/off script tasks - polyfills: true, // Turn on/off polyfill tasks - styles: false, // Turn on/off style tasks - svgs: false, // Turn on/off SVG tasks - images: false, // Turn on/off image tasks - static: false, // Turn on/off static file copying - docs: true, // Turn on/off documentation generation - deploy: true, // Turn on/off all deployment tasks - cacheBust: false, // Turn on/off cache busting (adds a version number to minified files) + clean: true, + scripts: true, + polyfills: true, + styles: false, + svgs: false, + copy: true, + reload: true }; -/** - * Gulp Packages - */ - -// General -var gulp = require('gulp'); -var fs = require('fs'); -var del = require('del'); -var exec = require('child_process').exec; -var lazypipe = require('lazypipe'); -var plumber = require('gulp-plumber'); -var flatten = require('gulp-flatten'); -var tap = require('gulp-tap'); -var rename = require('gulp-rename'); -var header = require('gulp-header'); -var footer = require('gulp-footer'); -var watch = require('gulp-watch'); -var livereload = require('gulp-livereload'); -var package = require('./package.json'); - -// Scripts -var jshint = settings.scripts ? require('gulp-jshint') : null; -var stylish = settings.scripts ? require('jshint-stylish') : null; -var concat = settings.scripts ? require('gulp-concat') : null; -var uglify = settings.scripts ? require('gulp-uglify') : null; -var optimizejs = settings.scripts ? require('gulp-optimize-js') : null; - -// Styles -var sass = settings.styles ? require('gulp-sass') : null; -var prefix = settings.styles ? require('gulp-autoprefixer') : null; -var minify = settings.styles ? require('gulp-cssnano') : null; - -// SVGs -var svgmin = settings.svgs ? require('gulp-svgmin') : null; -var svgstore = settings.svgs ? require('gulp-svgstore') : null; - -// Docs -var markdown = settings.docs ? require('gulp-markdown') : null; -var fileinclude = settings.docs ? require('gulp-file-include') : null; - - /** * Paths to project folders */ var paths = { - input: 'src/**/*', + input: 'src/', output: 'dist/', scripts: { input: 'src/js/*', - polyfills: '!src/js/*.polyfill.js', - output: 'dist/js/' + polyfills: '.polyfill.js', + output: 'dist/' }, styles: { input: 'src/sass/**/*.{scss,sass}', output: 'dist/css/' }, svgs: { - input: 'src/svg/*', + input: 'src/svg/*.svg', output: 'dist/svg/' }, - images: { - input: 'src/img/*', - output: 'dist/img/' + copy: { + input: 'src/copy/*', + output: './' }, - static: { - input: 'src/static/*', - output: 'dist/' - }, - docs: { - input: 'src/docs/*.{html,md,markdown}', - output: 'docs/', - templates: 'src/docs/_templates/', - assets: 'src/docs/assets/**' - } + reload: './' }; @@ -98,14 +47,15 @@ var paths = { */ var banner = { - full : + full: '/*!\n' + - ' * <%= package.name %> v<%= package.version %>: <%= package.description %>\n' + + ' * <%= package.name %> v<%= package.version %>\n' + + ' * <%= package.description %>\n' + ' * (c) ' + new Date().getFullYear() + ' <%= package.author.name %>\n' + ' * <%= package.license %> License\n' + ' * <%= package.repository.url %>\n' + ' */\n\n', - min : + min: '/*!' + ' <%= package.name %> v<%= package.version %>' + ' | (c) ' + new Date().getFullYear() + ' <%= package.author.name %>' + @@ -116,233 +66,250 @@ var banner = { /** - * File Version + * Gulp Packages */ -var fileVersion = settings.cacheBust ? '.' + package.version : ''; +// General +var {gulp, src, dest, watch, series, parallel} = require('gulp'); +var del = require('del'); +var flatmap = require('gulp-flatmap'); +var lazypipe = require('lazypipe'); +var rename = require('gulp-rename'); +var header = require('gulp-header'); +var package = require('./package.json'); + +// Scripts +var jshint = require('gulp-jshint'); +var stylish = require('jshint-stylish'); +var concat = require('gulp-concat'); +var uglify = require('gulp-uglify'); +var optimizejs = require('gulp-optimize-js'); + +// Styles +var sass = require('gulp-sass'); +var prefix = require('gulp-autoprefixer'); +var minify = require('gulp-cssnano'); + +// SVGs +var svgmin = require('gulp-svgmin'); + +// BrowserSync +var browserSync = require('browser-sync'); /** * Gulp Tasks */ +// Remove pre-existing content from output folders +var cleanDist = function (done) { + + // Make sure this feature is activated before running + if (!settings.clean) return done(); + + // Clean the dist folder + del.sync([ + paths.output + ]); + + // Signal completion + return done(); + +}; + +// Repeated JavaScript tasks var jsTasks = lazypipe() - .pipe(header, banner.full, { package : package }) + .pipe(header, banner.full, {package: package}) .pipe(optimizejs) - .pipe(gulp.dest, paths.scripts.output) - .pipe(rename, { suffix: '.min' + fileVersion }) + .pipe(dest, paths.scripts.output) + .pipe(rename, {suffix: '.min'}) .pipe(uglify) .pipe(optimizejs) - .pipe(header, banner.min, { package : package }) - .pipe(gulp.dest, paths.scripts.output); + .pipe(header, banner.min, {package: package}) + .pipe(dest, paths.scripts.output); // Lint, minify, and concatenate scripts -gulp.task('build:scripts', ['clean:dist'], function() { - if ( !settings.scripts ) return; - - return gulp.src([paths.scripts.input, paths.scripts.polyfills]) - .pipe(plumber()) - .pipe(tap(function (file, t) { - if ( file.isDirectory() ) { - var name = file.relative + '.js'; - return gulp.src(file.path + '/*.js') - .pipe(concat(name)) +var buildScripts = function (done) { + + // Make sure this feature is activated before running + if (!settings.scripts) return done(); + + // Run tasks on script files + src(paths.scripts.input) + .pipe(flatmap(function(stream, file) { + + // If the file is a directory + if (file.isDirectory()) { + + // Setup a suffix variable + var suffix = ''; + + // If separate polyfill files enabled + if (settings.polyfills) { + + // Update the suffix + suffix = '.polyfills'; + + // Grab files that aren't polyfills, concatenate them, and process them + src([file.path + '/*.js', '!' + file.path + '/*' + paths.scripts.polyfills]) + .pipe(concat(file.relative + '.js')) + .pipe(jsTasks()); + + } + + // Grab all files and concatenate them + // If separate polyfills enabled, this will have .polyfills in the filename + src(file.path + '/*.js') + .pipe(concat(file.relative + suffix + '.js')) .pipe(jsTasks()); + + return stream; + } - })) - .pipe(jsTasks()); -}); - -// Create scripts with polyfills -gulp.task('build:polyfills', ['clean:dist'], function() { - if ( !settings.polyfills ) return; - - return gulp.src(paths.scripts.input) - .pipe(plumber()) - .pipe(concat(package.name + '.js')) - .pipe(rename({ - suffix: ".polyfills" - })) - .pipe(jsTasks()); -}); + + // Otherwise, process the file + return stream.pipe(jsTasks()); + + })); + + // Signal completion + done(); + +}; + +// Lint scripts +var lintScripts = function (done) { + + // Make sure this feature is activated before running + if (!settings.scripts) return done(); + + // Lint scripts + src(paths.scripts.input) + .pipe(jshint()) + .pipe(jshint.reporter('jshint-stylish')); + + // Signal completion + done(); + +}; // Process, lint, and minify Sass files -gulp.task('build:styles', ['clean:dist'], function() { - if ( !settings.styles ) return; +var buildStyles = function (done) { - return gulp.src(paths.styles.input) - .pipe(plumber()) + // Make sure this feature is activated before running + if (!settings.styles) return done(); + + // Run tasks on all Sass files + src(paths.styles.input) .pipe(sass({ outputStyle: 'expanded', sourceComments: true })) - .pipe(flatten()) .pipe(prefix({ - browsers: ['last 2 version', '> 1%'], + browsers: ['last 2 version', '> 0.25%'], cascade: true, remove: true })) .pipe(header(banner.full, { package : package })) - .pipe(gulp.dest(paths.styles.output)) - .pipe(rename({ suffix: '.min' + fileVersion })) + .pipe(dest(paths.styles.output)) + .pipe(rename({suffix: '.min'})) .pipe(minify({ discardComments: { removeAll: true } })) .pipe(header(banner.min, { package : package })) - .pipe(gulp.dest(paths.styles.output)); -}); - -// Generate SVG sprites -gulp.task('build:svgs', ['clean:dist'], function () { - if ( !settings.svgs ) return; - - return gulp.src(paths.svgs.input) - .pipe(plumber()) - .pipe(tap(function (file, t) { - if ( file.isDirectory() ) { - var name = file.relative + '.svg'; - return gulp.src(file.path + '/*.svg') - .pipe(svgmin()) - .pipe(svgstore({ - fileName: name, - prefix: 'icon-', - inlineSvg: true - })) - .pipe(gulp.dest(paths.svgs.output)); - } - })) + .pipe(dest(paths.styles.output)); + + // Signal completion + done(); + +}; + +// Optimize SVG files +var buildSVGs = function (done) { + + // Make sure this feature is activated before running + if (!settings.svgs) return done(); + + // Optimize SVG files + src(paths.svgs.input) .pipe(svgmin()) - .pipe(gulp.dest(paths.svgs.output)); -}); + .pipe(dest(paths.svgs.output)); -// Copy image files into output folder -gulp.task('build:images', ['clean:dist'], function() { - if ( !settings.images ) return; + // Signal completion + done(); - return gulp.src(paths.images.input) - .pipe(plumber()) - .pipe(gulp.dest(paths.images.output)); -}); +}; // Copy static files into output folder -gulp.task('build:static', ['clean:dist'], function() { - if ( !settings.static ) return; +var copyFiles = function (done) { - return gulp.src(paths.static.input) - .pipe(plumber()) - .pipe(gulp.dest(paths.static.output)); -}); + // Make sure this feature is activated before running + if (!settings.copy) return done(); -// Lint scripts -gulp.task('lint:scripts', function () { - if ( !settings.scripts ) return; + // Copy static files + src(paths.copy.input) + .pipe(dest(paths.copy.output)); - return gulp.src(paths.scripts.input) - .pipe(plumber()) - .pipe(jshint()) - .pipe(jshint.reporter('jshint-stylish')); -}); + // Signal completion + done(); -// Remove pre-existing content from output folders -gulp.task('clean:dist', function () { - del.sync([ - paths.output - ]); -}); +}; -// Generate documentation -gulp.task('build:docs', ['compile', 'clean:docs'], function() { - if ( !settings.docs ) return; +// Watch for changes to the src directory +var startServer = function (done) { - return gulp.src(paths.docs.input) - .pipe(plumber()) - .pipe(fileinclude({ - prefix: '@@', - basepath: '@file' - })) - .pipe(tap(function (file, t) { - if ( /\.md|\.markdown/.test(file.path) ) { - return t.through(markdown); - } - })) - .pipe(header(fs.readFileSync(paths.docs.templates + '/_header.html', 'utf8'))) - .pipe(footer(fs.readFileSync(paths.docs.templates + '/_footer.html', 'utf8'))) - .pipe(gulp.dest(paths.docs.output)); -}); - -// Copy distribution files to docs -gulp.task('copy:dist', ['compile', 'clean:docs'], function() { - if ( !settings.docs ) return; - - return gulp.src(paths.output + '/**') - .pipe(plumber()) - .pipe(gulp.dest(paths.docs.output + '/dist')); -}); - -// Copy documentation assets to docs -gulp.task('copy:assets', ['clean:docs'], function() { - if ( !settings.docs ) return; - - return gulp.src(paths.docs.assets) - .pipe(plumber()) - .pipe(gulp.dest(paths.docs.output + '/assets')); -}); - -// Remove prexisting content from docs folder -gulp.task('clean:docs', function () { - if ( !settings.docs ) return; - return del.sync(paths.docs.output); -}); - -// Spin up livereload server and listen for file changes -gulp.task('listen', function () { - livereload.listen(); - gulp.watch(paths.input).on('change', function(file) { - gulp.start('default'); - gulp.start('refresh'); + // Make sure this feature is activated before running + if (!settings.reload) return done(); + + // Initialize BrowserSync + browserSync.init({ + server: { + baseDir: paths.reload + } }); -}); -// Run livereload after file change -gulp.task('refresh', ['compile', 'docs'], function () { - livereload.changed(); -}); + // Signal completion + done(); + +}; + +// Reload the browser when files change +var reloadBrowser = function (done) { + if (!settings.reload) return done(); + browserSync.reload(); + done(); +}; + +// Watch for changes +var watchSource = function (done) { + watch(paths.input, series(exports.default, reloadBrowser)); + done(); +}; /** - * Task Runners + * Export Tasks */ -// Compile files -gulp.task('compile', [ - 'lint:scripts', - 'clean:dist', - 'build:scripts', - 'build:polyfills', - 'build:styles', - 'build:images', - 'build:static', - 'build:svgs' -]); - -// Generate documentation -gulp.task('docs', [ - 'clean:docs', - 'build:docs', - 'copy:dist', - 'copy:assets' -]); - -// Compile files and generate docs (default) -gulp.task('default', [ - 'compile', - 'docs' -]); - -// Compile files and generate docs when something changes -gulp.task('watch', [ - 'listen', - 'default' -]); \ No newline at end of file +// Default task +// gulp +exports.default = series( + cleanDist, + parallel( + buildScripts, + lintScripts, + buildStyles, + buildSVGs, + copyFiles + ) +); + +// Watch and reload +// gulp watch +exports.watch = series( + exports.default, + startServer, + watchSource +); \ No newline at end of file diff --git a/index.html b/index.html new file mode 100755 index 0000000..a10fdc9 --- /dev/null +++ b/index.html @@ -0,0 +1,149 @@ + + + + + + Smooth Scroll + + + + + + + + +
+ + + +
+

+ Linear
+ Linear (no other options)
+

+ +

+ Ease-In
+ Quad
+ Cubic
+ Quart
+ Quint +

+ +

+ Ease-In-Out
+ Quad
+ Cubic
+ Quart
+ Quint +

+ +

+ Ease-Out
+ Quad
+ Cubic
+ Quart
+ Quint +

+ +

+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
. +

+ +

+ Non-ASCII Characters
+ 中文 +

+ +

+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
. +

+ +

+ 中文 + More Special Characters +

+ +

+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
. +

+ +

myymälä

+ +

+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
. +

+ +

Bazinga!

+ +

+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
. +

+ +

Back to the top

+
+
+ + + + + + + + \ No newline at end of file diff --git a/jump-to-top.html b/jump-to-top.html new file mode 100644 index 0000000..393e4ad --- /dev/null +++ b/jump-to-top.html @@ -0,0 +1,60 @@ + + + + + + Smooth Scroll + + + + + + + + +
+ + + +
+ +

+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
. +

+ +

Back to the top

+
+
+ + + + + + + + \ No newline at end of file diff --git a/npm-debug.log.558243421 b/npm-debug.log.558243421 deleted file mode 100644 index e69de29..0000000 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..db08368 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3968 @@ +{ + "name": "smooth-scroll", + "version": "16.1.4", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, + "@sindresorhus/is": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", + "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", + "dev": true + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "13.13.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.4.tgz", + "integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==", + "dev": true + }, + "@types/q": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", + "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "arch": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.1.1.tgz", + "integrity": "sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==", + "dev": true + }, + "archive-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/archive-type/-/archive-type-4.0.0.tgz", + "integrity": "sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA=", + "dev": true, + "requires": { + "file-type": "^4.2.0" + }, + "dependencies": { + "file-type": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-4.4.0.tgz", + "integrity": "sha1-G2AOX8ofvcboDApwxxyNul95BsU=", + "dev": true + } + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "dev": true + }, + "bin-build": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bin-build/-/bin-build-3.0.0.tgz", + "integrity": "sha512-jcUOof71/TNAI2uM5uoUaDq2ePcVBQ3R/qhxAz1rX7UfvduAL/RXD3jXzvn8cVcDJdGVkiR1shal3OH0ImpuhA==", + "dev": true, + "requires": { + "decompress": "^4.0.0", + "download": "^6.2.2", + "execa": "^0.7.0", + "p-map-series": "^1.0.0", + "tempfile": "^2.0.0" + } + }, + "bin-check": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bin-check/-/bin-check-4.1.0.tgz", + "integrity": "sha512-b6weQyEUKsDGFlACWSIOfveEnImkJyK/FGW6FAG42loyoquvjdtOIqO6yBFzHyqyVVhNgNkQxxx09SFLK28YnA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "executable": "^4.1.0" + } + }, + "bin-version": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bin-version/-/bin-version-3.1.0.tgz", + "integrity": "sha512-Mkfm4iE1VFt4xd4vH+gx+0/71esbfus2LsnCGe8Pi4mndSPyT+NGES/Eg99jx8/lUGWfu3z2yuB/bt5UB+iVbQ==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "find-versions": "^3.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "bin-version-check": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/bin-version-check/-/bin-version-check-4.0.0.tgz", + "integrity": "sha512-sR631OrhC+1f8Cvs8WyVWOA33Y8tgwjETNPyyD/myRBXLkfS/vl74FmH/lFcRl9KY3zwGh7jFhvyk9vV3/3ilQ==", + "dev": true, + "requires": { + "bin-version": "^3.0.0", + "semver": "^5.6.0", + "semver-truncate": "^1.1.2" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "bin-wrapper": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bin-wrapper/-/bin-wrapper-4.1.0.tgz", + "integrity": "sha512-hfRmo7hWIXPkbpi0ZltboCMVrU+0ClXR/JgbCKKjlDjQf6igXa7OwdqNcFWQZPZTgiY7ZpzE3+LjjkLiTN2T7Q==", + "dev": true, + "requires": { + "bin-check": "^4.1.0", + "bin-version-check": "^4.0.0", + "download": "^7.1.0", + "import-lazy": "^3.1.0", + "os-filter-obj": "^2.0.0", + "pify": "^4.0.1" + }, + "dependencies": { + "download": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/download/-/download-7.1.0.tgz", + "integrity": "sha512-xqnBTVd/E+GxJVrX5/eUJiLYjCGPwMpdL+jGhGU57BvtcA7wwhtHVbXBeUk51kOpW3S7Jn3BQbN9Q1R1Km2qDQ==", + "dev": true, + "requires": { + "archive-type": "^4.0.0", + "caw": "^2.0.1", + "content-disposition": "^0.5.2", + "decompress": "^4.2.0", + "ext-name": "^5.0.0", + "file-type": "^8.1.0", + "filenamify": "^2.0.0", + "get-stream": "^3.0.0", + "got": "^8.3.1", + "make-dir": "^1.2.0", + "p-event": "^2.1.0", + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "file-type": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-8.1.0.tgz", + "integrity": "sha512-qyQ0pzAy78gVoJsmYeNgl8uH8yKhr1lVhW7JbzJmnlRi0I4R2eEDEJZVKG8agpDnLpacwNbDhLNG/LMdxHD2YQ==", + "dev": true + }, + "got": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "p-cancelable": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", + "dev": true + }, + "p-event": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-2.3.1.tgz", + "integrity": "sha512-NQCqOFhbpVTMX4qMe8PF8lbGtzZ+LCiN7pcNrb/413Na7+TRoe1xkKUzuWa/YEJdGQ0FvKtj35EEbDoVPO2kbA==", + "dev": true, + "requires": { + "p-timeout": "^2.0.1" + } + }, + "p-timeout": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + } + } + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, + "bl": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "dev": true, + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "requires": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, + "buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "cacheable-request": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", + "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", + "dev": true, + "requires": { + "clone-response": "1.0.2", + "get-stream": "3.0.0", + "http-cache-semantics": "3.8.1", + "keyv": "3.0.0", + "lowercase-keys": "1.0.0", + "normalize-url": "2.0.1", + "responselike": "1.0.2" + }, + "dependencies": { + "lowercase-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=", + "dev": true + } + } + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "caw": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/caw/-/caw-2.0.1.tgz", + "integrity": "sha512-Cg8/ZSBEa8ZVY9HspcGUYaK63d/bN7rqS3CYCzEGUxuYv6UlmcjzDUz2fCFFHyTvUW5Pk0I+3hkA3iXlIj6guA==", + "dev": true, + "requires": { + "get-proxy": "^2.0.0", + "isurl": "^1.0.0-alpha5", + "tunnel-agent": "^0.6.0", + "url-to-options": "^1.0.1" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "chokidar": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", + "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.4.0" + } + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-spinners": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.3.0.tgz", + "integrity": "sha512-Xs2Hf2nzrvJMFKimOR7YR0QwZ8fc0u98kdtwN1eNAZzNQgH3vK2pXzff6GJtKh7S5hoJ87ECiAiZFS2fb5Ii2w==", + "dev": true + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "coa": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", + "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", + "dev": true, + "requires": { + "@types/q": "^1.5.1", + "chalk": "^2.4.1", + "q": "^1.1.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", + "dev": true, + "requires": { + "graceful-readlink": ">= 1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "config-chain": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", + "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", + "dev": true, + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "console-stream": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/console-stream/-/console-stream-0.1.1.tgz", + "integrity": "sha1-oJX+B7IEZZVfL6/Si11yvM2UnUQ=", + "dev": true + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "css-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", + "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^3.2.1", + "domutils": "^1.7.0", + "nth-check": "^1.0.2" + } + }, + "css-select-base-adapter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", + "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", + "dev": true + }, + "css-tree": { + "version": "1.0.0-alpha.37", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", + "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", + "dev": true, + "requires": { + "mdn-data": "2.0.4", + "source-map": "^0.6.1" + } + }, + "css-what": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.2.1.tgz", + "integrity": "sha512-WwOrosiQTvyms+Ti5ZC5vGEK0Vod3FTt1ca+payZqvKuGJF+dq7bG63DstxtN0dpm6FxY27a/zS3Wten+gEtGw==", + "dev": true + }, + "csso": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.0.3.tgz", + "integrity": "sha512-NL3spysxUkcrOgnpsT4Xdl2aiEiBG6bXswAABQVHcMrfjjBisFOKwLDOmf4wf32aPdcJws1zds2B0Rg+jqMyHQ==", + "dev": true, + "requires": { + "css-tree": "1.0.0-alpha.39" + }, + "dependencies": { + "css-tree": { + "version": "1.0.0-alpha.39", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.39.tgz", + "integrity": "sha512-7UvkEYgBAHRG9Nt980lYxjsTrCyHFN53ky3wVsDkiMdVqylqRt+Zc+jm5qw7/qyOvN2dHSYtX0e4MbCCExSvnA==", + "dev": true, + "requires": { + "mdn-data": "2.0.6", + "source-map": "^0.6.1" + } + }, + "mdn-data": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.6.tgz", + "integrity": "sha512-rQvjv71olwNHgiTbfPZFkJtjNMciWgswYeciZhtvWLO8bmX3TnhyA62I6sTWOyZssWHJJjY6/KiWwqQsWWsqOA==", + "dev": true + } + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "decompress": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.1.tgz", + "integrity": "sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ==", + "dev": true, + "requires": { + "decompress-tar": "^4.0.0", + "decompress-tarbz2": "^4.0.0", + "decompress-targz": "^4.0.0", + "decompress-unzip": "^4.0.1", + "graceful-fs": "^4.1.10", + "make-dir": "^1.0.0", + "pify": "^2.3.0", + "strip-dirs": "^2.0.0" + }, + "dependencies": { + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "decompress-tar": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", + "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", + "dev": true, + "requires": { + "file-type": "^5.2.0", + "is-stream": "^1.1.0", + "tar-stream": "^1.5.2" + }, + "dependencies": { + "file-type": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", + "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", + "dev": true + } + } + }, + "decompress-tarbz2": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", + "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", + "dev": true, + "requires": { + "decompress-tar": "^4.1.0", + "file-type": "^6.1.0", + "is-stream": "^1.1.0", + "seek-bzip": "^1.0.5", + "unbzip2-stream": "^1.0.9" + }, + "dependencies": { + "file-type": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", + "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==", + "dev": true + } + } + }, + "decompress-targz": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", + "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", + "dev": true, + "requires": { + "decompress-tar": "^4.1.1", + "file-type": "^5.2.0", + "is-stream": "^1.1.0" + }, + "dependencies": { + "file-type": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", + "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", + "dev": true + } + } + }, + "decompress-unzip": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", + "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", + "dev": true, + "requires": { + "file-type": "^3.8.0", + "get-stream": "^2.2.0", + "pify": "^2.3.0", + "yauzl": "^2.4.2" + }, + "dependencies": { + "file-type": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", + "dev": true + }, + "get-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "download": { + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/download/-/download-6.2.5.tgz", + "integrity": "sha512-DpO9K1sXAST8Cpzb7kmEhogJxymyVUd5qz/vCOSyvwtp2Klj2XcDt5YUuasgxka44SxF0q5RriKIwJmQHG2AuA==", + "dev": true, + "requires": { + "caw": "^2.0.0", + "content-disposition": "^0.5.2", + "decompress": "^4.0.0", + "ext-name": "^5.0.0", + "file-type": "5.2.0", + "filenamify": "^2.0.0", + "get-stream": "^3.0.0", + "got": "^7.0.0", + "make-dir": "^1.0.0", + "p-event": "^1.0.0", + "pify": "^3.0.0" + }, + "dependencies": { + "file-type": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", + "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", + "dev": true + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + } + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true + }, + "exec-buffer": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/exec-buffer/-/exec-buffer-3.2.0.tgz", + "integrity": "sha512-wsiD+2Tp6BWHoVv3B+5Dcx6E7u5zky+hUwOHjuH2hKSLR3dvRmX8fk8UD8uqQixHs4Wk6eDmiegVrMPjKj7wpA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "p-finally": "^1.0.0", + "pify": "^3.0.0", + "rimraf": "^2.5.4", + "tempfile": "^2.0.0" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "executable": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", + "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", + "dev": true, + "requires": { + "pify": "^2.2.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "ext-list": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz", + "integrity": "sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==", + "dev": true, + "requires": { + "mime-db": "^1.28.0" + } + }, + "ext-name": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ext-name/-/ext-name-5.0.0.tgz", + "integrity": "sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ==", + "dev": true, + "requires": { + "ext-list": "^2.0.0", + "sort-keys-length": "^1.0.0" + } + }, + "fast-glob": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fastq": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", + "integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "file-type": { + "version": "12.4.2", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-12.4.2.tgz", + "integrity": "sha512-UssQP5ZgIOKelfsaB5CuGAL+Y+q7EmONuiwF3N5HAH0t27rvrttgi6Ra9k/+DVaY9UF6+ybxu5pOXLUdA8N7Vg==", + "dev": true + }, + "filename-reserved-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", + "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=", + "dev": true + }, + "filenamify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-2.1.0.tgz", + "integrity": "sha512-ICw7NTT6RsDp2rnYKVd8Fu4cr6ITzGy3+u4vUujPkabyaz+03F24NWEX7fs5fp+kBonlaqPH8fAO2NM+SXt/JA==", + "dev": true, + "requires": { + "filename-reserved-regex": "^2.0.0", + "strip-outer": "^1.0.0", + "trim-repeated": "^1.0.0" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-proxy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/get-proxy/-/get-proxy-2.1.0.tgz", + "integrity": "sha512-zmZIaQTWnNQb4R4fJUEp/FC51eZsc6EkErspy3xtIYStaq8EB/hDIWipxsal+E8rz0qD7f2sL/NA9Xee4RInJw==", + "dev": true, + "requires": { + "npm-conf": "^1.1.0" + } + }, + "get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "gifsicle": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/gifsicle/-/gifsicle-4.0.1.tgz", + "integrity": "sha512-A/kiCLfDdV+ERV/UB+2O41mifd+RxH8jlRG8DMxZO84Bma/Fw0htqZ+hY2iaalLRNyUu7tYZQslqUBJxBggxbg==", + "dev": true, + "optional": true, + "requires": { + "bin-build": "^3.0.0", + "bin-wrapper": "^4.0.0", + "execa": "^1.0.0", + "logalot": "^2.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "optional": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "optional": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "optional": true, + "requires": { + "pump": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globby": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + } + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "dev": true, + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "html-comment-regex": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", + "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==", + "dev": true, + "optional": true + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", + "dev": true + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "dev": true + }, + "imagemin": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/imagemin/-/imagemin-7.0.1.tgz", + "integrity": "sha512-33AmZ+xjZhg2JMCe+vDf6a9mzWukE7l+wAtesjE7KyteqqKjzxv7aVQeWnul1Ve26mWvEQqyPwl0OctNBfSR9w==", + "dev": true, + "requires": { + "file-type": "^12.0.0", + "globby": "^10.0.0", + "graceful-fs": "^4.2.2", + "junk": "^3.1.0", + "make-dir": "^3.0.0", + "p-pipe": "^3.0.0", + "replace-ext": "^1.0.0" + } + }, + "imagemin-cli": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/imagemin-cli/-/imagemin-cli-5.1.0.tgz", + "integrity": "sha512-wE7vVK4IaMieshW/3zl2s5b6Yw8zqF9H+II3Bjf95ntY2M17k21ht5JAM2oNuXRxD3t6WWWERqIRcA1Gma/anQ==", + "dev": true, + "requires": { + "arrify": "^2.0.1", + "get-stdin": "^7.0.0", + "imagemin": "^7.0.0", + "imagemin-gifsicle": "^6.0.0", + "imagemin-jpegtran": "^6.0.0", + "imagemin-optipng": "^6.0.0", + "imagemin-svgo": "^7.0.0", + "lodash.pairs": "^3.0.1", + "meow": "^5.0.0", + "ora": "^4.0.3", + "plur": "^3.0.1", + "strip-indent": "^3.0.0" + } + }, + "imagemin-gifsicle": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/imagemin-gifsicle/-/imagemin-gifsicle-6.0.1.tgz", + "integrity": "sha512-kuu47c6iKDQ6R9J10xCwL0lgs0+sMz3LRHqRcJ2CRBWdcNmo3T5hUaM8hSZfksptZXJLGKk8heSAvwtSdB1Fng==", + "dev": true, + "optional": true, + "requires": { + "exec-buffer": "^3.0.0", + "gifsicle": "^4.0.0", + "is-gif": "^3.0.0" + } + }, + "imagemin-jpegtran": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/imagemin-jpegtran/-/imagemin-jpegtran-6.0.0.tgz", + "integrity": "sha512-Ih+NgThzqYfEWv9t58EItncaaXIHR0u9RuhKa8CtVBlMBvY0dCIxgQJQCfwImA4AV1PMfmUKlkyIHJjb7V4z1g==", + "dev": true, + "optional": true, + "requires": { + "exec-buffer": "^3.0.0", + "is-jpg": "^2.0.0", + "jpegtran-bin": "^4.0.0" + } + }, + "imagemin-mozjpeg": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/imagemin-mozjpeg/-/imagemin-mozjpeg-8.0.0.tgz", + "integrity": "sha512-+EciPiIjCb8JWjQNr1q8sYWYf7GDCNDxPYnkD11TNIjjWNzaV+oTg4DpOPQjl5ZX/KRCPMEgS79zLYAQzLitIA==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "is-jpg": "^2.0.0", + "mozjpeg": "^6.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "imagemin-optipng": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/imagemin-optipng/-/imagemin-optipng-6.0.0.tgz", + "integrity": "sha512-FoD2sMXvmoNm/zKPOWdhKpWdFdF9qiJmKC17MxZJPH42VMAp17/QENI/lIuP7LCUnLVAloO3AUoTSNzfhpyd8A==", + "dev": true, + "optional": true, + "requires": { + "exec-buffer": "^3.0.0", + "is-png": "^1.0.0", + "optipng-bin": "^5.0.0" + } + }, + "imagemin-pngcrush": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/imagemin-pngcrush/-/imagemin-pngcrush-6.0.0.tgz", + "integrity": "sha512-9Je0uUnzgZGLDDjsJxUlwozHS2aO/NmGRPUKcBzbpiliHI2W40HcRXYUaNNOMePGAWDCYJkJQ0rS5UG1JCguMA==", + "dev": true, + "requires": { + "exec-buffer": "^3.0.0", + "is-png": "^1.0.0", + "pngcrush-bin": "^4.0.0" + } + }, + "imagemin-pngquant": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/imagemin-pngquant/-/imagemin-pngquant-8.0.0.tgz", + "integrity": "sha512-PVq0diOxO+Zyq/zlMCz2Pfu6mVLHgiT1GpW702OwVlnej+NhS6ZQegYi3OFEDW8d7GxouyR5e8R+t53SMciOeg==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "is-png": "^2.0.0", + "is-stream": "^2.0.0", + "ow": "^0.13.2", + "pngquant-bin": "^5.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + } + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "is-png": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-png/-/is-png-2.0.0.tgz", + "integrity": "sha512-4KPGizaVGj2LK7xwJIz8o5B2ubu1D/vcQsgOGFEDlpcvgZHto4gBnyd0ig7Ws+67ixmwKoNmu0hYnpo6AaKb5g==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "imagemin-svgo": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/imagemin-svgo/-/imagemin-svgo-7.1.0.tgz", + "integrity": "sha512-0JlIZNWP0Luasn1HT82uB9nU9aa+vUj6kpT+MjPW11LbprXC+iC4HDwn1r4Q2/91qj4iy9tRZNsFySMlEpLdpg==", + "dev": true, + "optional": true, + "requires": { + "is-svg": "^4.2.1", + "svgo": "^1.3.2" + } + }, + "imagemin-zopfli": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/imagemin-zopfli/-/imagemin-zopfli-6.0.0.tgz", + "integrity": "sha512-vmhMzV7m5o6QxgHpIDaBbKx/exWdIylwxV0hrxKECnPmt072A2qPtM8HCHu9EbrQctFk3KR8kN+cWFnk6EwzKQ==", + "dev": true, + "requires": { + "exec-buffer": "^3.0.0", + "is-png": "^1.0.0", + "zopflipng-bin": "^5.0.0" + } + }, + "import-lazy": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-3.1.0.tgz", + "integrity": "sha512-8/gvXvX2JMn0F+CDlSC4l6kOmVaLOO3XLkksI7CI3Ud95KDYJuYur2b9P/PUt/i/pDAMd/DulQsNbbbmRRsDIQ==", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "into-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", + "dev": true, + "requires": { + "from2": "^2.1.1", + "p-is-promise": "^1.1.0" + } + }, + "irregular-plurals": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-2.0.0.tgz", + "integrity": "sha512-Y75zBYLkh0lJ9qxeHlMjQ7bSbyiSqNW/UOPWDmzC7cXskL1hekSITh1Oc6JV0XCWWZ9DE8VYSB71xocLk3gmGw==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true + }, + "is-gif": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-gif/-/is-gif-3.0.0.tgz", + "integrity": "sha512-IqJ/jlbw5WJSNfwQ/lHEDXF8rxhRgF6ythk2oiEvhpG29F704eX9NO6TvPfMiq9DrbwgcEDnETYNcZDPewQoVw==", + "dev": true, + "optional": true, + "requires": { + "file-type": "^10.4.0" + }, + "dependencies": { + "file-type": { + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-10.11.0.tgz", + "integrity": "sha512-uzk64HRpUZyTGZtVuvrjP0FYxzQrBf4rojot6J65YMEbwBLB0CWm0CLojVpwpmFmxcE/lkvYICgfcGozbBq6rw==", + "dev": true, + "optional": true + } + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true + }, + "is-jpg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-jpg/-/is-jpg-2.0.0.tgz", + "integrity": "sha1-LhmX+m6RZuqsAkLarkQ0A+TvHZc=", + "dev": true + }, + "is-natural-number": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", + "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-png": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-png/-/is-png-1.1.0.tgz", + "integrity": "sha1-1XSxK/J1wDUEVVcLDltXqwYgd84=", + "dev": true + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-retry-allowed": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-svg": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-4.2.1.tgz", + "integrity": "sha512-PHx3ANecKsKNl5y5+Jvt53Y4J7MfMpbNZkv384QNiswMKAWIbvcqbPz+sYbFKJI8Xv3be01GSFniPmoaP+Ai5A==", + "dev": true, + "optional": true, + "requires": { + "html-comment-regex": "^1.1.2" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "jest-worker": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", + "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", + "dev": true, + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jpegtran-bin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-4.0.0.tgz", + "integrity": "sha512-2cRl1ism+wJUoYAYFt6O/rLBfpXNWG2dUWbgcEkTt5WGMnqI46eEro8T4C5zGROxKRqyKpCBSdHPvt5UYCtxaQ==", + "dev": true, + "optional": true, + "requires": { + "bin-build": "^3.0.0", + "bin-wrapper": "^4.0.0", + "logalot": "^2.0.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "junk": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz", + "integrity": "sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==", + "dev": true + }, + "keyv": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", + "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" + } + }, + "lodash.pairs": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash.pairs/-/lodash.pairs-3.0.1.tgz", + "integrity": "sha1-u+CNV4bu6qCaFckevw3LfSvjJqk=", + "dev": true, + "requires": { + "lodash.keys": "^3.0.0" + } + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "logalot": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/logalot/-/logalot-2.1.0.tgz", + "integrity": "sha1-X46MkNME7fElMJUaVVSruMXj9VI=", + "dev": true, + "requires": { + "figures": "^1.3.5", + "squeak": "^1.0.0" + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lpad-align": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/lpad-align/-/lpad-align-1.1.2.tgz", + "integrity": "sha1-IfYArBwwlcPG5JfuZyce4ISB/p4=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1", + "indent-string": "^2.1.0", + "longest": "^1.0.0", + "meow": "^3.3.0" + }, + "dependencies": { + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + } + } + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "mdn-data": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", + "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", + "dev": true + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + } + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "min-indent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz", + "integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + }, + "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + } + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mozjpeg": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/mozjpeg/-/mozjpeg-6.0.1.tgz", + "integrity": "sha512-9Z59pJMi8ni+IUvSH5xQwK5tNLw7p3dwDNCZ3o1xE+of3G5Hc/yOz6Ue/YuLiBXU3ZB5oaHPURyPdqfBX/QYJA==", + "dev": true, + "requires": { + "bin-build": "^3.0.0", + "bin-wrapper": "^4.0.0", + "logalot": "^2.1.0" + } + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", + "dev": true, + "requires": { + "prepend-http": "^2.0.0", + "query-string": "^5.0.1", + "sort-keys": "^2.0.0" + }, + "dependencies": { + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + } + } + }, + "npm-conf": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/npm-conf/-/npm-conf-1.1.3.tgz", + "integrity": "sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==", + "dev": true, + "requires": { + "config-chain": "^1.1.11", + "pify": "^3.0.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "dev": true, + "requires": { + "boolbase": "~1.0.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optipng-bin": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/optipng-bin/-/optipng-bin-5.1.0.tgz", + "integrity": "sha512-9baoqZTNNmXQjq/PQTWEXbVV3AMO2sI/GaaqZJZ8SExfAzjijeAP7FEeT+TtyumSw7gr0PZtSUYB/Ke7iHQVKA==", + "dev": true, + "optional": true, + "requires": { + "bin-build": "^3.0.0", + "bin-wrapper": "^4.0.0", + "logalot": "^2.0.0" + } + }, + "ora": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.4.tgz", + "integrity": "sha512-77iGeVU1cIdRhgFzCK8aw1fbtT1B/iZAvWjS+l/o1x0RShMgxHUZaD2yDpWsNCPwXg9z1ZA78Kbdvr8kBmG/Ww==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.2.0", + "is-interactive": "^1.0.0", + "log-symbols": "^3.0.0", + "mute-stream": "0.0.8", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "os-filter-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/os-filter-obj/-/os-filter-obj-2.0.0.tgz", + "integrity": "sha512-uksVLsqG3pVdzzPvmAHpBK0wKxYItuzZr7SziusRPoz67tGV8rL1szZ6IdeUrbqLjGDwApBtN29eEE3IqGHOjg==", + "dev": true, + "requires": { + "arch": "^2.1.0" + } + }, + "ow": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/ow/-/ow-0.13.2.tgz", + "integrity": "sha512-9wvr+q+ZTDRvXDjL6eDOdFe5WUl/wa5sntf9kAolxqSpkBqaIObwLgFCGXSJASFw+YciXnOVtDWpxXa9cqV94A==", + "dev": true, + "requires": { + "type-fest": "^0.5.1" + } + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "dev": true + }, + "p-event": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-1.3.0.tgz", + "integrity": "sha1-jmtPT2XHK8W2/ii3XtqHT5akoIU=", + "dev": true, + "requires": { + "p-timeout": "^1.1.1" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-map-series": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-map-series/-/p-map-series-1.0.0.tgz", + "integrity": "sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco=", + "dev": true, + "requires": { + "p-reduce": "^1.0.0" + } + }, + "p-pipe": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-pipe/-/p-pipe-3.0.0.tgz", + "integrity": "sha512-gwwdRFmaxsT3IU+Tl3vYKVRdjfhg8Bbdjw7B+E0y6F7Yz6l+eaQLn0BRmGMXIhcPDONPtOkMoNwx1etZh4zPJA==", + "dev": true + }, + "p-reduce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", + "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", + "dev": true + }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "plur": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/plur/-/plur-3.1.1.tgz", + "integrity": "sha512-t1Ax8KUvV3FFII8ltczPn2tJdjqbd1sIzu6t4JL7nQ3EyeL/lTrj5PWKb06ic5/6XYDr65rQ4uzQEGN70/6X5w==", + "dev": true, + "requires": { + "irregular-plurals": "^2.0.0" + } + }, + "pngcrush-bin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/pngcrush-bin/-/pngcrush-bin-4.0.0.tgz", + "integrity": "sha512-SFR9a/OgkuFiiksjM6yevTGvOdn+7JrL5r0j/zCVAZTurfRzh2smwDRYKnPMEwxgVOkwWt/tlVWRJUstSH7RcA==", + "dev": true, + "requires": { + "bin-build": "^3.0.0", + "bin-wrapper": "^4.0.0", + "logalot": "^2.0.0" + } + }, + "pngquant-bin": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/pngquant-bin/-/pngquant-bin-5.0.2.tgz", + "integrity": "sha512-OLdT+4JZx5BqE1CFJkrvomYV0aSsv6x2Bba+aWaVc0PMfWlE+ZByNKYAdKeIqsM4uvW1HOSEHnf8KcOnykPNxA==", + "dev": true, + "requires": { + "bin-build": "^3.0.0", + "bin-wrapper": "^4.0.1", + "execa": "^0.10.0", + "logalot": "^2.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + }, + "dependencies": { + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "readdirp": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + }, + "dependencies": { + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + } + } + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.7.3.tgz", + "integrity": "sha512-lAWJGZ5BQzcu/5fhMKGJrh5oy9LQUoaCid8cQV8k+E2vE9E/UWptzcM+bSBg+u8akORsvnybsqQUE/wVChIazg==", + "dev": true, + "requires": { + "fsevents": "~2.1.2" + } + }, + "rollup-plugin-terser": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.3.0.tgz", + "integrity": "sha512-XGMJihTIO3eIBsVGq7jiNYOdDMb3pVxuzY0uhOE/FM4x/u9nQgr3+McsjzqBn3QfHIpNSZmFnpoKAwHBEcsT7g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "jest-worker": "^24.9.0", + "rollup-pluginutils": "^2.8.2", + "serialize-javascript": "^2.1.2", + "terser": "^4.6.2" + } + }, + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "requires": { + "estree-walker": "^0.6.1" + } + }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "dev": true + }, + "sass": { + "version": "1.26.5", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.26.5.tgz", + "integrity": "sha512-FG2swzaZUiX53YzZSjSakzvGtlds0lcbF+URuU9mxOv7WBh7NhXEVDa4kPKN4hN6fC2TkOTOKqiqp6d53N9X5Q==", + "dev": true, + "requires": { + "chokidar": ">=2.0.0 <4.0.0" + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "seek-bzip": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", + "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", + "dev": true, + "requires": { + "commander": "~2.8.1" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, + "semver-truncate": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/semver-truncate/-/semver-truncate-1.1.2.tgz", + "integrity": "sha1-V/Qd5pcHpicJp+AQS6IRcQnqR+g=", + "dev": true, + "requires": { + "semver": "^5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "serialize-javascript": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", + "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "sort-keys": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "sort-keys-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sort-keys-length/-/sort-keys-length-1.0.1.tgz", + "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=", + "dev": true, + "requires": { + "sort-keys": "^1.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "squeak": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/squeak/-/squeak-1.3.0.tgz", + "integrity": "sha1-MwRQN7ZDiLVnZ0uEMiplIQc5FsM=", + "dev": true, + "requires": { + "chalk": "^1.0.0", + "console-stream": "^0.1.1", + "lpad-align": "^1.0.1" + } + }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "dev": true + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-dirs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", + "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", + "dev": true, + "requires": { + "is-natural-number": "^4.0.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "strip-outer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", + "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.2" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "svgo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", + "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "coa": "^2.0.2", + "css-select": "^2.0.0", + "css-select-base-adapter": "^0.1.1", + "css-tree": "1.0.0-alpha.37", + "csso": "^4.0.2", + "js-yaml": "^3.13.1", + "mkdirp": "~0.5.1", + "object.values": "^1.1.0", + "sax": "~1.2.4", + "stable": "^0.1.8", + "unquote": "~1.1.1", + "util.promisify": "~1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "tar-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "dev": true, + "requires": { + "bl": "^1.0.0", + "buffer-alloc": "^1.2.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.1", + "xtend": "^4.0.0" + } + }, + "temp-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", + "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=", + "dev": true + }, + "tempfile": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tempfile/-/tempfile-2.0.0.tgz", + "integrity": "sha1-awRGhWqbERTRhW/8vlCczLCXcmU=", + "dev": true, + "requires": { + "temp-dir": "^1.0.0", + "uuid": "^3.0.1" + } + }, + "terser": { + "version": "4.6.12", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.12.tgz", + "integrity": "sha512-fnIwuaKjFPANG6MAixC/k1TDtnl1YlPLUlLVIxxGZUn1gfUx2+l3/zGNB72wya+lgsb50QBi2tUV75RiODwnww==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, + "to-buffer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", + "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "trim-repeated": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", + "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.2" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "type-fest": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.5.2.tgz", + "integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==", + "dev": true + }, + "unbzip2-stream": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.2.tgz", + "integrity": "sha512-pZMVAofMrrHX6Ik39hCk470kulCbmZ2SWfQLPmTWqfJV/oUm0gn1CblvHdUu4+54Je6Jq34x8kY6XjTy6dMkOg==", + "dev": true, + "requires": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", + "dev": true + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "^1.0.1" + } + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "zopflipng-bin": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/zopflipng-bin/-/zopflipng-bin-5.0.0.tgz", + "integrity": "sha512-8AWRT/CPkIBEup96LSiVdhLT4n7b4bpzY0BcQ26OjdRnjODa+JWNK55Ii63CiOEyqObPSwjLifuUI5ooFmjiGQ==", + "dev": true, + "requires": { + "bin-build": "^3.0.0", + "bin-wrapper": "^4.0.1", + "logalot": "^2.1.0" + } + } + } +} diff --git a/package.json b/package.json index 84cbd2b..25f47ba 100755 --- a/package.json +++ b/package.json @@ -1,37 +1,30 @@ { - "name": "smooth-scroll", - "version": "12.1.5", - "description": "Animate scrolling to anchor links", - "main": "./dist/js/smooth-scroll.min.js", - "author": { - "name": "Chris Ferdinandi", - "url": "http://gomakethings.com/" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "http://github.com/cferdinandi/smooth-scroll" - }, - "devDependencies": { - "gulp": "^3.9.1", - "node-fs": "^0.1.7", - "del": "^2.2.2", - "lazypipe": "^1.0.1", - "gulp-plumber": "^1.1.0", - "gulp-flatten": "^0.3.1", - "gulp-tap": "^0.1.3", - "gulp-rename": "^1.2.2", - "gulp-header": "^1.8.8", - "gulp-footer": "^1.0.5", - "gulp-watch": "^4.3.11", - "gulp-livereload": "^3.8.1", - "jshint": "^2.9.4", - "gulp-jshint": "^2.0.4", - "jshint-stylish": "^2.2.1", - "gulp-concat": "^2.6.1", - "gulp-uglify": "^2.1.2", - "gulp-optimize-js": "^1.1.0", - "gulp-markdown": "^1.2.0", - "gulp-file-include": "^0.14.0" - } -} \ No newline at end of file + "name": "smooth-scroll", + "version": "16.1.4", + "description": "Animate scrolling to anchor links", + "main": "./dist/smooth-scroll.polyfills.min.js", + "author": { + "name": "Chris Ferdinandi", + "url": "http://gomakethings.com/" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "http://github.com/cferdinandi/smooth-scroll" + }, + "scripts": { + "js": "rollup --config", + "build": "npm run js" + }, + "devDependencies": { + "rollup": "^2.6.1", + "rollup-plugin-terser": "^5.3.0", + "sass": "^1.26.5", + "imagemin-cli": "^5.1.0", + "imagemin-mozjpeg": "^8.0.0", + "imagemin-pngcrush": "^6.0.0", + "imagemin-pngquant": "^8.0.0", + "imagemin-zopfli": "^6.0.0", + "svgo": "^1.3.2" + } +} diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..086774b --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,72 @@ +// Plugins +import { terser } from 'rollup-plugin-terser'; +import pkg from './package.json'; + + +// Configs +var configs = { + name: 'SmoothScroll', + files: ['smooth-scroll.js', 'smooth-scroll.polyfills.js'], + formats: ['umd'], + default: 'umd', + pathIn: 'src/', + pathOut: 'dist/', + minify: true +}; + +// Banner +var banner = `/*! ${configs.name ? configs.name : pkg.name} v${pkg.version} | (c) ${new Date().getFullYear()} ${pkg.author.name} | ${pkg.license} License | ${pkg.repository.url} */`; + +var createOutput = function (filename, minify) { + return configs.formats.map(function (format) { + var output = { + file: `${configs.pathOut}/${filename}${format === configs.default ? '' : `.${format}`}${minify ? '.min' : ''}.js`, + format: format, + banner: banner + }; + if (format === 'iife' || format === 'umd') { + output.name = configs.name ? configs.name : pkg.name; + } + if (minify) { + output.plugins = [terser()]; + } + return output; + }); +}; + +/** + * Create output formats + * @param {String} filename The filename + * @return {Array} The outputs array + */ +var createOutputs = function (filename) { + + // Create base outputs + var outputs = createOutput(filename); + + // If not minifying, return outputs + if (!configs.minify) return outputs; + + // Otherwise, ceate second set of outputs + var outputsMin = createOutput(filename, true); + + // Merge and return the two arrays + return outputs.concat(outputsMin); + +}; + +/** + * Create export object + * @return {Array} The export object + */ +var createExport = function (file) { + return configs.files.map(function (file) { + var filename = file.replace('.js', ''); + return { + input: `${configs.pathIn}/${file}`, + output: createOutputs(filename) + }; + }); +}; + +export default createExport(); \ No newline at end of file diff --git a/speed.html b/speed.html new file mode 100644 index 0000000..21c834a --- /dev/null +++ b/speed.html @@ -0,0 +1,69 @@ + + + + + + Smooth Scroll + + + + + + + + +
+ + + +
+

+ Click Me
+ Or me +

+ +

+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
. +

+ +

Bazinga!

+ +

+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
. + .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
.
+ .
.
.
.
.
.
.
.
.
.
.
.
. +

+ +

Back to the top

+ +

.
.
.
.
.

+
+
+ + + + + + + + \ No newline at end of file diff --git a/src/js/_closest.polyfill.js b/src/_closest.polyfill.js similarity index 100% rename from src/js/_closest.polyfill.js rename to src/_closest.polyfill.js diff --git a/src/_customEvent.polyfill.js b/src/_customEvent.polyfill.js new file mode 100644 index 0000000..4e7a110 --- /dev/null +++ b/src/_customEvent.polyfill.js @@ -0,0 +1,19 @@ +/** + * CustomEvent() polyfill + * https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill + */ +(function () { + + if (typeof window.CustomEvent === "function") return false; + + function CustomEvent(event, params) { + params = params || { bubbles: false, cancelable: false, detail: undefined }; + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); + return evt; + } + + CustomEvent.prototype = window.Event.prototype; + + window.CustomEvent = CustomEvent; +})(); \ No newline at end of file diff --git a/src/js/_requestAnimationFrame.polyfill.js b/src/_requestAnimationFrame.polyfill.js similarity index 100% rename from src/js/_requestAnimationFrame.polyfill.js rename to src/_requestAnimationFrame.polyfill.js diff --git a/src/core.js b/src/core.js new file mode 100755 index 0000000..25abec6 --- /dev/null +++ b/src/core.js @@ -0,0 +1,622 @@ +// +// Default settings +// + +var defaults = { + + // Selectors + ignore: '[data-scroll-ignore]', + header: null, + topOnEmptyHash: true, + + // Speed & Duration + speed: 500, + speedAsDuration: false, + durationMax: null, + durationMin: null, + clip: true, + offset: 0, + + // Easing + easing: 'easeInOutCubic', + customEasing: null, + + // History + updateURL: true, + popstate: true, + + // Custom Events + emitEvents: true + +}; + + +// +// Utility Methods +// + +/** + * Check if browser supports required methods + * @return {Boolean} Returns true if all required methods are supported + */ +var supports = function () { + return ( + 'querySelector' in document && + 'addEventListener' in window && + 'requestAnimationFrame' in window && + 'closest' in window.Element.prototype + ); +}; + +/** + * Merge two or more objects together. + * @param {Object} objects The objects to merge together + * @returns {Object} Merged values of defaults and options + */ +var extend = function () { + var merged = {}; + Array.prototype.forEach.call(arguments, function (obj) { + for (var key in obj) { + if (!obj.hasOwnProperty(key)) return; + merged[key] = obj[key]; + } + }); + return merged; +}; + +/** + * Check to see if user prefers reduced motion + * @param {Object} settings Script settings + */ +var reduceMotion = function () { + if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { + return true; + } + return false; +}; + +/** + * Get the height of an element. + * @param {Node} elem The element to get the height of + * @return {Number} The element's height in pixels + */ +var getHeight = function (elem) { + return parseInt(window.getComputedStyle(elem).height, 10); +}; + +/** + * Escape special characters for use with querySelector + * @author Mathias Bynens + * @link https://github.com/mathiasbynens/CSS.escape + * @param {String} id The anchor ID to escape + */ +var escapeCharacters = function (id) { + + // Remove leading hash + if (id.charAt(0) === '#') { + id = id.substr(1); + } + + var string = String(id); + var length = string.length; + var index = -1; + var codeUnit; + var result = ''; + var firstCodeUnit = string.charCodeAt(0); + while (++index < length) { + codeUnit = string.charCodeAt(index); + // Note: there’s no need to special-case astral symbols, surrogate + // pairs, or lone surrogates. + + // If the character is NULL (U+0000), then throw an + // `InvalidCharacterError` exception and terminate these steps. + if (codeUnit === 0x0000) { + throw new InvalidCharacterError( + 'Invalid character: the input contains U+0000.' + ); + } + + if ( + // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is + // U+007F, […] + (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F || + // If the character is the first character and is in the range [0-9] + // (U+0030 to U+0039), […] + (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) || + // If the character is the second character and is in the range [0-9] + // (U+0030 to U+0039) and the first character is a `-` (U+002D), […] + ( + index === 1 && + codeUnit >= 0x0030 && codeUnit <= 0x0039 && + firstCodeUnit === 0x002D + ) + ) { + // http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point + result += '\\' + codeUnit.toString(16) + ' '; + continue; + } + + // If the character is not handled by one of the above rules and is + // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or + // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to + // U+005A), or [a-z] (U+0061 to U+007A), […] + if ( + codeUnit >= 0x0080 || + codeUnit === 0x002D || + codeUnit === 0x005F || + codeUnit >= 0x0030 && codeUnit <= 0x0039 || + codeUnit >= 0x0041 && codeUnit <= 0x005A || + codeUnit >= 0x0061 && codeUnit <= 0x007A + ) { + // the character itself + result += string.charAt(index); + continue; + } + + // Otherwise, the escaped character. + // http://dev.w3.org/csswg/cssom/#escape-a-character + result += '\\' + string.charAt(index); + + } + + // Return sanitized hash + return '#' + result; + +}; + +/** + * Calculate the easing pattern + * @link https://gist.github.com/gre/1650294 + * @param {Object} settings Easing pattern + * @param {Number} time Time animation should take to complete + * @returns {Number} + */ +var easingPattern = function (settings, time) { + var pattern; + + // Default Easing Patterns + if (settings.easing === 'easeInQuad') pattern = time * time; // accelerating from zero velocity + if (settings.easing === 'easeOutQuad') pattern = time * (2 - time); // decelerating to zero velocity + if (settings.easing === 'easeInOutQuad') pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration + if (settings.easing === 'easeInCubic') pattern = time * time * time; // accelerating from zero velocity + if (settings.easing === 'easeOutCubic') pattern = (--time) * time * time + 1; // decelerating to zero velocity + if (settings.easing === 'easeInOutCubic') pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration + if (settings.easing === 'easeInQuart') pattern = time * time * time * time; // accelerating from zero velocity + if (settings.easing === 'easeOutQuart') pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity + if (settings.easing === 'easeInOutQuart') pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration + if (settings.easing === 'easeInQuint') pattern = time * time * time * time * time; // accelerating from zero velocity + if (settings.easing === 'easeOutQuint') pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity + if (settings.easing === 'easeInOutQuint') pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration + + // Custom Easing Patterns + if (!!settings.customEasing) pattern = settings.customEasing(time); + + return pattern || time; // no easing, no acceleration +}; + +/** + * Determine the document's height + * @returns {Number} + */ +var getDocumentHeight = function () { + return Math.max( + document.body.scrollHeight, document.documentElement.scrollHeight, + document.body.offsetHeight, document.documentElement.offsetHeight, + document.body.clientHeight, document.documentElement.clientHeight + ); +}; + +/** + * Calculate how far to scroll + * Clip support added by robjtede - https://github.com/cferdinandi/smooth-scroll/issues/405 + * @param {Element} anchor The anchor element to scroll to + * @param {Number} headerHeight Height of a fixed header, if any + * @param {Number} offset Number of pixels by which to offset scroll + * @param {Boolean} clip If true, adjust scroll distance to prevent abrupt stops near the bottom of the page + * @returns {Number} + */ +var getEndLocation = function (anchor, headerHeight, offset, clip) { + var location = 0; + if (anchor.offsetParent) { + do { + location += anchor.offsetTop; + anchor = anchor.offsetParent; + } while (anchor); + } + location = Math.max(location - headerHeight - offset, 0); + if (clip) { + location = Math.min(location, getDocumentHeight() - window.innerHeight); + } + return location; +}; + +/** + * Get the height of the fixed header + * @param {Node} header The header + * @return {Number} The height of the header + */ +var getHeaderHeight = function (header) { + return !header ? 0 : (getHeight(header) + header.offsetTop); +}; + +/** + * Calculate the speed to use for the animation + * @param {Number} distance The distance to travel + * @param {Object} settings The plugin settings + * @return {Number} How fast to animate + */ +var getSpeed = function (distance, settings) { + var speed = settings.speedAsDuration ? settings.speed : Math.abs(distance / 1000 * settings.speed); + if (settings.durationMax && speed > settings.durationMax) return settings.durationMax; + if (settings.durationMin && speed < settings.durationMin) return settings.durationMin; + return parseInt(speed, 10); +}; + +var setHistory = function (options) { + + // Make sure this should run + if (!history.replaceState || !options.updateURL || history.state) return; + + // Get the hash to use + var hash = window.location.hash; + hash = hash ? hash : ''; + + // Set a default history + history.replaceState( + { + smoothScroll: JSON.stringify(options), + anchor: hash ? hash : window.pageYOffset + }, + document.title, + hash ? hash : window.location.href + ); + +}; + +/** + * Update the URL + * @param {Node} anchor The anchor that was scrolled to + * @param {Boolean} isNum If true, anchor is a number + * @param {Object} options Settings for Smooth Scroll + */ +var updateURL = function (anchor, isNum, options) { + + // Bail if the anchor is a number + if (isNum) return; + + // Verify that pushState is supported and the updateURL option is enabled + if (!history.pushState || !options.updateURL) return; + + // Update URL + history.pushState( + { + smoothScroll: JSON.stringify(options), + anchor: anchor.id + }, + document.title, + anchor === document.documentElement ? '#top' : '#' + anchor.id + ); + +}; + +/** + * Bring the anchored element into focus + * @param {Node} anchor The anchor element + * @param {Number} endLocation The end location to scroll to + * @param {Boolean} isNum If true, scroll is to a position rather than an element + */ +var adjustFocus = function (anchor, endLocation, isNum) { + + // Is scrolling to top of page, blur + if (anchor === 0) { + document.body.focus(); + } + + // Don't run if scrolling to a number on the page + if (isNum) return; + + // Otherwise, bring anchor element into focus + anchor.focus(); + if (document.activeElement !== anchor) { + anchor.setAttribute('tabindex', '-1'); + anchor.focus(); + anchor.style.outline = 'none'; + } + window.scrollTo(0 , endLocation); + +}; + +/** + * Emit a custom event + * @param {String} type The event type + * @param {Object} options The settings object + * @param {Node} anchor The anchor element + * @param {Node} toggle The toggle element + */ +var emitEvent = function (type, options, anchor, toggle) { + if (!options.emitEvents || typeof window.CustomEvent !== 'function') return; + var event = new CustomEvent(type, { + bubbles: true, + detail: { + anchor: anchor, + toggle: toggle + } + }); + document.dispatchEvent(event); +}; + + +// +// SmoothScroll Constructor +// + +var SmoothScroll = function (selector, options) { + + // + // Variables + // + + var smoothScroll = {}; // Object for public APIs + var settings, anchor, toggle, fixedHeader, eventTimeout, animationInterval; + + + // + // Methods + // + + /** + * Cancel a scroll-in-progress + */ + smoothScroll.cancelScroll = function (noEvent) { + cancelAnimationFrame(animationInterval); + animationInterval = null; + if (noEvent) return; + emitEvent('scrollCancel', settings); + }; + + /** + * Start/stop the scrolling animation + * @param {Node|Number} anchor The element or position to scroll to + * @param {Element} toggle The element that toggled the scroll event + * @param {Object} options + */ + smoothScroll.animateScroll = function (anchor, toggle, options) { + + // Cancel any in progress scrolls + smoothScroll.cancelScroll(); + + // Local settings + var _settings = extend(settings || defaults, options || {}); // Merge user options with defaults + + // Selectors and variables + var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; + var anchorElem = isNum || !anchor.tagName ? null : anchor; + if (!isNum && !anchorElem) return; + var startLocation = window.pageYOffset; // Current location on the page + if (_settings.header && !fixedHeader) { + // Get the fixed header if not already set + fixedHeader = document.querySelector(_settings.header); + } + var headerHeight = getHeaderHeight(fixedHeader); + var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof _settings.offset === 'function' ? _settings.offset(anchor, toggle) : _settings.offset), 10), _settings.clip); // Location to scroll to + var distance = endLocation - startLocation; // distance to travel + var documentHeight = getDocumentHeight(); + var timeLapsed = 0; + var speed = getSpeed(distance, _settings); + var start, percentage, position; + + /** + * Stop the scroll animation when it reaches its target (or the bottom/top of page) + * @param {Number} position Current position on the page + * @param {Number} endLocation Scroll to location + * @param {Number} animationInterval How much to scroll on this loop + */ + var stopAnimateScroll = function (position, endLocation) { + + // Get the current location + var currentLocation = window.pageYOffset; + + // Check if the end location has been reached yet (or we've hit the end of the document) + if (position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight)) { + + // Clear the animation timer + smoothScroll.cancelScroll(true); + + // Bring the anchored element into focus + adjustFocus(anchor, endLocation, isNum); + + // Emit a custom event + emitEvent('scrollStop', _settings, anchor, toggle); + + // Reset start + start = null; + animationInterval = null; + + return true; + + } + }; + + /** + * Loop scrolling animation + */ + var loopAnimateScroll = function (timestamp) { + if (!start) { start = timestamp; } + timeLapsed += timestamp - start; + percentage = speed === 0 ? 0 : (timeLapsed / speed); + percentage = (percentage > 1) ? 1 : percentage; + position = startLocation + (distance * easingPattern(_settings, percentage)); + window.scrollTo(0, Math.floor(position)); + if (!stopAnimateScroll(position, endLocation)) { + animationInterval = window.requestAnimationFrame(loopAnimateScroll); + start = timestamp; + } + }; + + /** + * Reset position to fix weird iOS bug + * @link https://github.com/cferdinandi/smooth-scroll/issues/45 + */ + if (window.pageYOffset === 0) { + window.scrollTo(0, 0); + } + + // Update the URL + updateURL(anchor, isNum, _settings); + + // If the user prefers reduced motion, jump to location + if (reduceMotion()) { + adjustFocus(anchor, Math.floor(endLocation), false); + return; + } + + // Emit a custom event + emitEvent('scrollStart', _settings, anchor, toggle); + + // Start scrolling animation + smoothScroll.cancelScroll(true); + window.requestAnimationFrame(loopAnimateScroll); + + }; + + /** + * If smooth scroll element clicked, animate scroll + */ + var clickHandler = function (event) { + + // Don't run if event was canceled but still bubbled up + // By @mgreter - https://github.com/cferdinandi/smooth-scroll/pull/462/ + if (event.defaultPrevented) return; + + // Don't run if right-click or command/control + click or shift + click + if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey) return; + + // Check if event.target has closest() method + // By @totegi - https://github.com/cferdinandi/smooth-scroll/pull/401/ + if (!('closest' in event.target)) return; + + // Check if a smooth scroll link was clicked + toggle = event.target.closest(selector); + if (!toggle || toggle.tagName.toLowerCase() !== 'a' || event.target.closest(settings.ignore)) return; + + // Only run if link is an anchor and points to the current page + if (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return; + + // Get an escaped version of the hash + var hash; + try { + hash = escapeCharacters(decodeURIComponent(toggle.hash)); + } catch(e) { + hash = escapeCharacters(toggle.hash); + } + + // Get the anchored element + var anchor; + if (hash === '#') { + if (!settings.topOnEmptyHash) return; + anchor = document.documentElement; + } else { + anchor = document.querySelector(hash); + } + anchor = !anchor && hash === '#top' ? document.documentElement : anchor; + + // If anchored element exists, scroll to it + if (!anchor) return; + event.preventDefault(); + setHistory(settings); + smoothScroll.animateScroll(anchor, toggle); + + }; + + /** + * Animate scroll on popstate events + */ + var popstateHandler = function () { + + // Stop if history.state doesn't exist (ex. if clicking on a broken anchor link). + // fixes `Cannot read property 'smoothScroll' of null` error getting thrown. + if (history.state === null) return; + + // Only run if state is a popstate record for this instantiation + if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return; + + // Get the anchor + var anchor = history.state.anchor; + if (typeof anchor === 'string' && anchor) { + anchor = document.querySelector(escapeCharacters(history.state.anchor)); + if (!anchor) return; + } + + // Animate scroll to anchor link + smoothScroll.animateScroll(anchor, null, {updateURL: false}); + + }; + + /** + * Destroy the current initialization. + */ + smoothScroll.destroy = function () { + + // If plugin isn't already initialized, stop + if (!settings) return; + + // Remove event listeners + document.removeEventListener('click', clickHandler, false); + window.removeEventListener('popstate', popstateHandler, false); + + // Cancel any scrolls-in-progress + smoothScroll.cancelScroll(); + + // Reset variables + settings = null; + anchor = null; + toggle = null; + fixedHeader = null; + eventTimeout = null; + animationInterval = null; + + }; + + /** + * Initialize Smooth Scroll + * @param {Object} options User settings + */ + var init = function () { + + // feature test + if (!supports()) throw 'Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.'; + + // Destroy any existing initializations + smoothScroll.destroy(); + + // Selectors and variables + settings = extend(defaults, options || {}); // Merge user options with defaults + fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header + + // When a toggle is clicked, run the click handler + document.addEventListener('click', clickHandler, false); + + // If updateURL and popState are enabled, listen for pop events + if (settings.updateURL && settings.popstate) { + window.addEventListener('popstate', popstateHandler, false); + } + + }; + + + // + // Initialize plugin + // + + init(); + + + // + // Public APIs + // + + return smoothScroll; + +}; + +export default SmoothScroll; \ No newline at end of file diff --git a/src/docs/_templates/_footer.html b/src/docs/_templates/_footer.html deleted file mode 100755 index d345f64..0000000 --- a/src/docs/_templates/_footer.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/docs/_templates/_header.html b/src/docs/_templates/_header.html deleted file mode 100755 index f41de92..0000000 --- a/src/docs/_templates/_header.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Smooth Scroll - - - - - - - - -
- - - -
diff --git a/src/docs/index.md b/src/docs/index.md deleted file mode 100755 index ad2e7f0..0000000 --- a/src/docs/index.md +++ /dev/null @@ -1,57 +0,0 @@ -

- Linear
- Linear (no other options)
-

- -

- Ease-In
- Quad
- Cubic
- Quart
- Quint -

- -

- Ease-In-Out
- Quad
- Cubic
- Quart
- Quint -

- -

- Ease-Out
- Quad
- Cubic
- Quart
- Quint -

- -

- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
. -

- -

- Non-ASCII Characters
- 中文 -

- -

- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
. -

- -

中文

- -

Bazinga!

- -

- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
.
- .
.
.
.
.
.
.
.
.
.
.
.
. -

- -

Back to the top

\ No newline at end of file diff --git a/src/js/smooth-scroll.js b/src/js/smooth-scroll.js deleted file mode 100755 index 7e83b2c..0000000 --- a/src/js/smooth-scroll.js +++ /dev/null @@ -1,568 +0,0 @@ -(function (root, factory) { - if ( typeof define === 'function' && define.amd ) { - define([], function () { - return factory(root); - }); - } else if ( typeof exports === 'object' ) { - module.exports = factory(root); - } else { - root.SmoothScroll = factory(root); - } -})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) { - - 'use strict'; - - // - // Feature Test - // - - var supports = - 'querySelector' in document && - 'addEventListener' in window && - 'requestAnimationFrame' in window && - 'closest' in window.Element.prototype; - - - // - // Default settings - // - - var defaults = { - // Selectors - ignore: '[data-scroll-ignore]', - header: null, - - // Speed & Easing - speed: 500, - offset: 0, - easing: 'easeInOutCubic', - customEasing: null, - - // Callback API - before: function () {}, - after: function () {} - }; - - - // - // Utility Methods - // - - /** - * Merge two or more objects. Returns a new object. - * @param {Object} objects The objects to merge together - * @returns {Object} Merged values of defaults and options - */ - var extend = function () { - - // Variables - var extended = {}; - var i = 0; - var length = arguments.length; - - // Merge the object into the extended object - var merge = function (obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - extended[prop] = obj[prop]; - } - } - }; - - // Loop through each object and conduct a merge - for ( ; i < length; i++ ) { - var obj = arguments[i]; - merge(obj); - } - - return extended; - - }; - - /** - * Get the height of an element. - * @param {Node} elem The element to get the height of - * @return {Number} The element's height in pixels - */ - var getHeight = function (elem) { - return parseInt(window.getComputedStyle(elem).height, 10); - }; - - /** - * Escape special characters for use with querySelector - * @param {String} id The anchor ID to escape - * @author Mathias Bynens - * @link https://github.com/mathiasbynens/CSS.escape - */ - var escapeCharacters = function (id) { - - // Remove leading hash - if (id.charAt(0) === '#') { - id = id.substr(1); - } - - var string = String(id); - var length = string.length; - var index = -1; - var codeUnit; - var result = ''; - var firstCodeUnit = string.charCodeAt(0); - while (++index < length) { - codeUnit = string.charCodeAt(index); - // Note: there’s no need to special-case astral symbols, surrogate - // pairs, or lone surrogates. - - // If the character is NULL (U+0000), then throw an - // `InvalidCharacterError` exception and terminate these steps. - if (codeUnit === 0x0000) { - throw new InvalidCharacterError( - 'Invalid character: the input contains U+0000.' - ); - } - - if ( - // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is - // U+007F, […] - (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F || - // If the character is the first character and is in the range [0-9] - // (U+0030 to U+0039), […] - (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) || - // If the character is the second character and is in the range [0-9] - // (U+0030 to U+0039) and the first character is a `-` (U+002D), […] - ( - index === 1 && - codeUnit >= 0x0030 && codeUnit <= 0x0039 && - firstCodeUnit === 0x002D - ) - ) { - // http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point - result += '\\' + codeUnit.toString(16) + ' '; - continue; - } - - // If the character is not handled by one of the above rules and is - // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or - // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to - // U+005A), or [a-z] (U+0061 to U+007A), […] - if ( - codeUnit >= 0x0080 || - codeUnit === 0x002D || - codeUnit === 0x005F || - codeUnit >= 0x0030 && codeUnit <= 0x0039 || - codeUnit >= 0x0041 && codeUnit <= 0x005A || - codeUnit >= 0x0061 && codeUnit <= 0x007A - ) { - // the character itself - result += string.charAt(index); - continue; - } - - // Otherwise, the escaped character. - // http://dev.w3.org/csswg/cssom/#escape-a-character - result += '\\' + string.charAt(index); - - } - - return '#' + result; - - }; - - /** - * Calculate the easing pattern - * @link https://gist.github.com/gre/1650294 - * @param {String} type Easing pattern - * @param {Number} time Time animation should take to complete - * @returns {Number} - */ - var easingPattern = function (settings, time) { - var pattern; - - // Default Easing Patterns - if (settings.easing === 'easeInQuad') pattern = time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuad') pattern = time * (2 - time); // decelerating to zero velocity - if (settings.easing === 'easeInOutQuad') pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInCubic') pattern = time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutCubic') pattern = (--time) * time * time + 1; // decelerating to zero velocity - if (settings.easing === 'easeInOutCubic') pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInQuart') pattern = time * time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuart') pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity - if (settings.easing === 'easeInOutQuart') pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration - if (settings.easing === 'easeInQuint') pattern = time * time * time * time * time; // accelerating from zero velocity - if (settings.easing === 'easeOutQuint') pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity - if (settings.easing === 'easeInOutQuint') pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration - - // Custom Easing Patterns - if (!!settings.customEasing) pattern = settings.customEasing(time); - - return pattern || time; // no easing, no acceleration - }; - - /** - * Determine the document's height - * @returns {Number} - */ - var getDocumentHeight = function () { - return Math.max( - document.body.scrollHeight, document.documentElement.scrollHeight, - document.body.offsetHeight, document.documentElement.offsetHeight, - document.body.clientHeight, document.documentElement.clientHeight - ); - }; - - /** - * Calculate how far to scroll - * @param {Element} anchor The anchor element to scroll to - * @param {Number} headerHeight Height of a fixed header, if any - * @param {Number} offset Number of pixels by which to offset scroll - * @returns {Number} - */ - var getEndLocation = function (anchor, headerHeight, offset) { - var location = 0; - if (anchor.offsetParent) { - do { - location += anchor.offsetTop; - anchor = anchor.offsetParent; - } while (anchor); - } - location = Math.max(location - headerHeight - offset, 0); - return location; - }; - - /** - * Get the height of the fixed header - * @param {Node} header The header - * @return {Number} The height of the header - */ - var getHeaderHeight = function (header) { - return !header ? 0 : (getHeight(header) + header.offsetTop); - }; - - /** - * Bring the anchored element into focus - * @param {Node} anchor The anchor element - * @param {Number} endLocation The end location to scroll to - * @param {Boolean} isNum If true, scroll is to a position rather than an element - */ - var adjustFocus = function (anchor, endLocation, isNum) { - - // Don't run if scrolling to a number on the page - if (isNum) return; - - // Otherwise, bring anchor element into focus - anchor.focus(); - if (document.activeElement.id !== anchor.id) { - anchor.setAttribute('tabindex', '-1'); - anchor.focus(); - anchor.style.outline = 'none'; - } - window.scrollTo(0 , endLocation); - - }; - - /** - * Check to see if user prefers reduced motion - * @param {Object} settings Script settings - */ - var reduceMotion = function (settings) { - if ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) { - return true; - } - return false; - }; - - - // - // SmoothScroll Constructor - // - - var SmoothScroll = function (selector, options) { - - // - // Variables - // - - var smoothScroll = {}; // Object for public APIs - var settings, anchor, toggle, fixedHeader, headerHeight, eventTimeout, animationInterval; - - - // - // Methods - // - - /** - * Cancel a scroll-in-progress - */ - smoothScroll.cancelScroll = function () { - // clearInterval(animationInterval); - cancelAnimationFrame(animationInterval); - }; - - /** - * Start/stop the scrolling animation - * @param {Node|Number} anchor The element or position to scroll to - * @param {Element} toggle The element that toggled the scroll event - * @param {Object} options - */ - smoothScroll.animateScroll = function (anchor, toggle, options) { - - // Local settings - var animateSettings = extend(settings || defaults, options || {}); // Merge user options with defaults - - // Selectors and variables - var isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false; - var anchorElem = isNum || !anchor.tagName ? null : anchor; - if (!isNum && !anchorElem) return; - var startLocation = window.pageYOffset; // Current location on the page - if (animateSettings.header && !fixedHeader) { - // Get the fixed header if not already set - fixedHeader = document.querySelector( animateSettings.header ); - } - if (!headerHeight) { - // Get the height of a fixed header if one exists and not already set - headerHeight = getHeaderHeight(fixedHeader); - } - var endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof animateSettings.offset === 'function' ? animateSettings.offset() : animateSettings.offset), 10)); // Location to scroll to - var distance = endLocation - startLocation; // distance to travel - var documentHeight = getDocumentHeight(); - var timeLapsed = 0; - var start, percentage, position; - - /** - * Stop the scroll animation when it reaches its target (or the bottom/top of page) - * @param {Number} position Current position on the page - * @param {Number} endLocation Scroll to location - * @param {Number} animationInterval How much to scroll on this loop - */ - var stopAnimateScroll = function (position, endLocation) { - - // Get the current location - var currentLocation = window.pageYOffset; - - // Check if the end location has been reached yet (or we've hit the end of the document) - if ( position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight )) { - - // Clear the animation timer - smoothScroll.cancelScroll(); - - // Bring the anchored element into focus - adjustFocus(anchor, endLocation, isNum); - - // Run callback after animation complete - animateSettings.after(anchor, toggle); - - // Reset start - start = null; - - return true; - - } - }; - - /** - * Loop scrolling animation - */ - var loopAnimateScroll = function (timestamp) { - if (!start) { start = timestamp; } - timeLapsed += timestamp - start; - percentage = (timeLapsed / parseInt(animateSettings.speed, 10)); - percentage = (percentage > 1) ? 1 : percentage; - position = startLocation + (distance * easingPattern(animateSettings, percentage)); - window.scrollTo(0, Math.floor(position)); - if (!stopAnimateScroll(position, endLocation)) { - window.requestAnimationFrame(loopAnimateScroll); - start = timestamp; - } - }; - - /** - * Reset position to fix weird iOS bug - * @link https://github.com/cferdinandi/smooth-scroll/issues/45 - */ - if (window.pageYOffset === 0) { - window.scrollTo( 0, 0 ); - } - - // Run callback before animation starts - animateSettings.before(anchor, toggle); - - // Start scrolling animation - smoothScroll.cancelScroll(); - window.requestAnimationFrame(loopAnimateScroll); - - - }; - - /** - * Handle has change event - */ - var hashChangeHandler = function (event) { - - // Only run if there's an anchor element to scroll to - if (!anchor) return; - - // Reset the anchor element's ID - anchor.id = anchor.getAttribute('data-scroll-id'); - - // Scroll to the anchored content - smoothScroll.animateScroll(anchor, toggle); - - // Reset anchor and toggle - anchor = null; - toggle = null; - - }; - - /** - * If smooth scroll element clicked, animate scroll - */ - var clickHandler = function (event) { - - // Don't run if the user prefers reduced motion - if (reduceMotion(settings)) return; - - // Don't run if right-click or command/control + click - if (event.button !== 0 || event.metaKey || event.ctrlKey) return; - - // Check if a smooth scroll link was clicked - toggle = event.target.closest(selector); - if (!toggle || toggle.tagName.toLowerCase() !== 'a' || event.target.closest(settings.ignore)) return; - - // Only run if link is an anchor and points to the current page - if (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return; - - // Get the sanitized hash - var hash; - try { - hash = escapeCharacters(decodeURIComponent(toggle.hash)); - } catch(e) { - hash = escapeCharacters(toggle.hash); - } - - // If the hash is empty, scroll to the top of the page - if (hash === '#') { - - // Prevent default link behavior - event.preventDefault(); - - // Set the anchored element - anchor = document.body; - - // Save or create the ID as a data attribute and remove it (prevents scroll jump) - var id = anchor.id ? anchor.id : 'smooth-scroll-top'; - anchor.setAttribute('data-scroll-id', id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - // Otherwise, update the hash - if (window.location.hash.substring(1) === id) { - hashChangeHandler(); - } else { - window.location.hash = id; - } - - return; - - } - - // Get the anchored element - anchor = document.querySelector(hash); - - // If anchored element exists, save the ID as a data attribute and remove it (prevents scroll jump) - if (!anchor) return; - anchor.setAttribute('data-scroll-id', anchor.id); - anchor.id = ''; - - // If no hash change event will happen, fire manually - if (toggle.hash === window.location.hash) { - event.preventDefault(); - hashChangeHandler(); - } - - }; - - /** - * On window scroll and resize, only run events at a rate of 15fps for better performance - */ - var resizeThrottler = function (event) { - if (!eventTimeout) { - eventTimeout = setTimeout(function() { - eventTimeout = null; // Reset timeout - headerHeight = getHeaderHeight(fixedHeader); // Get the height of a fixed header if one exists - }, 66); - } - }; - - /** - * Destroy the current initialization. - */ - smoothScroll.destroy = function () { - - // If plugin isn't already initialized, stop - if (!settings) return; - - // Remove event listeners - document.removeEventListener('click', clickHandler, false); - window.removeEventListener('resize', resizeThrottler, false); - - // Cancel any scrolls-in-progress - smoothScroll.cancelScroll(); - - // Reset variables - settings = null; - anchor = null; - toggle = null; - fixedHeader = null; - headerHeight = null; - eventTimeout = null; - animationInterval = null; - }; - - /** - * Initialize Smooth Scroll - * @param {Object} options User settings - */ - smoothScroll.init = function (options) { - - // feature test - if (!supports) return; - - // Destroy any existing initializations - smoothScroll.destroy(); - - // Selectors and variables - settings = extend(defaults, options || {}); // Merge user options with defaults - fixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header - headerHeight = getHeaderHeight(fixedHeader); - - // When a toggle is clicked, run the click handler - document.addEventListener('click', clickHandler, false); - - // Listen for hash changes - window.addEventListener('hashchange', hashChangeHandler, false); - - // If window is resized and there's a fixed header, recalculate its size - if (fixedHeader) { - window.addEventListener('resize', resizeThrottler, false); - } - - }; - - - // - // Initialize plugin - // - - smoothScroll.init(options); - - - // - // Public APIs - // - - return smoothScroll; - - }; - - return SmoothScroll; - -}); \ No newline at end of file diff --git a/src/smooth-scroll.js b/src/smooth-scroll.js new file mode 100755 index 0000000..e444ec8 --- /dev/null +++ b/src/smooth-scroll.js @@ -0,0 +1,3 @@ +import SmoothScroll from './core.js'; + +export default SmoothScroll; \ No newline at end of file diff --git a/src/smooth-scroll.polyfills.js b/src/smooth-scroll.polyfills.js new file mode 100755 index 0000000..da09ab8 --- /dev/null +++ b/src/smooth-scroll.polyfills.js @@ -0,0 +1,6 @@ +import './_closest.polyfill.js'; +import './_customEvent.polyfill.js'; +import './_requestAnimationFrame.polyfill.js'; +import SmoothScroll from './core.js'; + +export default SmoothScroll; \ No newline at end of file