File tree Expand file tree Collapse file tree 4 files changed +45
-5
lines changed Expand file tree Collapse file tree 4 files changed +45
-5
lines changed Original file line number Diff line number Diff line change 73
73
}
74
74
],
75
75
"dependencies" : {
76
- "parallax-controller" : " 0.1.10 "
76
+ "parallax-controller" : " 0.1.11 "
77
77
},
78
78
"devDependencies" : {
79
79
"@babel/core" : " ^7.16.0" ,
Original file line number Diff line number Diff line change @@ -84,6 +84,18 @@ export interface ParallaxProps {
84
84
* Second value is the ending rotation
85
85
*/
86
86
rotateZ ?: string [ ] | number [ ] ;
87
+
88
+ /**
89
+ * Start and end scale on x-axis and y-axis.
90
+ *
91
+ * Example:
92
+ *
93
+ * scale={[0, 1]}
94
+ *
95
+ * First value is the starting scale
96
+ * Second value is the ending scale
97
+ */
98
+ scale ?: number [ ] ;
87
99
/**
88
100
* Optionally pass additional class names to be added to the outermost parallax element.
89
101
*/
@@ -163,6 +175,7 @@ export function Parallax(props: PropsWithChildren<ParallaxProps>) {
163
175
rotateX : props . rotateX ,
164
176
rotateY : props . rotateY ,
165
177
rotateZ : props . rotateZ ,
178
+ scale : props . scale ,
166
179
} ) ,
167
180
} ;
168
181
}
@@ -197,6 +210,7 @@ export function Parallax(props: PropsWithChildren<ParallaxProps>) {
197
210
props . rotateX ,
198
211
props . rotateY ,
199
212
props . rotateZ ,
213
+ props . scale ,
200
214
props . speed ,
201
215
] ) ;
202
216
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { Parallax } from '../../src' ;
3
+ import { Element } from '../Element/Element' ;
4
+ import { Container } from '../Container' ;
5
+ import styles from './Parallax.module.scss' ;
6
+
7
+ const Template = ( args ) => {
8
+ const props = args ;
9
+ return (
10
+ < Container scrollAxis = "vertical" className = { styles . elements } >
11
+ < Parallax { ...props } className = { styles . parallax } >
12
+ < Element name = "A" />
13
+ </ Parallax >
14
+ </ Container >
15
+ ) ;
16
+ } ;
17
+
18
+ export const WithScale = Template . bind ( { } ) ;
19
+ WithScale . args = {
20
+ scale : [ 0 , 1 ] ,
21
+ } ;
22
+
23
+ export default {
24
+ title : '<Parallax> Scale' ,
25
+ component : WithScale ,
26
+ } ;
Original file line number Diff line number Diff line change @@ -10153,10 +10153,10 @@ pako@~1.0.5:
10153
10153
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf"
10154
10154
integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==
10155
10155
10156
- parallax-controller@0.1.10 :
10157
- version "0.1.10 "
10158
- resolved "https://registry.yarnpkg.com/parallax-controller/-/parallax-controller-0.1.10 .tgz#47071d9ac4bd30ae2a0aabfe8b11fde20616ee64 "
10159
- integrity sha512-aV4arXEiKfhbaBtg95t1OHr9fJ+rlhjZUfmbu5BwG1LTVThBQH0ZrTdu1aZVwJv9yUjFThCFuB/vkP9ZquNkzQ ==
10156
+ parallax-controller@0.1.11 :
10157
+ version "0.1.11 "
10158
+ resolved "https://registry.yarnpkg.com/parallax-controller/-/parallax-controller-0.1.11 .tgz#405a48fcb912f4f914567d794b0224f9aca09b45 "
10159
+ integrity sha512-mT6H3A8oz/LctdwSN2sPMqsos1orD9jwkB5m0n5v5XDTYJgOGAA/rypAf2cEZ34J2z4NUIzgd5o07RBUKiA9xA ==
10160
10160
10161
10161
parallel-transform@^1.1.0:
10162
10162
version "1.2.0"
You can’t perform that action at this time.
0 commit comments