-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from gen-tech/horizontal-scroll
Horizontal scroll
- Loading branch information
Showing
13 changed files
with
582 additions
and
168 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
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,4 +1,6 @@ | ||
export * from "./scroll-buffer.interface"; | ||
export * from "./scroll-direction.enum"; | ||
export * from "./scroll-phase.enum"; | ||
export * from "./scroll-position.interface"; | ||
export * from "./scroll-to-element-options.interface"; | ||
export * from "./scrollable-content.type"; |
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,28 @@ | ||
import { Observable } from "rxjs"; | ||
import { ScrollPosition } from './scroll-position.interface'; | ||
|
||
/** | ||
* Scroll Buffer Object to use in every observer instance | ||
*/ | ||
export interface Buffer { | ||
/** | ||
* Cache for observables of both positions | ||
*/ | ||
both: { | ||
[key: number]: Observable<ScrollPosition>; | ||
}; | ||
|
||
/** | ||
* Cache for observable of x position | ||
*/ | ||
x: { | ||
[key: number]: Observable<number>; | ||
}; | ||
|
||
/** | ||
* Cache for observable of x position | ||
*/ | ||
y: { | ||
[key: number]: Observable<number>; | ||
}; | ||
} |
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,24 +1,23 @@ | ||
/** | ||
* ### Scroll Direction | ||
* ### Vertical Scroll Direction | ||
*/ | ||
export enum ScrollDirection { | ||
/** | ||
* Scrolling up | ||
*/ | ||
UP, | ||
|
||
/** | ||
* Scrolling down | ||
*/ | ||
DOWN, | ||
export enum VerticalScrollDirection { | ||
TOP = 1 << 0, | ||
BOTTOM = 1 << 1 | ||
} | ||
|
||
/** | ||
* Scrolling left | ||
*/ | ||
LEFT, | ||
/** | ||
* ### Horizontal Scroll Direction | ||
*/ | ||
export enum HorizontalScrollDirection { | ||
LEFT = 1 << 2, | ||
RIGHT = 1 << 3 | ||
} | ||
|
||
/** | ||
* Scrolling right | ||
*/ | ||
RIGHT, | ||
} | ||
/** | ||
* ### Scroll Direction | ||
*/ | ||
export const ScrollDirection = { | ||
...VerticalScrollDirection, | ||
...HorizontalScrollDirection | ||
} |
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,31 @@ | ||
/** | ||
* ### Scroll Position | ||
* Represents the scroll positions | ||
*/ | ||
export interface ScrollPosition { | ||
/** | ||
* Top position in pixels | ||
*/ | ||
top: number; | ||
|
||
/** | ||
* Left position in pixels | ||
*/ | ||
left: number; | ||
} | ||
|
||
/** | ||
* ### Remaining Scroll Position | ||
* Represents the remaining scroll positions | ||
*/ | ||
export interface RemainingScrollPosition { | ||
/** | ||
* Bottom position in pixels | ||
*/ | ||
bottom: number; | ||
|
||
/** | ||
* Right position in pixels | ||
*/ | ||
right: number; | ||
} |
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,4 +1,4 @@ | ||
/** | ||
* Scrollable Content | ||
* ### Scrollable Content | ||
*/ | ||
export type ScrollableContent = Document | HTMLElement; |
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
Oops, something went wrong.