diff --git a/package-lock.json b/package-lock.json index caedd79..ab99ef5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-unused-imports": "^4.1.4", - "framer-motion": "^11.11.8", + "framer-motion": "^11.11.9", "husky": "^8.0.0", "postcss": "^8", "prettier": "^3.3.3", @@ -5429,9 +5429,9 @@ } }, "node_modules/framer-motion": { - "version": "11.11.8", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.11.8.tgz", - "integrity": "sha512-mnGQNEoz99GtFXBBPw+Ag5K4FcfP5XrXxrxHz+iE4Lmg7W3sf2gKmGuvfkZCW/yIfcdv5vJd6KiSPETH1Pw68Q==", + "version": "11.11.9", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.11.9.tgz", + "integrity": "sha512-XpdZseuCrZehdHGuW22zZt3SF5g6AHJHJi7JwQIigOznW4Jg1n0oGPMJQheMaKLC+0rp5gxUKMRYI6ytd3q4RQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index bb5678f..a805466 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-unused-imports": "^4.1.4", - "framer-motion": "^11.11.8", + "framer-motion": "^11.11.9", "husky": "^8.0.0", "postcss": "^8", "prettier": "^3.3.3", diff --git a/src/app/(main)/contact/container/Contact1.tsx b/src/app/(main)/contact/container/Contact1.tsx index 2261157..ca9c362 100644 --- a/src/app/(main)/contact/container/Contact1.tsx +++ b/src/app/(main)/contact/container/Contact1.tsx @@ -1,26 +1,39 @@ -import React from 'react' +'use client' +import React from 'react' +import { motion } from 'framer-motion' +import useSequentialAnimation from '@/hooks/useSequencialAnimation' +import useLoadingProgress from '@/hooks/useLoadingProgress' +// +// +// export default function Contact1() { + const { isLoading, loadingProgress } = useLoadingProgress('contact') + const { chainAnimation, coneAnimation, plateAnimation, sphereAnimation } = + useSequentialAnimation(!isLoading && loadingProgress === 100) + return (
- Object1-chain - Object2-cone @@ -31,7 +44,9 @@ export default function Contact1() {
- Object3-plate - { + const chainAnimation = useAnimation() + const coneAnimation = useAnimation() + const plateAnimation = useAnimation() + const sphereAnimation = useAnimation() + + useEffect(() => { + if (!isLoading) { + chainAnimation.start({ + opacity: [0, 1], + y: [-100, 0], + transition: { duration: 3 } + }) + + coneAnimation.start({ + opacity: [0, 1], + y: [50, 0], + transition: { duration: 3, delay: 1 } + }) + + plateAnimation.start({ + opacity: [0, 1], + y: [-50, 0], + transition: { duration: 3, delay: 2 } + }) + + sphereAnimation.start({ + opacity: [0, 1], + y: [-50, 0], + transition: { duration: 3, delay: 3 } + }) + } + }, [isLoading]) + + return { chainAnimation, coneAnimation, plateAnimation, sphereAnimation } +} + +export default useSequentialAnimation diff --git a/tailwind.config.ts b/tailwind.config.ts index f5c4730..2f14401 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,3 +1,4 @@ +import { HEADER, MOBILE_MENU_LIST } from '@/style/zIndex' import type { Config } from 'tailwindcss' const config: Config = { @@ -56,8 +57,16 @@ const config: Config = { '0%': { transform: 'scaleX(1)' }, + '100%': { transform: 'scaleX(0.3)' } + }, + fadeinObject: { + '0%': { + opacity: '0', + transform: 'translateY(50px)' + }, '100%': { - transform: 'scaleX(0.3)' + opacity: '1', + transform: 'translateY(0px)' } } }, @@ -67,11 +76,11 @@ const config: Config = { infiniteSlideOriginal: 'infiniteSlideOriginal 5s linear infinite forwards', scaleLeft: 'scaleLeft 0.5s ease-in', - scaleDownCenter: 'scaleDownCenter 0.5s ease-in forwards' + scaleDownCenter: 'scaleDownCenter 0.5s ease-in forwards', + fadeinObject: 'fadeinObject 5s linear forwards' } } }, - // eslint-disable-next-line @typescript-eslint/no-require-imports plugins: [require('tailwind-scrollbar-hide')] } diff --git a/tsconfig.json b/tsconfig.json index 9087e0c..4f7bd58 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,12 @@ "@/*": ["./src/*"] } }, - "include": ["src/custom.d.ts","next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": [ + "src/custom.d.ts", + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" + ], "exclude": ["node_modules"] }