diff --git a/front-end/src/components/main/AboutUs.jsx b/front-end/src/components/main/AboutUs.jsx index 6de77ed1..5e811aa6 100644 --- a/front-end/src/components/main/AboutUs.jsx +++ b/front-end/src/components/main/AboutUs.jsx @@ -1,71 +1,58 @@ import React, { useState, useEffect } from 'react'; import styled, { keyframes } from 'styled-components'; import 'tailwindcss/tailwind.css'; - import Introduce from '../../images/main/AboutUs/Introduce.gif'; import We from '../../images/main/AboutUs/We.gif'; -const frameInAnimation_gif = keyframes` - 0% { - opacity: 0; - transform: translateX(-100%); - } - - 100%{ - opacity: 1; - transform: translateX(0%); - } -`; - -const AnimateContainer_gif = styled.div` - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - - &.frame-in { - animation: ${frameInAnimation_gif} 1s forwards; - } -`; - -const frameInAnimation_font = keyframes` - 0% { - opacity: 0; - transform: translateX(100%); - } - - 100%{ - opacity: 1; - transform: translateX(0%); - } -`; - -const AnimateContainer_font = styled.div` - display: flex; - - - &.frame-in { - animation: ${frameInAnimation_font} 1s forwards; - } -`; - export default function AboutUs({ fromRefFourElement }) { - const [animate, setAnimate] = useState(false); + const [animate, setAnimate] = useState(false); // 애니메이트 상태 관리 + + const frameInAnimation_gif = keyframes` + 0% { + opacity: 0; + transform: translateX(-100%); + } + 100%{ + opacity: 1; + transform: translateX(0%); + } + `; + + const AnimateContainer_gif = styled.div` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + &.frame-in { + animation: ${frameInAnimation_gif} 1s forwards; + } + `; + + const frameInAnimation_font = keyframes` + 0% { + opacity: 0; + transform: translateX(100%); + } + 100%{ + opacity: 1; + transform: translateX(0%); + } + `; + + const AnimateContainer_font = styled.div` + display: flex; + &.frame-in { + animation: ${frameInAnimation_font} 1s forwards; + } + `; useEffect(() => { const handleScroll = () => { - // 특정 조건을 확인하여 animate 상태 토글 - const shouldAnimate = window.scrollY > 1500; + const shouldAnimate = window.scrollY > 1500; // 특정 조건을 확인하여 animate 상태 토글 setAnimate(shouldAnimate); }; - - // 스크롤 이벤트 리스너 등록 window.addEventListener('scroll', handleScroll); - - // 컴포넌트가 마운트될 때 애니메이션을 트리거 setAnimate(true); - - // 클린업 함수에서 이벤트 리스너 제거 return () => { window.removeEventListener('scroll', handleScroll); }; @@ -73,13 +60,7 @@ export default function AboutUs({ fromRefFourElement }) { return (
- 개발자들은 여기에서 서로의 실력을 겨루며, 문제 해결 능력을 향상시키고 새로운 아이디어를 찾아갈 수 있습니다. + 여기에서 서로의 실력을 겨루며, 문제 해결 능력을 향상시키고 새로운 아이디어를 찾아갈 수 있습니다.
함께 성장하고 발전하는 코딩 커뮤니티, 코드 아레나!
diff --git a/front-end/src/components/main/LogoHome.jsx b/front-end/src/components/main/LogoHome.jsx
index d20d7146..785f4c6b 100644
--- a/front-end/src/components/main/LogoHome.jsx
+++ b/front-end/src/components/main/LogoHome.jsx
@@ -4,38 +4,38 @@ import 'tailwindcss/tailwind.css';
import Logo from '../../images/main/LogoHome/Logo.png';
import '../css/BlinkingElement.css';
-// 최초 렌더링 시에 대표 로고 나타나는 애니메이트
-const initialFadeInAnimation = keyframes`
- 0% {
- opacity: 0;
- }
+export default function LogoHome({ scrollToFourElement }) {
+ const [animate, setAnimate] = useState(false); // 스크롤 애니메이트 상태 관리
- 100% {
- opacity: 1;
- }
-`;
+ // 최초 렌더링 시에 대표 로고 나타나는 애니메이트
+ const initialFadeInAnimation = keyframes`
+ 0% {
+ opacity: 0;
+ }
-// 로고 스크롤 애니메이트 이벤트
-const frameInAnimation = keyframes`
- 0% {
- opacity: 0;
- transform: translateY(1%);
- }
+ 100% {
+ opacity: 1;
+ }
+ `;
- 100%{
- opacity: 1;
- transform: translateY(0%);
- }
-`;
+ // 로고 스크롤 애니메이트 이벤트
+ const frameInAnimation = keyframes`
+ 0% {
+ opacity: 0;
+ transform: translateY(1%);
+ }
-const AnimateContainer = styled.div`
- &.frame-in {
- animation: ${frameInAnimation} 1.3s forwards;
- }
-`;
+ 100%{
+ opacity: 1;
+ transform: translateY(0%);
+ }
+ `;
-export default function LogoHome({ scrollToFourElement }) {
- const [animate, setAnimate] = useState(false);
+ const AnimateContainer = styled.div`
+ &.frame-in {
+ animation: ${frameInAnimation} 1.3s forwards;
+ }
+ `;
const handleLogoClick = () => {
if (scrollToFourElement) {
@@ -45,23 +45,19 @@ export default function LogoHome({ scrollToFourElement }) {
useEffect(() => {
const handleScroll = () => {
- console.log('Scroll event 발생');
- // 특정 조건을 확인하여 animate 상태 토글
const shouldAnimate = window.scrollY < 700;
setAnimate(shouldAnimate);
};
- // 스크롤 이벤트 리스너 등록
- window.addEventListener('scroll', handleScroll);
+ window.addEventListener('scroll', handleScroll); // 스크롤 이벤트 리스너 등록
- // 클린업 함수에서 이벤트 리스너 제거
return () => {
- window.removeEventListener('scroll', handleScroll);
+ window.removeEventListener('scroll', handleScroll); // 클린업 함수에서 이벤트 리스너 제거
};
}, []);
+ // 최초 렌더링 시 initial fade-in 애니메이션 적용
useEffect(() => {
- // 최초 렌더링 시 initial fade-in 애니메이션 적용
setAnimate(true);
}, []);
@@ -79,7 +75,7 @@ export default function LogoHome({ scrollToFourElement }) {
/>
-
삼성 전자 한마음프라자
+경북 구미시 3공단3로 302 (임수동)
+- 삼성전자한마음프라자 -
-- 경북 구미시 3공단3로 302 (임수동) -
+{question.title}
{question.content}
#{problem.problemId}
+#{problem.problemId}
{problem.problemTitle}