Skip to content

Commit

Permalink
update animation
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimondev committed Apr 5, 2024
1 parent 3090ed6 commit 463863c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
12 changes: 2 additions & 10 deletions src/components/sections-loader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client'

import { motion } from 'framer-motion'
import { LoaderIcon } from 'lucide-react'

import { cn } from '@/lib/utils'
Expand All @@ -21,14 +20,7 @@ export function SectionsLoader() {
<LoaderIcon size={18} className='animate-spin' />
)
return (
<motion.li
className='flex gap-3'
key={id}
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: 20 }}
transition={{ duration: 0.3 }}
>
<li className='flex gap-3 animate-fade-slide' key={id}>
{icon}
<span
className={cn('transition-opacity duration-200', {
Expand All @@ -39,7 +31,7 @@ export function SectionsLoader() {
>
{status === 'completed' ? 'Added' : 'Adding'} {name}...
</span>
</motion.li>
</li>
)
})}
</ul>
Expand Down
7 changes: 6 additions & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ const config: Config = {
'50%': { transform: 'rotate(0eg)' },
'75%': { transform: 'rotate(-5deg)' },
'100%': { transform: 'rotate(0deg)' }
},
'fade-slide': {
'0%': { opacity: '0', transform: 'translateY(20px)' },
'100%': { opacity: '1' }
}
},
animation: {
Expand All @@ -132,7 +136,8 @@ const config: Config = {
'border-width': 'border-width 3s infinite alternate',
'blurred-fade-in': 'blurred-fade-in 0.4s ease-in-out both',
'drop-bounce': 'drop-bounce 1.5s ease-in-out both var(--duration)',
shaking: 'tilt-shaking 0.30s infinite'
shaking: 'tilt-shaking 0.30s infinite',
'fade-slide': 'fade-slide 0.3s forwards'
},
backgroundImage: {
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
Expand Down

0 comments on commit 463863c

Please sign in to comment.