ขนาดวิดีโอ: 1280 X 720853 X 480640 X 360
แสดงแผงควบคุมโปรแกรมเล่น
เล่นอัตโนมัติ
เล่นใหม่
Literally, what you did... it made my day
thankyou, it was very helpful
Thanks, Man, Its Really Helpful...
import type { ComponentType } from "react"import { createRef, useEffect, useRef } from "react"import { useScroll, useTransform, useSpring } from "framer-motion"// Scrub through a Lottie animation by scrolling while it is in viewexport function withScrolledProgressInView(Component): ComponentType { return (props: any) => { const ref = useRef(null) const { scrollYProgress } = useScroll({ target: ref, offset: ["end", "start"], layoutEffect: false, // fix required for sticky elements }) const animationSpeed = useSpring(scrollYProgress, { stiffness: 20, damping: 20, //mass: 3.7, }) return ( ) }}// const animationProgress = useTransform(scrollYProgress, {// easing: "easeInOut",// outputRange: [0, 1],// })
so gooood~~~I have a question.Is it possible to control play, pause, stop (reset), gotoAndPlay (frame number), and gotoAndStop (frame number) with a specific button?
yes, you have to add those functions on code override section.
Literally, what you did... it made my day
thankyou, it was very helpful
Thanks, Man, Its Really Helpful...
import type { ComponentType } from "react"
import { createRef, useEffect, useRef } from "react"
import { useScroll, useTransform, useSpring } from "framer-motion"
// Scrub through a Lottie animation by scrolling while it is in view
export function withScrolledProgressInView(Component): ComponentType {
return (props: any) => {
const ref = useRef(null)
const { scrollYProgress } = useScroll({
target: ref,
offset: ["end", "start"],
layoutEffect: false, // fix required for sticky elements
})
const animationSpeed = useSpring(scrollYProgress, {
stiffness: 20,
damping: 20,
//mass: 3.7,
})
return (
)
}
}
// const animationProgress = useTransform(scrollYProgress, {
// easing: "easeInOut",
// outputRange: [0, 1],
// })
so gooood~~~
I have a question.
Is it possible to control play, pause, stop (reset), gotoAndPlay (frame number), and gotoAndStop (frame number) with a specific button?
yes, you have to add those functions on code override section.