diff --git a/src/components/animation/BlinkingAnimation.tsx b/src/components/animation/BlinkingAnimation.tsx deleted file mode 100644 index 6e35841..0000000 --- a/src/components/animation/BlinkingAnimation.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { useState, useEffect, ReactNode } from 'react' -import { useSpring, animated } from '@react-spring/web' - -type Props = { - children: ReactNode -} - -export default function BlinkingAnimation({ children }: Props) { - const [isBlinking, setIsBlinking] = useState(false) - - const blinkingProps = useSpring({ - from: { opacity: 0.2 }, - to: [{ opacity: 1 }, { opacity: 0.2 }], - loop: true, - config: { duration: 1600, tension: 170, friction: 12 }, - pause: !isBlinking, - }) - - useEffect(() => { - setIsBlinking(true) - }, []) - - return {children} -} diff --git a/src/components/animation/EggHatchingAnimation.tsx b/src/components/animation/EggHatchingAnimation.tsx deleted file mode 100644 index 347a1c7..0000000 --- a/src/components/animation/EggHatchingAnimation.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { useState, useEffect, ReactNode } from 'react' -import { useSpring, animated } from '@react-spring/web' - -type Props = { - children: ReactNode - msInterval?: number -} - -export default function EggHatchingAnimation({ - children, - msInterval = 6400, -}: Props) { - const [hatch, setHatch] = useState(false) - - const hatchingProps = useSpring({ - to: { - transform: hatch ? 'rotate(3deg)' : 'rotate(-3deg)', - }, - from: { - transform: 'rotate(0deg)', - }, - config: { tension: 300, friction: 5 }, - reset: hatch, - onRest: () => setHatch(false), - }) - - useEffect(() => { - const interval = setInterval(() => { - setHatch(true) - }, msInterval) - - return () => clearInterval(interval) - }, [msInterval]) - - return {children} -} diff --git a/src/components/animation/ElasticAnimation.tsx b/src/components/animation/ElasticAnimation.tsx deleted file mode 100644 index d9d5177..0000000 --- a/src/components/animation/ElasticAnimation.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { useState, useEffect, ReactNode } from 'react' -import { useSpring, animated } from '@react-spring/web' - -type Props = { - children: ReactNode - msInterval?: number -} - -export default function ElasticAnimation({ - children, - msInterval = 10000, -}: Props) { - const [trigger, setTrigger] = useState(false) - - const elasticProps = useSpring({ - to: trigger - ? [ - { transform: 'scale(1.5)', config: { tension: 300, friction: 5 } }, - { transform: 'scale(1)', config: { tension: 200, friction: 15 } }, - ] - : { transform: 'scale(1)' }, - from: { transform: 'scale(1)' }, - onRest: () => setTrigger(false), - }) - - useEffect(() => { - const interval = setInterval(() => { - setTrigger(true) - }, msInterval) - - return () => clearInterval(interval) - }, [msInterval]) - - return {children} -} diff --git a/src/components/animation/ExpandAnimation.tsx b/src/components/animation/ExpandAnimation.tsx deleted file mode 100644 index 795313d..0000000 --- a/src/components/animation/ExpandAnimation.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React, { ReactNode } from 'react' -import { useSpring, animated } from '@react-spring/web' - -type Props = { - children: ReactNode -} - -export default function ExpandAnimation({ children }: Props) { - const expandProps = useSpring({ - from: { transform: 'scale(0)' }, - to: [ - { transform: 'scale(1.2)', config: { tension: 500 } }, - { transform: 'scale(1)', config: { tension: 300 } }, - ], - }) - - return {children} -} diff --git a/src/components/animation/FallingAnimation.tsx b/src/components/animation/FallingAnimation.tsx deleted file mode 100644 index 0e9afe5..0000000 --- a/src/components/animation/FallingAnimation.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { ReactNode } from 'react' -import { useSpring, animated } from '@react-spring/web' - -type Props = { - children: ReactNode -} - -export default function FallingAnimation({ children }: Props) { - const fallingProps = useSpring({ - from: { transform: 'translateY(-100vh)' }, - to: { transform: 'translateY(0)' }, - config: { tension: 500, friction: 36 }, - }) - - return {children} -} diff --git a/src/components/animation/HoverFloatingAnimation.tsx b/src/components/animation/HoverFloatingAnimation.tsx deleted file mode 100644 index 7b619ad..0000000 --- a/src/components/animation/HoverFloatingAnimation.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React, { useState } from 'react' -import { useSpring, animated } from '@react-spring/web' - -type HoverProps = { - children: React.ReactNode -} - -export default function HoverFloatingAnimation({ children }: HoverProps) { - const [isHovered, setIsHovered] = useState(false) - - const floatingProps = useSpring({ - transform: isHovered ? 'translateY(-10px)' : 'translateY(0px)', - config: { - tension: 280, - friction: 20, - }, - }) - - return ( - setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} - > - {children} - - ) -} diff --git a/src/components/animation/JumpingAnimation.tsx b/src/components/animation/JumpingAnimation.tsx deleted file mode 100644 index 8a76a0b..0000000 --- a/src/components/animation/JumpingAnimation.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { useState, useEffect, ReactNode } from 'react' -import { useSpring, animated } from '@react-spring/web' - -type Props = { - children: ReactNode - msInterval?: number -} - -export default function JumpingAnimation({ - children, - msInterval = 7200, -}: Props) { - const [jump, setJump] = useState(false) - - const jumpingProps = useSpring({ - to: { - transform: jump ? 'translateY(-4px)' : 'translateY(0px)', - }, - from: { - transform: 'translateY(0px)', - }, - config: { tension: 300, friction: 5 }, - onRest: () => setJump(false), - }) - - useEffect(() => { - const interval = setInterval(() => { - setJump(true) - setTimeout(() => setJump(false), 200) - }, msInterval) - - return () => clearInterval(interval) - }, [msInterval]) - - return {children} -} diff --git a/src/components/animation/PopUpAnimation.tsx b/src/components/animation/PopUpAnimation.tsx deleted file mode 100644 index 3cdd62e..0000000 --- a/src/components/animation/PopUpAnimation.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { ReactNode } from 'react' -import { useSpring, animated } from '@react-spring/web' - -type Props = { - children: ReactNode -} - -export default function PopUpAnimation({ children }: Props) { - const popUpProps = useSpring({ - from: { transform: 'translateY(30vh)' }, - to: async (next) => { - await next({ transform: 'translateY(-1vh)' }) - await next({ transform: 'translateY(0)' }) - }, - config: { tension: 500, friction: 42 }, - }) - - return {children} -} diff --git a/src/components/animation/SlideInAnimation.tsx b/src/components/animation/SlideInAnimation.tsx deleted file mode 100644 index 3f293a6..0000000 --- a/src/components/animation/SlideInAnimation.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React, { ReactNode } from 'react' -import { useSpring, animated } from '@react-spring/web' - -type Props = { - children: ReactNode - direction?: 'left' | 'right' -} - -export default function SlideInAnimation({ - children, - direction = 'left', -}: Props) { - const slideInProps = useSpring({ - from: { - transform: - direction === 'left' ? 'translateX(-100%)' : 'translateX(100%)', - }, - to: { transform: 'translateX(0%)' }, - config: { tension: 170, friction: 20 }, - }) - - return {children} -} diff --git a/src/components/animation/SpinningAnimation.tsx b/src/components/animation/SpinningAnimation.tsx deleted file mode 100644 index c6d340b..0000000 --- a/src/components/animation/SpinningAnimation.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { useSpring, animated } from '@react-spring/web' -import { ReactNode } from 'react' - -type Props = { - children: ReactNode -} - -export default function SpinningAnimation({ children }: Props) { - const spinningProps = useSpring({ - loop: true, - from: { transform: 'scale(1) rotate(0deg)' }, - to: [ - { transform: 'scale(1.5) rotate(360deg)', config: { duration: 500 } }, - { transform: 'scale(1) rotate(720deg)', config: { duration: 500 } }, - ], - }) - - return {children} -}