File tree Expand file tree Collapse file tree 3 files changed +8
-29
lines changed Expand file tree Collapse file tree 3 files changed +8
-29
lines changed Original file line number Diff line number Diff line change 83
83
}
84
84
],
85
85
"dependencies" : {
86
- "parallax-controller" : " ^1.0.3 "
86
+ "parallax-controller" : " ^1.1.0 "
87
87
},
88
88
"devDependencies" : {
89
89
"@babel/core" : " ^7.16.0" ,
Original file line number Diff line number Diff line change @@ -12,34 +12,13 @@ export function useParallax<T extends HTMLElement>(props: ParallaxProps) {
12
12
useVerifyController ( controller ) ;
13
13
14
14
function _getElementOptions ( ) : CreateElementOptions {
15
- const shouldUseSpeedProp = typeof props . speed !== 'undefined' ;
16
- const isHorizontal = controller ?. scrollAxis == 'horizontal' ;
17
- const isVertical = controller ?. scrollAxis == 'vertical' ;
18
-
19
- let translateX = props . translateX ;
20
- let translateY = props . translateY ;
21
-
22
- // TODO: move to parallax-controller
23
- if ( shouldUseSpeedProp && isHorizontal ) {
24
- translateX = [
25
- `${ ( props . speed || 0 ) * 10 } px` ,
26
- `${ ( props . speed || 0 ) * - 10 } px` ,
27
- ] ;
28
- }
29
-
30
- if ( shouldUseSpeedProp && isVertical ) {
31
- translateY = [
32
- `${ ( props . speed || 0 ) * 10 } px` ,
33
- `${ ( props . speed || 0 ) * - 10 } px` ,
34
- ] ;
35
- }
36
-
37
15
return {
38
16
// @ts -expect-error
39
17
el : ref . current ,
40
18
props : removeUndefinedObjectKeys ( {
41
- translateX,
42
- translateY,
19
+ speed : props . speed ,
20
+ translateX : props . translateX ,
21
+ translateY : props . translateY ,
43
22
disabled : props . disabled ,
44
23
rotate : props . rotate ,
45
24
rotateX : props . rotateX ,
Original file line number Diff line number Diff line change @@ -10913,10 +10913,10 @@ pako@~1.0.5:
10913
10913
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf"
10914
10914
integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==
10915
10915
10916
- parallax-controller@^1.0.3 :
10917
- version "1.0.3 "
10918
- resolved "https://registry.yarnpkg.com/parallax-controller/-/parallax-controller-1.0.3. tgz#db67d90222130f959ad3d110d8a68c65bcd561ca "
10919
- integrity sha512-P9DoUV/vh7Ipt+RNwUdmRyV6gA7eTfYg/7RmQovIsEEYL7uHRUE96KBDJabMZElw3/3TjrC52/m+ZlBF0ZekEw ==
10916
+ parallax-controller@^1.1.0 :
10917
+ version "1.1.0 "
10918
+ resolved "https://registry.yarnpkg.com/parallax-controller/-/parallax-controller-1.1.0. tgz#134114855d45665f73f3b366009846f8f446a105 "
10919
+ integrity sha512-7S9YrlIkIdFqigZpYVIjjRrGhSDBXa+tR++CL5tSjNotGSlJCn2148IeMy6+xIDi1zzjhnTY5ZJwQi/Ie9zYTg ==
10920
10920
dependencies:
10921
10921
bezier-easing "^2.1.0"
10922
10922
You can’t perform that action at this time.
0 commit comments