Skip to content

Commit

Permalink
Merge pull request #1 from yowainwright/version-bump
Browse files Browse the repository at this point in the history
version-bump: code changes
  • Loading branch information
yowainwright committed Mar 27, 2020
2 parents bfb0ccd + bed2c47 commit 7d44e28
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
10
12
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
@@ -1,5 +1,4 @@
# Stickybits owners
# ----
* @someguynamedmatt
* @yowainwright
* @pwfisher
47 changes: 30 additions & 17 deletions README.md
Expand Up @@ -6,21 +6,18 @@
<hr>

<p align="center">
<a href="https://travis-ci.org/dollarshaveclub/scrolldir/">
<img alt="Build Status" src="https://travis-ci.org/dollarshaveclub/scrolldir.svg?branch=master" />
</a>
<a href="https://cdnjs.com/libraries/scrolldir">
<img alt="CDNJS" src="https://img.shields.io/cdnjs/v/scrolldir.svg" />
</a>
<a href="https://greenkeeper.io/">
<img alt="Greenkeeper" src="https://badges.greenkeeper.io/dollarshaveclub/scrolldir.svg" />
<a href="https://unpkg.com/scrolldir@latest/dist/scrolldir.min.js">
<img alt="unpkg" src="https://img.shields.io/badge/unpkg-link-blue.svg">
</a>
<a href="https://snyk.io/test/github/yowainwright/scrolldir">
<img alt="snyk" src="https://snyk.io/test/github/yowainwright/scrolldir/badge.svg" />
</a>
<a href="https://www.npmjs.com/package/scrolldir">
<img alt="npm version" src="https://badge.fury.io/js/scrolldir.svg" />
</a>
<a href="https://github.com/dollarshaveclub/scrolldir">
<img alt="Bower version" src="https://badge.fury.io/bo/scrolldir.svg" />
</a>
<a href="https://twitter.com/home?status=ScrollDir%2C%20a%20micro%20JS%20lib%20that%20describes%20vertical%20scroll%20direction.%20https%3A%2F%2Fgithub.com%2Fdollarshaveclub%2Fscrolldir%20by%20%40pfisher42%20co%20%40yowainwright%20%40DSCEngineering">
<img alt="Share on Twitter" src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social&maxAge=2592000" />
</a>
Expand All @@ -34,9 +31,9 @@ ScrollDir, short for Scroll Direction, is a 0 dependency, ~1kb micro Javascript

### ScrollDir is perfect for:

- showing or hiding sticky elements based on scroll direction 🐥
- only changing its direction attribute when scrolled a significant amount 🔥
- **ignoring small scroll movements** that cause unwanted jitters 😎
- showing or hiding sticky elements based on scroll direction 🐥
- only changing its direction attribute when scrolled a significant amount 🔥
- **ignoring small scroll movements** that cause unwanted jitters 😎

<hr>

Expand All @@ -45,17 +42,21 @@ ScrollDir, short for Scroll Direction, is a 0 dependency, ~1kb micro Javascript
ScrollDir will set the `data-scrolldir` attribute on the `<html>` element to `up` or `down`:

```html
<html data-scrolldir="up">
<html data-scrolldir="up"></html>
```

or

```html
<html data-scrolldir="down">
<html data-scrolldir="down"></html>
```

Now it’s easy to change styles based on the direction the user is scrolling!

```css
[data-scrolldir="down"] .my-fixed-header { display: none; }
[data-scrolldir="down"] .my-fixed-header {
display: none;
}
```

## In Action 🎥
Expand All @@ -71,53 +72,65 @@ Now it’s easy to change styles based on the direction the user is scrolling!
## Install 📦

npm

```sh
npm install scrolldir --save
```

bower

```sh
bower install scrolldir --save
```

yarn

```sh
yarn add scrolldir
```

## Setup 📤

### Easy Mode

Add **dist/scrolldir.auto.min.js** and you’re done. There is nothing more to do! Scrolldir will **just work**.

Now go write some styles using `[data-scrolldir="down"]` and `[data-scrolldir="up"]`.

### Custom Mode 🛠

Add **dist/scrolldir.min.js**. You have access to the API options below and must invoke scrollDir.

```javascript
scrollDir();
```

To use an attribute besides `data-scrolldir`:

```javascript
scrollDir({ attribute: 'new-attribute-name' });
scrollDir({ attribute: "new-attribute-name" });
```

To add the Scrolldir attribute to a different element:

```javascript
scrollDir({ el: 'your-new-selector' });
scrollDir({ el: "your-new-selector" });
```

To turn Scrolldir off:

```javascript
scrollDir({ off: true });
```

To turn provide a different scroll direction on page load (or app start):

```javascript
scrollDir({ dir: 'up' }); // the default is 'down'
scrollDir({ dir: "up" }); // the default is 'down'
```

To change the `thresholdPixels`—the number of pixels to scroll before re-evaluating the direction:

