File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -12,22 +12,22 @@ export function useParallax<T extends HTMLElement>(props: ParallaxProps) {
12
12
useVerifyController ( controller ) ;
13
13
14
14
function _getElementOptions ( ) : CreateElementOptions {
15
- const useSpeedProp = typeof props . speed !== 'undefined' ;
15
+ const shouldUseSpeedProp = typeof props . speed !== 'undefined' ;
16
16
const isHorizontal = controller ?. scrollAxis == 'horizontal' ;
17
17
const isVertical = controller ?. scrollAxis == 'vertical' ;
18
18
19
19
let translateX = props . translateX ;
20
20
let translateY = props . translateY ;
21
21
22
22
// TODO: move to parallax-controller
23
- if ( useSpeedProp && isHorizontal ) {
23
+ if ( shouldUseSpeedProp && isHorizontal ) {
24
24
translateX = [
25
25
`${ ( props . speed || 0 ) * 10 } px` ,
26
26
`${ ( props . speed || 0 ) * - 10 } px` ,
27
27
] ;
28
28
}
29
29
30
- if ( useSpeedProp && isVertical ) {
30
+ if ( shouldUseSpeedProp && isVertical ) {
31
31
translateY = [
32
32
`${ ( props . speed || 0 ) * 10 } px` ,
33
33
`${ ( props . speed || 0 ) * - 10 } px` ,
@@ -115,5 +115,5 @@ export function useParallax<T extends HTMLElement>(props: ParallaxProps) {
115
115
props . targetElement ,
116
116
] ) ;
117
117
118
- return { ref } ;
118
+ return { ref, controller , element } ;
119
119
}
You can’t perform that action at this time.
0 commit comments