@applicaster/quick-brick-core
Version:
Core package for Applicaster's Quick Brick App
32 lines (25 loc) • 576 B
text/typescript
const MINIMUM_THRESHOLD = 100;
export class SnapPoints {
windowHeight: number;
contentHeight: number;
constructor(windowHeight, contentHeight) {
this.windowHeight = windowHeight;
this.contentHeight = contentHeight;
}
get values() {
return [
this.windowHeight - this.contentHeight,
Math.max(this.windowHeight - this.contentHeight / 2, MINIMUM_THRESHOLD),
this.windowHeight,
];
}
get top() {
return this.values[0];
}
get bottom() {
return this.values[2];
}
get threshold() {
return this.values[1];
}
}