📚 Documentação inicial do ALETHEIA
- MANUAL-PRODUTO.md: Manual do usuário final - MANUAL-VENDAS.md: Estratégia comercial e vendas - MANUAL-TECNICO.md: Infraestrutura e deploy - README.md: Visão geral do projeto
This commit is contained in:
21
frontend/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs
generated
vendored
Normal file
21
frontend/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { useRef, useContext, useEffect } from 'react';
|
||||
import { MotionConfigContext } from '../context/MotionConfigContext.mjs';
|
||||
import { frame, cancelFrame } from '../frameloop/frame.mjs';
|
||||
|
||||
function useAnimationFrame(callback) {
|
||||
const initialTimestamp = useRef(0);
|
||||
const { isStatic } = useContext(MotionConfigContext);
|
||||
useEffect(() => {
|
||||
if (isStatic)
|
||||
return;
|
||||
const provideTimeSinceStart = ({ timestamp, delta }) => {
|
||||
if (!initialTimestamp.current)
|
||||
initialTimestamp.current = timestamp;
|
||||
callback(timestamp - initialTimestamp.current, delta);
|
||||
};
|
||||
frame.update(provideTimeSinceStart, true);
|
||||
return () => cancelFrame(provideTimeSinceStart);
|
||||
}, [callback]);
|
||||
}
|
||||
|
||||
export { useAnimationFrame };
|
||||
Reference in New Issue
Block a user