-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
41 changed files
with
2,454 additions
and
2,095 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
// @flow | ||
import type { DraggingState } from '../../types'; | ||
import type { State, DraggingState } from '../../types'; | ||
|
||
export type AutoScroller = {| | ||
cancel: () => void, | ||
jumpScroll: (state: DraggingState) => void, | ||
fluidScroll: (state: DraggingState) => void, | ||
start: (state: DraggingState) => void, | ||
stop: () => void, | ||
cancelPending: () => void, | ||
scroll: (state: State) => void, | ||
|}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// @flow | ||
|
||
// Values used to control how the fluid auto scroll feels | ||
const config = { | ||
// percentage distance from edge of container: | ||
startFromPercentage: 0.25, | ||
maxScrollAtPercentage: 0.05, | ||
// pixels per frame | ||
maxPixelScroll: 28, | ||
|
||
// A function used to ease a percentage value | ||
// A simple linear function would be: (percentage) => percentage; | ||
// percentage is between 0 and 1 | ||
// result must be between 0 and 1 | ||
ease: (percentage: number): number => Math.pow(percentage, 2), | ||
|
||
durationDampening: { | ||
// ms: how long to dampen the speed of an auto scroll from the start of a drag | ||
stopDampeningAt: 1200, | ||
// ms: when to start accelerating the reduction of duration dampening | ||
accelerateAt: 360, | ||
}, | ||
}; | ||
|
||
export default config; |
1 change: 1 addition & 0 deletions
1
src/state/auto-scroller/fluid-scroller/did-start-in-scrollable-area.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// @flow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.