Skip to content

Commit

Permalink
Merge pull request #118 from nateplusplus/next-release
Browse files Browse the repository at this point in the history
Next release
  • Loading branch information
nateplusplus authored May 10, 2022
2 parents e71c72e + 31e7689 commit afd1f6d
Show file tree
Hide file tree
Showing 43 changed files with 1,772 additions and 1,703 deletions.
1 change: 1 addition & 0 deletions dist/esm/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export declare const PUSH_IN_BREAKPOINTS_DATA_ATTRIBUTE = "pushinBreakpoints";
export declare const PUSH_IN_SPEED_DATA_ATTRIBUTE = "pushinSpeed";
export declare const PUSH_IN_TO_DATA_ATTRIBUTE = "pushinTo";
export declare const PUSH_IN_FROM_DATA_ATTRIBUTE = "pushinFrom";
export declare const PUSH_IN_DEFAULT_BREAKPOINTS: number[];
68 changes: 68 additions & 0 deletions dist/esm/pushInLayer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { PushInScene } from './pushInScene';
import { LayerOptions } from './types';
export declare class PushInLayer {
private element;
private index;
private scene;
private options;
private originalScale;
private ref;
private params;
constructor(element: HTMLElement, index: number, scene: PushInScene, options: LayerOptions | null);
/**
* Get all inpoints for the layer.
*/
private getInpoints;
/**
* Get all outpoints for the layer.
*/
private getOutpoints;
/**
* Get the push-in speed for the layer.
*/
private getSpeed;
/**
* Set the z-index of each layer so they overlap correctly.
*/
setZIndex(total: number): void;
/**
* Reset all the layer parameters.
*
* This is used if the window is resized
* and things need to be recalculated.
*/
resetLayerParams(): void;
/**
* Get the initial scale of the element at time of DOM load.
*/
private getElementScaleX;
/**
* Whether or not a layer should currently be zooming.
*/
private isActive;
/**
* Get the current inpoint for a layer,
* depending on window breakpoint.
*/
private getInpoint;
/**
* Get the current outpoint for a layer,
* depending on window breakpoint.
*/
private getOutpoint;
/**
* Get the scaleX value for the layer.
*/
private getScaleValue;
/**
* Set element scale.
*/
private setScale;
/**
* Set CSS styles to control the effect on each layer.
*
* This will control the scale and opacity of the layer
* as the user scrolls.
*/
setLayerStyle(): void;
}
27 changes: 27 additions & 0 deletions dist/esm/pushInScene.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { PushInLayer } from './pushInLayer';
import { PushIn } from './pushin';
import { SceneOptions } from './types';
export declare class PushInScene {
pushin: PushIn;
private container;
layers: PushInLayer[];
speedDelta: number;
transitionLength: number;
layerDepth: number;
options: SceneOptions;
constructor(pushin: PushIn);
/**
* Set breakpoints for responsive design settings.
*/
private setBreakpoints;
/**
* Find all layers on the page and store them with their parameters
*/
private getLayers;
/**
* Get the array index of the current window breakpoint.
*/
getBreakpointIndex(breakpoints: number[]): number;
getTop(): number;
getInpoints(): number[];
}
90 changes: 5 additions & 85 deletions dist/esm/pushin.d.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
import { PushInOptions } from './types';
import { PushInOptions, SceneOptions } from './types';
/**
* PushIn object
*
* Once new object is created, it will initialize itself and
* bind events to begin interacting with dom.
*/
export declare class PushIn {
private container;
container: HTMLElement;
private scene;
private pushinDebug?;
private layerOptions;
private sceneOptions;
private scrollY;
private scrollEnd;
private touchStart;
private pageHeight;
sceneOptions: SceneOptions;
scrollY: number;
private readonly layers;
private readonly debug;
private speedDelta;
private transitionLength;
private layerDepth;
private lastAnimationFrameId;
private readonly cleanupFns;
cleanupFns: VoidFunction[];
constructor(container: HTMLElement, options?: PushInOptions);
/**
* Initialize the object to start everything up.
Expand All @@ -38,54 +31,10 @@ export declare class PushIn {
* Otherwise default to 0.
*/
private getScrollY;
/**
* Get the "scene" element from the DOM.
* If it doesn't exist, make one.
*/
private addScene;
/**
* Set breakpoints for responsive design settings.
*/
private setBreakpoints;
/**
* Find all layers on the page and store them with their parameters
*/
private getLayers;
/**
* Get all inpoints for the layer.
*/
private getInpoints;
/**
* Get all outpoints for the layer.
*/
private getOutpoints;
/**
* Get the push-in speed for the layer.
*/
private getSpeed;
/**
* Get the array index of the current window breakpoint.
*/
private getBreakpointIndex;
/**
* Set the z-index of each layer so they overlap correctly.
*/
private setZIndex;
/**
* Bind event listeners to watch for page load and user interaction.
*/
bindEvents(): void;
/**
* Reset all the layer parameters.
*
* This is used if the window is resized
* and things need to be recalculated.
*/
private resetLayerParams;
/**
* Get the initial scale of the element at time of DOM load.
*/
private getElementScaleX;
/**
* Animation effect, mimicking a camera dolly on the webpage.
*/
Expand All @@ -94,35 +43,6 @@ export declare class PushIn {
* Show or hide layers and set their scale, depending on if active.
*/
private toggleLayers;
/**
* Whether or not a layer should currently be zooming.
*/
private isActive;
/**
* Get the current inpoint for a layer,
* depending on window breakpoint.
*/
private getInpoint;
/**
* Get the current outpoint for a layer,
* depending on window breakpoint.
*/
private getOutpoint;
/**
* Get the scaleX value for the layer.
*/
private getScaleValue;
/**
* Set element scale.
*/
private setScale;
/**
* Set CSS styles to control the effect on each layer.
*
* This will control the scale and opacity of the layer
* as the user scrolls.
*/
private setLayerStyle;
/**
* Set the default container height based on a few factors:
* 1. Number of layers present
Expand Down
Loading

0 comments on commit afd1f6d

Please sign in to comment.