Skip to content

Commit d1a83ad

Browse files
authored
Update dependencies (#318)
1 parent 09a89b6 commit d1a83ad

File tree

8 files changed

+293
-723
lines changed

8 files changed

+293
-723
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,24 @@
44
name: Build
55

66
on:
7-
push:
8-
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
7+
push:
8+
branches: [master]
9+
pull_request:
10+
branches: [master]
1111

1212
jobs:
13-
build:
13+
build:
14+
runs-on: ubuntu-latest
1415

15-
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node-version: [12.x, 14.x, 16.x]
1619

17-
strategy:
18-
matrix:
19-
node-version: [10.x, 12.x, 14.x]
20-
21-
steps:
22-
- uses: actions/checkout@v2
23-
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v2
25-
with:
26-
node-version: ${{ matrix.node-version }}
27-
- run: yarn
28-
- run: yarn build
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- run: yarn
27+
- run: yarn build

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ yarn.lock
3636

3737
# Config
3838
.babelrc
39+
.github
40+
.whitesource
3941
renovate.json
4042
rollup.config.js
4143
webpack.config.js

.whitesource

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"issueSettings": {
66
"minSeverityLevel": "LOW"
77
}
8-
}
8+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Array.from(buttons).forEach(button => {
8787
```javascript
8888
const buttons = document.querySelectorAll('.js-scroll-to');
8989

90-
[].forEach.call(buttons, function(button) {
91-
button.addEventListener('click', function(event) {
90+
[].forEach.call(buttons, function (button) {
91+
button.addEventListener('click', function (event) {
9292
event.preventDefault();
9393

9494
var href = event.target.getAttribute('href');

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@three11/animate-top-offset",
3-
"version": "0.7.0",
3+
"version": "1.0.0",
44
"description": "Scroll a container to a specific Y offset",
55
"main": "dist/animate-top-offset.min.js",
66
"scripts": {
@@ -42,9 +42,8 @@
4242
"@babel/cli": "7.14.3",
4343
"@babel/core": "7.14.3",
4444
"@babel/preset-env": "7.14.2",
45-
"rollup": "2.48.0",
45+
"rollup": "2.49.0",
4646
"rollup-plugin-babel": "4.4.0",
47-
"rollup-plugin-commonjs": "10.1.0",
48-
"rollup-plugin-uglify": "6.0.4"
47+
"rollup-plugin-terser": "7.0.2"
4948
}
5049
}

rollup.config.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import babel from 'rollup-plugin-babel';
2-
import { uglify } from 'rollup-plugin-uglify';
2+
import { terser } from 'rollup-plugin-terser';
33

44
export default {
55
input: 'src/animate-top-offset.js',
@@ -12,10 +12,8 @@ export default {
1212
babel({
1313
exclude: 'node_modules/**',
1414
babelrc: false,
15-
presets: [
16-
['@babel/env', { 'modules': false }]
17-
]
15+
presets: [['@babel/env', { modules: false }]]
1816
}),
19-
uglify()
17+
terser()
2018
]
2119
};

src/animate-top-offset.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,17 @@ const requestAnimFrame = (() => {
2020
win.requestAnimationFrame ||
2121
win.webkitRequestAnimationFrame ||
2222
win.mozRequestAnimationFrame ||
23-
function(callback) {
23+
function (callback) {
2424
win.setTimeout(callback, 1000 / 60);
2525
}
2626
);
2727
})();
2828

29-
const animateTopOffset = (
30-
offset = 0,
31-
container = win,
32-
speed = 2000,
33-
easing = 'easeOutSine'
34-
) => {
29+
const animateTopOffset = (offset = 0, container = win, speed = 2000, easing = 'easeOutSine') => {
3530
let currentTime = 0;
3631

3732
const scrollY = container.scrollY || document.documentElement.scrollTop;
38-
const time = Math.max(
39-
0.1,
40-
Math.min(Math.abs(scrollY - offset) / speed, 0.8)
41-
);
33+
const time = Math.max(0.1, Math.min(Math.abs(scrollY - offset) / speed, 0.8));
4234

4335
const tick = () => {
4436
currentTime += 1 / 60;

0 commit comments

Comments
 (0)