fix: improved animations

This commit is contained in:
Juan Di Toro 2023-09-06 22:46:36 +02:00
parent 4259108c7c
commit db75e9c0ed
1 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
// src/components/sign-in-with-lume.tsx // src/components/sign-in-with-lume.tsx
import React from 'react'; import React from 'react';
import { AnimatePresence, motion } from 'framer-motion'; import { AnimatePresence, Variant, motion } from 'framer-motion';
import LumeLogoBg from '@/assets/lume-logo-bg.svg'; import LumeLogoBg from '@/assets/lume-logo-bg.svg';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
@ -41,18 +41,18 @@ const LumeIdentity: React.FC<Props> = ({ onSignIn, onSignOut }) => {
}; };
const variants = { const variants: Record<string, Variant> = {
hidden: { y: 50, opacity: 0 }, hidden: { y: 50, opacity: 0, position: 'absolute' },
show: { show: {
y: 0, y: 0,
opacity: 1, opacity: 1,
position: 'relative',
transition: { transition: {
type: "spring", type: "tween",
stiffness: 100, ease: 'easeInOut'
damping: 10 },
}
}, },
exit: { y: -50, opacity: 0 } exit: { y: -50, opacity: 0, position: 'absolute' }
}; };
const SwitchableComponent = () => { const SwitchableComponent = () => {