Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
clvarley committed Dec 22, 2022
2 parents 679e894 + 8c617ce commit 7e89469
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 8 deletions.
39 changes: 39 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": "eslint:recommended",
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"eqeqeq": [
"error",
"always"
],
"curly": [
"error",
"all"
]
}
}
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
{
"name": "@clvarley/simple-scroll",
"version": "1.0.0",
"version": "1.0.1",
"description": "Simple utility to make scrolling elements into view easier.",
"type": "module",
"keywords": ["scroll", "window", "browser", "DOM"],
"keywords": [
"scroll",
"window",
"browser",
"DOM"
],
"scripts": {
"lint": "eslint ./src"
},
"homepage": "https://github.com/clvarley/simple-scroll#readme",
"main": "src/index.js",
"author": "clvarley",
"license": "MIT"
"license": "MIT",
"devDependencies": {
"eslint": "^8.30.0"
}
}
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { simpleScroll } from './scroll';
import { simpleScroll } from "./scroll";
import {
TIMING_LINEAR,
TIMING_EASE_IN,
TIMING_EASE_OUT,
TIMING_EASE_IN_OUT
} from './timing';
} from "./timing";

simpleScroll.TIMING_LINEAR = TIMING_LINEAR;
simpleScroll.TIMING_EASE_IN = TIMING_EASE_IN;
Expand Down
6 changes: 3 additions & 3 deletions src/scroll.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getDocumentYOffset } from './position';
import { TIMING_EASE_IN_OUT } from './timing';
import { getDocumentYOffset } from "./position";
import { TIMING_EASE_IN_OUT } from "./timing";

/**
* Wrapper to provide `scrollTo` fallback for older browsers
Expand Down Expand Up @@ -67,7 +67,7 @@ const simpleScroll = (target, options) => {
const target_y = getDocumentYOffset(target) - padding;

if (!duration) {
tryScroll({ top: target_y, left: 0, behavior: 'smooth' });
tryScroll({ top: target_y, left: 0, behavior: "smooth" });
} else {
animateScroll(target_y, duration, timing);
}
Expand Down

0 comments on commit 7e89469

Please sign in to comment.