16 lines
477 B
JavaScript
16 lines
477 B
JavaScript
import { animated, useSpring } from '@react-spring/web';
|
|
|
|
export default function AnimatedPage({ children, className = '' }) {
|
|
const pageStyle = useSpring({
|
|
from: { opacity: 0, transform: 'translate3d(0,10px,0)' },
|
|
to: { opacity: 1, transform: 'translate3d(0,0,0)' },
|
|
config: { tension: 210, friction: 24 },
|
|
});
|
|
|
|
return (
|
|
<animated.div style={pageStyle} className={className}>
|
|
{children}
|
|
</animated.div>
|
|
);
|
|
}
|