Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 43 additions & 62 deletions front-end/src/components/main/AboutUs.jsx
Original file line number Diff line number Diff line change
@@ -1,85 +1,66 @@
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);
};
}, []);

return (
<div ref={fromRefFourElement} className="flex items-center justify-center h-screen relative">
{/* 위쪽과 아래쪽만 보일 div */}
<div className="absolute top-0 left-0 right-0 bottom-0 z-0 flex flex-col">
{/* 위쪽의 선 */}
<div className='w-full'>
<div className="mx-5 border-t-2 border-gray-300 my-2"></div>
</div>

{/* 중앙 컨텐츠 영역 */}
<div className="flex-shrink-0 w-1/2 flex flex-col items-center">
{/* 왼쪽 - Introduce GIF */}
Expand All @@ -96,7 +77,7 @@ export default function AboutUs({ fromRefFourElement }) {

{/* 오른쪽 - About Us 문구 */}
<AnimateContainer_font
className={`absolute top-44 right-0 mt-2 flex flex-col w-full md:w-1/3 lg:w-1/3 xl:w-1/2 z-10 mb-72
className={`absolute top-28 right-0 mt-2 flex flex-col w-full md:w-1/3 lg:w-1/3 xl:w-1/2 z-10 mb-72
${animate ? 'frame-in' : ''
}`}>
<h1 className="text-3xl font-bold mb-4">About Us</h1>
Expand All @@ -107,7 +88,7 @@ export default function AboutUs({ fromRefFourElement }) {
실시간 코딩 배틀의 특별함을 더해 코딩에 흥미를 느껴보세요!
</p>
<p className="text-lg">
개발자들은 여기에서 서로의 실력을 겨루며, 문제 해결 능력을 향상시키고 새로운 아이디어를 찾아갈 수 있습니다.
여기에서 서로의 실력을 겨루며, 문제 해결 능력을 향상시키고 새로운 아이디어를 찾아갈 수 있습니다.
</p>
<p className="text-lg">
함께 성장하고 발전하는 코딩 커뮤니티, 코드 아레나!
Expand Down
66 changes: 31 additions & 35 deletions front-end/src/components/main/LogoHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}, []);

Expand All @@ -79,7 +75,7 @@ export default function LogoHome({ scrollToFourElement }) {
/>
<br />
<br />
<h1 className="text-2xl font-bold text-gray-400 mb-40">지금 배틀에 참여하세요!</h1>
<h1 className="text-xl font-bold text-gray-400 pb-40">지금 배틀에 참여하세요!</h1>
</AnimateContainer>
);
}
26 changes: 10 additions & 16 deletions front-end/src/components/main/Policy.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
import React from 'react';
import 'tailwindcss/tailwind.css';

import ssafy from '../../images/main/Policy/ssafy.png';

const ImageAndText = ({ image, title, children }) => (
<div className="w-full text-start mb-6 flex items-center">
<img src={image} alt={title} className="w-1/4 object-cover ml-5 mr-3" />
<div>
<h1 className="text-md ml-4 font-bold">{title}</h1>
</div>
<div className="flex mt-3">{children}</div>
export default function Policy() {
const ImageAndText = ({ image, title }) => (
<div className="w-full text-start pb-5 flex items-end">
<img src={image} alt={title} className="w-1/2 object-center object-cover pl-5 pr-2" />
<div className='w-full flex-col items-center'>
<p className="font-bold text-lg">삼성 전자 한마음프라자</p>
<p className="text-sm">경북 구미시 3공단3로 302 (임수동)</p>
<h1 className="text-md text-gray-400">{title}</h1>
</div>
</div>
);

export default function Policy() {
return (
<div className="flex items-center">
<div className="ml-6">
<p className="text-lg">
삼성전자한마음프라자
</p>
<p className="text-lg">
경북 구미시 3공단3로 302 (임수동)
</p>
<div className="pl-6">
<ImageAndText image={ssafy} title="약관 | 개인정보 처리방침 | 오픈 소스 | 업데이트 노트"></ImageAndText>
</div>
</div>
Expand Down
Loading