```javascript
scrollDir({ thresholdPixels: someNumber }); // the default is 64 pixels
// example: scrollDir({ thresholdPixels: 10 })
Expand Down
8 changes: 4 additions & 4 deletions dist/scrolldir.auto.js
@@ -1,14 +1,14 @@
/**
scrolldir - Vertical scroll direction in CSS
@version v1.5.0
@link https://github.com/dollarshaveclub/scrolldir.git
@version v1.5.1
@link https://github.com/yowainwright/scrolldir.git
@author Patrick Fisher <patrick@pwfisher.com>
@license MIT
**/
(function (factory) {
typeof define === 'function' && define.amd ? define(factory) :
factory();
}(function () { 'use strict';
}((function () { 'use strict';

var attribute = 'data-scrolldir';
var dir = 'down'; // 'up' or 'down'
Expand Down Expand Up @@ -104,4 +104,4 @@

scrollDir();

}));
})));
4 changes: 2 additions & 2 deletions dist/scrolldir.auto.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/scrolldir.es.js
@@ -1,7 +1,7 @@
/**
scrolldir - Vertical scroll direction in CSS
@version v1.5.0
@link https://github.com/dollarshaveclub/scrolldir.git
@version v1.5.1
@link https://github.com/yowainwright/scrolldir.git
@author Patrick Fisher <patrick@pwfisher.com>
@license MIT
**/
Expand Down
8 changes: 4 additions & 4 deletions dist/scrolldir.js
@@ -1,15 +1,15 @@
/**
scrolldir - Vertical scroll direction in CSS
@version v1.5.0
@link https://github.com/dollarshaveclub/scrolldir.git
@version v1.5.1
@link https://github.com/yowainwright/scrolldir.git
@author Patrick Fisher <patrick@pwfisher.com>
@license MIT
**/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.scrollDir = factory());
}(this, function () { 'use strict';
}(this, (function () { 'use strict';

var attribute = 'data-scrolldir';
var dir = 'down'; // 'up' or 'down'
Expand Down Expand Up @@ -105,4 +105,4 @@

return scrollDir;

}));
})));
4 changes: 2 additions & 2 deletions dist/scrolldir.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "scrolldir",
"version": "1.5.0",
"version": "1.5.1",
"description": "Vertical scroll direction in CSS",
"main": "dist/scrolldir.js",
"module": "dist/scrolldir.es.js",
Expand All @@ -15,7 +15,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/dollarshaveclub/scrolldir.git"
"url": "git+https://github.com/yowainwright/scrolldir.git"
},
"keywords": [
"jquery",
Expand All @@ -29,9 +29,9 @@
"author": "Patrick Fisher <patrick@pwfisher.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/dollarshaveclub/scrolldir.git/issues"
"url": "https://github.com/yowainwright/scrolldir.git/issues"
},
"homepage": "https://github.com/dollarshaveclub/scrolldir.git",
"homepage": "https://github.com/yowainwright/scrolldir.git",
"devDependencies": {
"@babel/core": "^7.0.0-beta.46",
"@babel/preset-env": "^7.0.0-beta.46",
Expand Down
5 changes: 0 additions & 5 deletions renovate.json

This file was deleted.

37 changes: 21 additions & 16 deletions yarn.lock
Expand Up @@ -583,15 +583,15 @@
lodash "^4.17.10"
to-fast-properties "^2.0.0"

"@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
"@types/estree@*":
version "0.0.44"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.44.tgz#980cc5a29a3ef3bea6ff1f7d021047d7ea575e21"
integrity sha512-iaIVzr+w2ZJ5HkidlZ3EJM8VTZb2MJLCjw3V+505yVts0gRC4UMvjw0d1HPtGqI/HQC/KdsYtayfzl+AXY2R8g==

"@types/node@^12.0.8":
version "12.0.8"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.8.tgz#551466be11b2adc3f3d47156758f610bd9f6b1d8"
integrity sha512-b8bbUOTwzIY3V5vDTY1fIJ+ePKDUBqt2hC2woVGotdQQhG/2Sh62HOKHrT7ab+VerXAcPyAiTEipPu/FsreUtg==
"@types/node@*":
version "12.12.31"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.31.tgz#d6b4f9645fee17f11319b508fb1001797425da51"
integrity sha512-T+wnJno8uh27G9c+1T+a1/WYCHzLeDqtsGJkoEdSp2X8RTh3oOCZQcUnjAx90CS8cmmADX51O0FI/tu9s0yssg==

abbrev@1:
version "1.1.1"
Expand All @@ -608,11 +608,16 @@ acorn@6.0.4:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.4.tgz#77377e7353b72ec5104550aa2d2097a2fd40b754"
integrity sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==

acorn@^6.0.7, acorn@^6.1.1:
acorn@^6.0.7:
version "6.1.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f"
integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==

acorn@^7.1.0:
version "7.1.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf"
integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==

ajv@^6.10.0, ajv@^6.9.1:
version "6.10.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1"
Expand Down Expand Up @@ -3315,14 +3320,14 @@ rollup-pluginutils@^2.3.0:
estree-walker "^0.5.2"
micromatch "^2.3.11"

rollup@^1.16.0:
version "1.16.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.16.0.tgz#f7fd03f6720a6cb8460ce3e5c0347110fd25b4fc"
integrity sha512-1GttJm/KzNYiaIkw1DHDEoynKoG2woW6y3qCHVSso4BSWnWQ3QoiVa8UgKX6/5CjpFwLt+f0p2pbGn0ALSNp3Q==
rollup@^1.19.4:
version "1.32.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.32.1.tgz#4480e52d9d9e2ae4b46ba0d9ddeaf3163940f9c4"
integrity sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A==
dependencies:
"@types/estree" "0.0.39"
"@types/node" "^12.0.8"
acorn "^6.1.1"
"@types/estree" "*"
"@types/node" "*"
acorn "^7.1.0"

rsvp@^3.3.3:
version "3.6.2"
Expand Down

0 comments on commit 7d44e28

Please sign in to comment.