Skip to content

Commit ba4bac9

Browse files
committed
storybook updates
1 parent 46e433b commit ba4bac9

9 files changed

+22
-36
lines changed

stories/Parallax/0_ParallaxRotation.stories.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import styles from './Parallax.module.scss';
66

77
const Template = (args) => {
88
const props = Object.entries(args).reduce((acc: any, entry: any) => {
9-
console.log(entry);
109
acc[entry[0]] = entry[1].split(',');
1110
return acc;
1211
}, {} as any);
@@ -66,11 +65,11 @@ WithRotationXYZ.args = {
6665

6766
export const WithTranslateYAndRotation = Template.bind({});
6867
WithTranslateYAndRotation.args = {
69-
y: '-100,100',
68+
translateY: '-100,100',
7069
rotate: '0deg,360deg',
7170
};
7271

7372
export default {
74-
title: '<Parallax> Rotation',
73+
title: 'Components / <Parallax> / Rotate Props',
7574
component: WithRotation,
7675
};

stories/Parallax/1_ParallaxVertical.stories.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,6 @@ import { Container } from '../Container';
55
import { ScrollContainer } from '../ScrollContainer';
66
import styles from './Parallax.module.scss';
77

8-
export const WithRotation = (args) => {
9-
const a = args.rotate1.split(',');
10-
const b = args.rotate2.split(',');
11-
return (
12-
<Container scrollAxis="vertical" className={styles.elements}>
13-
<Parallax rotate={a} className={styles.parallax}>
14-
<Element name="1" />
15-
</Parallax>
16-
<Parallax rotate={b} className={styles.parallax}>
17-
<Element name="2" />
18-
</Parallax>
19-
</Container>
20-
);
21-
};
22-
23-
WithRotation.args = {
24-
rotate1: '0deg,360deg',
25-
rotate2: '0deg,-360deg',
26-
};
27-
288
export const WithYOffsets = (args) => {
299
const a = args.y1.split(',');
3010
const b = args.y2.split(',');
@@ -218,6 +198,6 @@ export const InsideADiv = () => {
218198
};
219199

220200
export default {
221-
title: '<Parallax> Vertical Scroll',
201+
title: 'Components / <Parallax> / Vertical Scroll',
222202
component: WithYOffsets,
223203
};

stories/Parallax/2_ParallaxHorizontal.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,6 @@ export const InsideADiv = () => {
172172
};
173173

174174
export default {
175-
title: '<Parallax> Horizontal Scroll',
175+
title: 'Components / <Parallax> / Horizontal Scrolling',
176176
component: WithYOffsets,
177177
};

stories/Parallax/3_ParallaxImages.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ export const WithVaryingYOffsets = () => {
4040
};
4141

4242
export default {
43-
title: '<Parallax> Images',
43+
title: 'Components / <Parallax> / Images',
4444
component: WithVaryingYOffsets,
4545
};

stories/Parallax/4_ParallaxScale.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ WithScaleZ.args = {
4040
};
4141

4242
export default {
43-
title: '<Parallax> Scale',
43+
title: 'Components / <Parallax> / Scale Props',
4444
component: WithScale,
4545
};

stories/Parallax/5_ParallaxOpacity.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ WithOpacity.args = {
2222
};
2323

2424
export default {
25-
title: '<Parallax> Opacity',
25+
title: 'Components / <Parallax> / Opacity Prop',
2626
component: WithOpacity,
2727
};

stories/Parallax/6_ParallaxSpeed.stories.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,17 @@ const Template = (args) => {
2121
);
2222
};
2323

24-
export const WithSpeed = Template.bind({});
25-
WithSpeed.args = {
26-
speed: -1,
24+
export const WithSlowerSpeed = Template.bind({});
25+
WithSlowerSpeed.args = {
26+
speed: -10,
27+
};
28+
29+
export const WithFasterSpeed = Template.bind({});
30+
WithFasterSpeed.args = {
31+
speed: 10,
2732
};
2833

2934
export default {
30-
title: '<Parallax> Speed',
31-
component: WithSpeed,
35+
title: 'Components / <Parallax> / Speed Prop',
36+
component: WithSlowerSpeed,
3237
};

stories/Parallax/7_ParallaxEasing.stories.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React from 'react';
2+
import { ValidEasingPresets } from 'parallax-controller';
23
import { Parallax, ParallaxProvider } from '../../src';
34
import { Element } from '../Element/Element';
45
import styles from './Parallax.module.scss';
56

6-
const options = [
7+
const options: ValidEasingPresets[] = [
8+
// @ts-expect-error
79
'',
810
'ease',
911
'easeIn',
@@ -150,6 +152,6 @@ const Template2 = () => {
150152
export const WithAllEasing = Template2.bind({});
151153

152154
export default {
153-
title: '<Parallax> Easing',
155+
title: 'Components / <Parallax> / Easing Prop',
154156
component: WithEasing,
155157
};

stories/ParallaxBanner/4_ParallaxBanner.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { storiesOf } from '@storybook/react';
44
import { ParallaxBanner, ParallaxProvider } from '../../src';
55
import styles from './ParallaxBanner.module.scss';
66

7-
storiesOf('<ParallaxBanner>', module)
7+
storiesOf('Components / <ParallaxBanner>', module)
88
.add('with a single background', () => (
99
<ParallaxProvider>
1010
<div className="vertical">

0 commit comments

Comments
 (0)