Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into FE,BE/feature/#29-AI-채…
Browse files Browse the repository at this point in the history
…팅-socket-이벤트-작성
  • Loading branch information
HeoJiye committed Nov 16, 2023
2 parents 33c9853 + d789eab commit 1a3e409
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 28 deletions.
Binary file removed frontend/public/bgConch.png
Binary file not shown.
24 changes: 24 additions & 0 deletions frontend/src/components/Background/Background.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
interface BackgroundProps {
children?: React.ReactNode;
type?: "default" | "static" | "dynamic";
}

function Background({children, type = 'default'}:BackgroundProps ) {
return(
<div className="w-screen h-screen flex flex-col justify-center items-center gap-80">
<img
className="absolute w-full h-full object-cover -z-10"
src="/bg.png"
alt="밤 하늘의 배경 이미지"
/>
<img
className="w-285 h-285 animate-shining"
src="/moon.png"
alt="빛나는 마법의 소라 고둥"
/>
{type != "default" && <div className={`absolute w-full h-full bg-black/75 ${type == "dynamic" && "animate-fadeIn"}`} />}
{children}
</div>)
};

export default Background;
1 change: 1 addition & 0 deletions frontend/src/components/Background/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Background';
17 changes: 3 additions & 14 deletions frontend/src/pages/AIChatPage/AIChatPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Icon } from '@iconify/react';

import Background from '@components/Background';
import ChatInput from '@components/ChatInput';
import ChatList from '@components/ChatList/ChatList';
import CustomButton from '@components/CustomButton';
Expand All @@ -11,18 +11,7 @@ interface AIChatPageProps {}

const AIChatPage = ({}: AIChatPageProps) => {
return (
<div className="w-screen h-screen flex flex-col justify-center items-center gap-80">
<img
className="absolute w-full h-full object-cover -z-10"
src="/bg.png"
alt="밤 하늘의 배경 이미지"
/>
<img
className="w-285 h-285 animate-shining relative bottom-130"
src="/moon.png"
alt="빛나는 마법의 소라 고둥"
/>
<div className="absolute w-full h-full bg-black/75 animate-fadeIn" />
<Background type="dynamic">
<Header
rightItems={[
<CustomButton
Expand Down Expand Up @@ -62,7 +51,7 @@ const AIChatPage = ({}: AIChatPageProps) => {
sendMessage(message);
}}
/>
</div>
</Background>
);
};

Expand Down
18 changes: 5 additions & 13 deletions frontend/src/pages/HomePage/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { connect, setMessageEventListener } from '@business/services/socket';
import { useNavigate } from 'react-router-dom';

import Background from '@components/Background';
import CustomButton from '@components/CustomButton';

import { connect, setMessageEventListener } from '@business/services/socket';

const HomePage = () => {
const navigate = useNavigate();

Expand All @@ -19,17 +21,7 @@ const HomePage = () => {
};

return (
<div className="w-screen h-screen flex flex-col justify-center items-center gap-80">
<img
className="absolute w-full h-full object-cover -z-10"
src="/bg.png"
alt="밤 하늘의 배경 이미지"
/>
<img
className="w-285 h-285 animate-shining"
src="/moon.png"
alt="빛나는 마법의 소라 고둥"
/>
<Background>
<div className="flex gap-36 mb-128 z-1">
<CustomButton handleButtonClicked={moveAiChat}>AI에게 타로보기</CustomButton>
<CustomButton
Expand All @@ -39,7 +31,7 @@ const HomePage = () => {
채팅방 개설하기
</CustomButton>
</div>
</div>
</Background>
);
};

Expand Down
4 changes: 3 additions & 1 deletion frontend/src/pages/HumanChatPage/HumanChatPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Background from "@/components/Background";

interface HumanChatPageProps {}

const HumanChatPage = ({}: HumanChatPageProps) => {
return <></>;
return <Background type="dynamic"></Background>;
};

export default HumanChatPage;

0 comments on commit 1a3e409

Please sign in to comment.