Skip to content

Commit 68649ac

Browse files
committed
chore: 배경애니메이션 수정
1 parent bf364f0 commit 68649ac

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

src/app/(home)/page.tsx

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import React, { useEffect, useRef, useState } from "react";
4-
import { motion, AnimatePresence } from "framer-motion";
4+
import { motion, AnimatePresence, Variants } from "framer-motion";
55
import Image from "next/image";
66
import Lenis from "@studio-freight/lenis";
77
import { useMediaQuery } from "react-responsive";
@@ -62,14 +62,36 @@ const bounceAnimation = {
6262
},
6363
};
6464

65-
const backgroundVariants = {
65+
const backgroundVariants: Variants = {
6666
initial: {
67-
background: "linear-gradient(135deg, #2B3A67 0%, #1E2B4D 100%)",
67+
backgroundColor: "#1a1f2c",
68+
backgroundImage: "linear-gradient(135deg, #1a1f2c 0%, #111827 100%)",
6869
},
6970
animate: {
70-
background: "linear-gradient(135deg, #2B3A67 0%, #1E2B4D 100%)",
71+
backgroundImage: [
72+
"linear-gradient(135deg, #1a1f2c 0%, #111827 100%)",
73+
"linear-gradient(135deg, #1a1f2c 20%, #4b5563 80%)",
74+
"linear-gradient(135deg, #111827 0%, #374151 100%)",
75+
"linear-gradient(135deg, #1a1f2c 0%, #111827 100%)",
76+
],
77+
backgroundPosition: ["0% 0%", "50% 50%", "100% 100%", "0% 0%"], // 움직임 추가
7178
transition: {
72-
duration: 20,
79+
duration: 10,
80+
ease: "easeInOut",
81+
repeat: Infinity,
82+
repeatType: "reverse" as const,
83+
},
84+
},
85+
wave: {
86+
backgroundImage: [
87+
"linear-gradient(135deg, #1a1f2c 0%, #111827 100%)",
88+
"linear-gradient(135deg, #1a1f2c 50%, #374151 50%)",
89+
"linear-gradient(135deg, #1a1f2c 0%, #111827 100%)",
90+
],
91+
backgroundSize: ["200% 200%", "100% 100%", "200% 200%"], // 크기 변화를 통한 파동 효과
92+
transition: {
93+
duration: 5,
94+
ease: "easeInOut",
7395
repeat: Infinity,
7496
repeatType: "reverse" as const,
7597
},

0 commit comments

Comments
 (0)