-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEAT] 홈페이지 퍼블리싱
- Loading branch information
Showing
17 changed files
with
223 additions
and
49 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Wrapper = styled.div` | ||
width: 90%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: flex-start; | ||
gap: 3rem; | ||
padding: 3rem; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import TabBar from "@components/common/tabBar/TabBar"; | ||
import HomeHeader from "./homeHeader/HomeHeader"; | ||
import * as S from "./Home.styled"; | ||
import HomeStatus from "./homeStatus/HomeStatus"; | ||
import HomeRecentTales from "./homeRecentTales/HomeRecentTales"; | ||
|
||
const Home = () => { | ||
return ( | ||
<> | ||
<S.Wrapper> | ||
<HomeHeader /> | ||
<HomeStatus /> | ||
<HomeRecentTales /> | ||
</S.Wrapper> | ||
<TabBar /> | ||
</> | ||
); | ||
}; | ||
|
||
export default Home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Img = styled.img` | ||
width: 20%; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as S from "./HomeHeader.styled"; | ||
|
||
const HomeHeader = () => { | ||
return <S.Img src="/fullLogo.png" />; | ||
}; | ||
|
||
export default HomeHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { CardProps } from "@type/createTale"; | ||
import styled from "styled-components"; | ||
|
||
export const Card = styled.div<CardProps>` | ||
width: 200px; | ||
height: ${({ height }) => height}; /* Height is dynamic */ | ||
background: linear-gradient( | ||
to right, | ||
${({ backgroundColor1 }) => backgroundColor1} 10%, | ||
${({ backgroundColor2 }) => backgroundColor2} 10% | ||
); | ||
border-radius: 8px; | ||
margin: 5px; | ||
padding: 3rem; | ||
box-sizing: border-box; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import * as S from "./Card.styled"; | ||
|
||
// 색상 쌍 배열 | ||
const colorPairs = [ | ||
["#B590FF", "#CBB2FF"], | ||
["#609EFF", "#A5C8FF"], | ||
["#FFC300", "#FFE249"], | ||
["#24E47F", "#93F2C0"], | ||
]; | ||
|
||
// 랜덤 색상 쌍 선택 함수 | ||
const getRandomColorPair = () => { | ||
const randomIndex = Math.floor(Math.random() * colorPairs.length); | ||
return colorPairs[randomIndex]; | ||
}; | ||
|
||
const Card = () => { | ||
// 각 카드의 색상 쌍을 독립적으로 선택하기 위해 Card 컴포넌트 내부에서 색상 쌍을 결정 | ||
const renderCard = () => { | ||
return Array.from({ length: 3 }, (_, index) => { | ||
const [backgroundColor1, backgroundColor2] = getRandomColorPair(); | ||
return ( | ||
<S.Card | ||
key={index} | ||
height="230px" | ||
backgroundColor1={backgroundColor1} | ||
backgroundColor2={backgroundColor2} | ||
> | ||
<div>ㅇㅇ</div> | ||
</S.Card> | ||
); | ||
}); | ||
}; | ||
|
||
return <>{renderCard()}</>; | ||
}; | ||
|
||
export default Card; |
7 changes: 7 additions & 0 deletions
7
src/components/home/homeRecentTales/HomeRecentTales.styled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Wrapper = styled.div` | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Card from "./Card"; | ||
import * as S from "./HomeRecentTales.styled"; | ||
|
||
const HomeRecentTales = () => { | ||
return ( | ||
<S.Wrapper> | ||
<Card /> | ||
</S.Wrapper> | ||
); | ||
}; | ||
|
||
export default HomeRecentTales; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Wrapper = styled.div` | ||
width: 100%; | ||
display: flex; | ||
border-radius: 6px; | ||
border: 1px solid #e5e5e2; | ||
`; | ||
|
||
export const StatusWrapper = styled.div` | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 1.5rem; | ||
`; | ||
|
||
export const Status = styled.div` | ||
width: 40%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
gap: 3rem; | ||
padding: 1rem; | ||
`; | ||
|
||
export const TitleWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
`; | ||
|
||
export const StatusTitle = styled.div` | ||
font-size: 2.5rem; | ||
font-weight: 800; | ||
`; | ||
|
||
export const Img = styled.img` | ||
width: 50%; | ||
`; | ||
|
||
export const StateWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
export const State = styled.div` | ||
font-size: 1.8rem; | ||
font-weight: 700; | ||
margin-top: 1rem; | ||
color: #a3a3a3; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as S from "./HomeStatus.styled"; | ||
|
||
const HomeStatus = () => { | ||
let n = 1; | ||
return ( | ||
<S.Wrapper> | ||
<S.StatusWrapper> | ||
<S.Status> | ||
<S.TitleWrapper> | ||
<S.StatusTitle>글로우테일과 함께하는</S.StatusTitle> | ||
<S.StatusTitle>다문화 동화</S.StatusTitle> | ||
</S.TitleWrapper> | ||
<S.StateWrapper> | ||
<S.State>생성한 동화 | {n}개</S.State> | ||
<S.State>학습한 동화 | {n}개</S.State> | ||
<S.State>학습 횟수 | {n}개</S.State> | ||
<S.State> | ||
학습 중인 언어 | {n}, {n} | ||
</S.State> | ||
</S.StateWrapper> | ||
</S.Status> | ||
<S.Img src="/statusImg.png" /> | ||
</S.StatusWrapper> | ||
</S.Wrapper> | ||
); | ||
}; | ||
|
||
export default HomeStatus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,7 @@ | ||
import { getStudiedTales, getUnlearnedTales, getWord } from "@apis/home"; | ||
import TabBar from "@components/common/tabBar/TabBar"; | ||
import Home from "@components/home/Home"; | ||
|
||
const HomePage = () => { | ||
const handleBtn1 = async () => { | ||
try { | ||
const response = getUnlearnedTales(true); | ||
console.log(response); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; | ||
const handleBtn2 = async () => { | ||
try { | ||
const response = getStudiedTales(true); | ||
console.log(response); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; | ||
const handleBtn3 = async () => { | ||
try { | ||
const response = getWord(); | ||
console.log(response); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; | ||
return ( | ||
<> | ||
<div>홈페이지에용</div> | ||
<button onClick={handleBtn1}>미학습 동화조회</button> | ||
<button onClick={handleBtn2}>학습 동화조회</button> | ||
<button onClick={handleBtn3}>키워드 동화조회</button> | ||
<TabBar /> | ||
</> | ||
); | ||
return <Home />; | ||
}; | ||
|
||
export default HomePage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters