Skip to content

Commit 0a47327

Browse files
authored
Merge pull request #368 from nateplusplus/staging
Version 6 release
2 parents 6dddd96 + 0c486ae commit 0a47327

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3966
-1362
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
{
3434
"devDependencies": [
3535
"stories/**/*",
36-
"**/*.spec.js"
36+
"**/*.spec.js",
37+
"rollup.config.js"
3738
]
3839
}
3940
]

.storybook/preview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import './style.css';
2+
13
export const parameters = {
24
actions: { argTypesRegex: '^on[A-Z].*' },
35
controls: {

.storybook/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.sb-show-main.sb-main-padded {
2+
padding-top: 0;
3+
padding-bottom: 0;
4+
}

build/banner.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/esm/constants.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export declare const PUSH_IN_DEFAULT_BREAKPOINTS: number[];
77
export declare const PUSH_IN_LAYER_INDEX_ATTRIBUTE = "data-pushin-layer-index";
88
export declare const PUSH_IN_DEFAULT_ASPECT_RATIO: number[];
99
export declare const PUSH_IN_DEFAULT_TRANSITION_LENGTH = 200;
10+
export declare const PUSH_IN_DEFAULT_LAYER_DEPTH = 1000;

dist/esm/pushInBase.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
export default abstract class PushInBase {
2-
container: HTMLElement;
3-
options: {
2+
container?: HTMLElement | null;
3+
settings: {
44
[key: string]: any;
55
};
66
/**
77
* Get the value for an option from either HTML markup or the JavaScript API.
88
* Return a string or array of strings.
99
*/
10-
getStringOption(name: string): string | string[];
10+
getStringOption(name: string, container?: HTMLElement | null | undefined): string | string[];
1111
/**
1212
* Get the value for an option from either HTML markup or the JavaScript API.
1313
* Returns a number or array of numbers.
1414
* If nothing found, returns null.
1515
*/
16-
getNumberOption(name: string): number | number[] | null;
16+
getNumberOption(name: string, container?: HTMLElement | null | undefined): number | number[] | null;
1717
/**
1818
* Get the value for an option from either HTML markup or the JavaScript API.
1919
* Returns a boolean or array of booleans.
2020
* If nothing found, returns null.
2121
*/
22-
getBoolOption(name: string): boolean | boolean[] | null;
22+
getBoolOption(name: string, container?: HTMLElement | null | undefined): boolean | boolean[] | null;
2323
getAttributeName(name: string): string;
2424
}

dist/esm/pushInComposition.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export declare class PushInComposition extends PushInBase {
55
scene: PushInScene;
66
options: CompositionOptions;
77
constructor(scene: PushInScene, options: CompositionOptions);
8+
start(): void;
9+
setContainer(): void;
810
/**
911
* Set the aspect ratio based setting.
1012
*/

dist/esm/pushInLayer.d.ts

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import { PushInScene } from './pushInScene';
22
import PushInBase from './pushInBase';
3-
import { LayerOptions, LayerParams } from './types';
3+
import { LayerOptions, LayerSettings, LayerParams } from './types';
44
export declare class PushInLayer extends PushInBase {
55
container: HTMLElement;
66
private index;
77
scene: PushInScene;
8-
options: LayerOptions;
98
params: LayerParams;
109
private originalScale;
1110
private ref;
11+
settings: LayerSettings;
12+
isFirst: boolean;
13+
isLast: boolean;
1214
constructor(container: HTMLElement, index: number, scene: PushInScene, options: LayerOptions);
15+
/**
16+
* Set Accessibility features.
17+
* Ensures layers are tabbable and their role is understood by screenreaders.
18+
*/
19+
private setA11y;
1320
/**
1421
* Get the transitions setting, either from the API or HTML attributes.
1522
*
@@ -63,7 +70,7 @@ export declare class PushInLayer extends PushInBase {
6370
*/
6471
private getElementScaleX;
6572
/**
66-
* Whether or not a layer should currently be zooming.
73+
* Whether or not a layer should currently be animated.
6774
*/
6875
private isActive;
6976
/**
@@ -91,8 +98,23 @@ export declare class PushInLayer extends PushInBase {
9198
* as the user scrolls.
9299
*/
93100
setLayerStyle(): void;
101+
/**
102+
* Check if the layer should be visible.
103+
*
104+
* @returns boolean
105+
*/
106+
isVisible(): boolean;
94107
/**
95108
* Set a css class depending on current opacity.
96109
*/
97110
setLayerVisibility(): void;
111+
/**
112+
* Set tabInpoints for this layer.
113+
*/
114+
getTabInpoints(inpoints: number[]): number[];
115+
/**
116+
* Get the current tabInpoint for a layer,
117+
* depending on window breakpoint.
118+
*/
119+
private getTabInpoint;
98120
}

dist/esm/pushInScene.d.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,34 @@ import { PushInComposition } from './pushInComposition';
22
import { PushInLayer } from './pushInLayer';
33
import { PushIn } from './pushin';
44
import PushInBase from './pushInBase';
5-
import { SceneOptions } from './types';
5+
import { SceneSettings } from './types';
66
export declare class PushInScene extends PushInBase {
77
pushin: PushIn;
88
layers: PushInLayer[];
99
layerDepth: number;
10-
options: SceneOptions;
10+
settings: SceneSettings;
1111
composition?: PushInComposition;
12+
layerCount: number;
1213
constructor(pushin: PushIn);
14+
start(): void;
15+
/**
16+
* If there is not a pushin-scene element, create one.
17+
*/
18+
setContainer(): void;
19+
/**
20+
* Get the AutoStart option if provided.
21+
*
22+
* Choices:
23+
* - scroll (default) Start effect on scroll.
24+
* - screen-bottom Start effect when target element top at viewport bottom.
25+
* - screen-top Start effect when target element top at viewport top.
26+
*/
27+
setAutoStart(): void;
28+
setLayerDepth(): void;
29+
/**
30+
* Setup composition for the scene.
31+
*/
32+
setComposition(): void;
1333
/**
1434
* Set scene class names.
1535
*/
@@ -46,4 +66,15 @@ export declare class PushInScene extends PushInBase {
4666
* @returns {number[]}
4767
*/
4868
getInpoints(): number[];
69+
/**
70+
* Get the mode setting.
71+
*
72+
* @returns string
73+
*/
74+
getMode(): string;
75+
/**
76+
* Update outpoints to match container height
77+
* if using continuous mode and outpoint not specified.
78+
*/
79+
updateOutpoints(): void;
4980
}

dist/esm/pushInStyles.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const pushInStyles = ".pushin {position: relative;}.pushin-scene {display: flex;align-items: center;position: fixed;left: 0;top: 0;width: 100%;height: 100vh;}.pushin-scene--with-target {top: 0;left: auto;height: auto;width: auto;pointer-events: none;overflow: hidden;position: sticky;}.pushin-scene--scroll-target-window {height: 100vh;}.pushin-composition {flex: 0 0 100%;padding-top: 201%;position: relative;}.pushin-layer {display: flex;align-items: center;flex-direction: column;justify-content: center;opacity: 0;pointer-events: none;position: absolute;top: 0;right: 0;bottom: 0;left: 0;}.pushin-layer--visible * {pointer-events: auto;}.pushin-debug {background-color: white;border: 0;border-bottom: 1px;box-shadow: -2px 8px 19px 2px rgba(0, 0, 0, 0.26);padding: 1em;position: fixed;top: 0;width: 100%;-webkit-box-shadow: -2px 8px 19px 2px rgba(0, 0, 0, 0.26);z-index: 10;}@media (min-width: 768px) {.pushin-debug {border: 1px solid black;border-radius: 15px 0 0 15px;border-right: 0;right: 0;top: 50px;width: 250px;}}.pushin-debug__title {font-weight: bold;}";
2+
export default pushInStyles;

0 commit comments

Comments
 (0)