File tree Expand file tree Collapse file tree 4 files changed +38
-5
lines changed Expand file tree Collapse file tree 4 files changed +38
-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.8 "
76
+ "parallax-controller" : " 0.1.9 "
77
77
},
78
78
"devDependencies" : {
79
79
"@babel/core" : " ^7.16.0" ,
Original file line number Diff line number Diff line change @@ -29,6 +29,18 @@ export interface ParallaxProps {
29
29
* Second value is the ending translation
30
30
*/
31
31
y ?: string [ ] | number [ ] ;
32
+
33
+ /**
34
+ * Start and end rotation on z-axis in `deg`, `rad`, or `turn`. If no unit is passed `deg` is assumed.
35
+ *
36
+ * Example:
37
+ *
38
+ * rotate={['0deg', '360deg']}
39
+ *
40
+ * First value is the starting rotation
41
+ * Second value is the ending rotation
42
+ */
43
+ rotate ?: string [ ] | number [ ] ;
32
44
/**
33
45
* Optionally pass additional class names to be added to the outermost parallax element.
34
46
*/
@@ -84,6 +96,7 @@ export function Parallax(props: PropsWithChildren<ParallaxProps>) {
84
96
// Defaults set in Parallax.defaultProps
85
97
translateX : props . x ,
86
98
translateY : props . y ,
99
+ rotate : props . rotate ,
87
100
} ,
88
101
} ;
89
102
}
Original file line number Diff line number Diff line change @@ -5,6 +5,26 @@ import { Container } from '../Container';
5
5
import { ScrollContainer } from '../ScrollContainer' ;
6
6
import styles from './Parallax.module.scss' ;
7
7
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
+
8
28
export const WithYOffsets = ( args ) => {
9
29
const a = args . y1 . split ( ',' ) ;
10
30
const b = args . y2 . split ( ',' ) ;
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.8 :
10157
- version "0.1.8 "
10158
- resolved "https://registry.yarnpkg.com/parallax-controller/-/parallax-controller-0.1.8 .tgz#487d3ff24c93cab757c4fd9f90611393d9f83b19 "
10159
- integrity sha512-8pY64e0yMrpB9XQLzNqSdGdlT13PwhZnOwoA54KoK5oFnuAPrAV2/CwhPCKOGVsyuBfW6N1ginXm9p+pX0V86w ==
10156
+ parallax-controller@0.1.9 :
10157
+ version "0.1.9 "
10158
+ resolved "https://registry.yarnpkg.com/parallax-controller/-/parallax-controller-0.1.9 .tgz#3fb47409a3aded7dc067d8ddde530cab5d622562 "
10159
+ integrity sha512-czH4ic3IQIerN7Wt3uPgY0UkZYT0BihQroREQel8rBGK2Jj0mltmS6Dvc5io9T38pg6L5AcLVVbnM5F9mw1LrQ ==
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