Skip to content

Commit

Permalink
💫 add question transition
Browse files Browse the repository at this point in the history
  • Loading branch information
h-campos committed Apr 27, 2023
1 parent 08ef5ef commit 82d181d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/Question/Question.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
//Librairies
import { FC } from 'react'
import { motion } from 'framer-motion'

type QuestionProps = {
question: string
}

export const Question: FC<QuestionProps> = ({ question }) => {
return <h4 className='text-xl mb-2 font-semibold'>{question}</h4>
return (
<motion.h4
initial={{ transform: 'translateY(-20px)', opacity: 0 }}
animate={{ transform: 'translateY(0px)', opacity: 1 }}
exit={{ transform: 'translateY(-20px)', opacity: 0 }}
transition={{ duration: 0.5 }}
className='text-xl mb-2 font-semibold'
>
{question}
</motion.h4>
)
}

0 comments on commit 82d181d

Please sign in to comment.