Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Home 페이지 퍼블리싱 #128

Merged
merged 12 commits into from
Feb 15, 2025
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { tokens } from '@repo/theme';
import { vars } from '@repo/theme';
import { style } from '@vanilla-extract/css';

export const wrapper = style({
width: '100%',
height: '100%',
border: `0.2rem solid ${tokens.colors.grey50}`,
borderRadius: tokens.radius[16],
border: `0.2rem solid ${vars.colors.grey50}`,
borderRadius: vars.borderRadius[16],
display: 'flex',
flexDirection: 'column',
});
Expand All @@ -14,7 +14,7 @@ export const toolBar = style({
display: 'flex',
justifyContent: 'space-between',
padding: '1.6rem 1.2rem',
borderBottom: `0.2rem solid ${tokens.colors.grey50}`,
borderBottom: `0.2rem solid ${vars.colors.grey50}`,
});

export const saveArea = style({
Expand All @@ -38,7 +38,7 @@ export const textarea = style({
lineHeight: '170%',
letterSpacing: '-0.032rem',
fontWeight: 'medium',
fontSize: `${tokens.typography.fontSize[16]}`,
fontSize: `${vars.typography.fontSize[16]}`,
width: '100%',
resize: 'none',
overflow: 'visible',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { tokens } from '@repo/theme';
import { vars } from '@repo/theme';
import { style } from '@vanilla-extract/css';

export const wrapper = style({
Expand All @@ -8,9 +8,9 @@ export const wrapper = style({
display: 'flex',
flexDirection: 'column',
gap: '0.8rem',
borderRadius: `${tokens.radius[10]}`,
borderRadius: `${vars.borderRadius[10]}`,
':hover': {
backgroundColor: `${tokens.colors.grey25}`,
backgroundColor: `${vars.colors.grey25}`,
},
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { tokens } from '@repo/theme';
import { vars } from '@repo/theme';
import { style } from '@vanilla-extract/css';

export const sidebarWrapper = style({
width: '42.3rem',
height: '100vh',
flexShrink: '0',
backgroundColor: `${tokens.colors.grey0}`,
backgroundColor: `${vars.colors.grey}`,
});

export const closeArea = style({
Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ body {
max-width: 100vw;
overflow-x: hidden;
font-size: 62.5%;

@media (max-width: 1680px) {
font-size: 50%;
}
}

body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
font-family: var(--font-pretendard);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

커스텀 폰트 변수가 정의되어 있는지 확인이 필요합니다.

--font-pretendard 변수가 올바르게 정의되어 있는지 확인해주세요.


🏁 Script executed:

#!/bin/bash
# Description: Check if the font variable is defined

# Search for the font variable definition
rg --type css "font-pretendard"

Length of output: 171


커스텀 폰트 변수 정의 추가 필요

현재 apps/web/src/app/globals.css(라인 27)에서 아래와 같이 변수 --font-pretendard를 사용하고 있습니다.

  font-family: var(--font-pretendard);

검증 스크립트 결과, 동일한 변수가 apps/web/src/app/page.module.cssglobals.css에서 사용되는 것으로 확인되었으나, 해당 변수를 정의하는 코드(예: :root { --font-pretendard: ...; })는 검색되지 않았습니다.

  • 확인 사항:
    • --font-pretendard 변수가 전역 또는 관련 CSS 파일(예: :root 블록 내)에서 올바르게 정의되어 있는지 재검토해 주세요.
    • 만약 정의가 누락되었다면, 적절한 위치에 명시적으로 변수 정의를 추가해주시기 바랍니다.

-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 1.6rem;
Expand Down
212 changes: 212 additions & 0 deletions apps/web/src/app/home/Home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
'use client';

import { MainBreadcrumbItem, NavBar } from '@web/components/common';
import { AccountSidebar } from './_components/AccountSidebar/AccountSidebar';
import { useScroll } from '@web/hooks';
import { ROUTES } from '@web/routes';
import { Breadcrumb } from '@repo/ui/Breadcrumb';
import {
animatedText,
background,
cardContent,
content,
dropdownItem,
image,
cardColumn,
cardRow,
flexColumn,
} from './page.css';
import { Dropdown } from '@repo/ui/Dropdown';
import Image from 'next/image';
import { Icon } from '@repo/ui/Icon';
import { Text } from '@repo/ui/Text';
import { isNil } from '@repo/ui/utils';
import { GradientAnimatedText } from '@repo/ui/GradientAnimatedText';
import CreateImage from '@web/assets/images/createImage.webp';
import { CTACard } from './_components/CTACard/CTACard';
import { PersonalCard } from './_components/PersonalCard/PersonalCard';
import { UploadContentCard } from './_components/UploadContentCard/UploadContentCard';
import { ContentGroupCard } from './_components/ContentGroupCard/ContentGroupCard';
import { Spacing } from '@repo/ui/Spacing';

export default function Home() {
const [scrollRef, isScrolled] = useScroll<HTMLDivElement>({
threshold: 100,
});

const profileImageUrl = '';
return (
<div className={background} ref={scrollRef}>
<NavBar
leftAddon={
<Breadcrumb>
<Breadcrumb.Item>
<MainBreadcrumbItem href={ROUTES.HOME} />
</Breadcrumb.Item>
</Breadcrumb>
}
rightAddon={
<Dropdown>
<Dropdown.Trigger>
{isNil(profileImageUrl) ? (
<div className={image} />
) : (
<Image
className={image}
width={40}
height={40}
src={profileImageUrl}
alt={''}
/>
)}
</Dropdown.Trigger>
<Dropdown.Content align="right">
<Dropdown.Item value="option1" className={dropdownItem}>
<Icon name="clock" size="2.4rem" color="grey400" />
<Text fontSize={18} fontWeight="medium" color="grey1000">
수정하기
</Text>
</Dropdown.Item>
</Dropdown.Content>
</Dropdown>
}
isScrolled={isScrolled}
/>
<div className={content}>
<AccountSidebar />
<div className={cardContent}>
<GradientAnimatedText className={animatedText}>
한 번의 설정으로 끝없이 흘러가는 콘텐츠
</GradientAnimatedText>

<div className={cardColumn}>
<div className={cardRow}>
<div className={flexColumn}>
{/* 주제 생성 카드 */}
<CTACard
text={'자동으로 글을 만들어보세요'}
buttonText={'주제 생성하기'}
onButtonClick={function (): void {
throw new Error('Function not implemented.');
}}
imageSrc={CreateImage}
/>
<Spacing size={16} />
{/* 개인화 설정 카드 */}
<PersonalCard
text={'개인화 설정'}
domain="활동 분야"
tone="CASUAL"
introduction="글을 생성할 때 계정과 관련된 업데이트나 소식을 참고하고
특정 활동 분야에 집중하거나, 특정 말투를 사용하여 글을 만들 수 있어요"
onIconClick={function (): void {
throw new Error('Function not implemented.');
}}
/>
</div>

{/* 업로드 예약 일정 카드 */}
<UploadContentCard
text={'업로드 예약 일정'}
onMoreButtonClick={function (): void {
throw new Error('Function not implemented.');
}}
onItemClick={(id) => {
console.log('클릭한 아이템 id:', id);
}}
items={[
{
id: 1,
createdAt: '2025-01-01T00:00:00.000Z',
updatedAt: '2025-01-01T00:00:00.000Z',
displayOrder: 1,
summary: '오늘 점심 메뉴는 두부김치',
content: '엄청나게 긴 본문',
postImages: [
{
id: 1,
postId: 1,
url: 'https://~',
},
],
status: 'GENERATED',
uploadTime: '2025-01-01T00:00:00.000Z',
},
{
id: 2,
createdAt: '2025-01-01T00:00:00.000Z',
updatedAt: '2025-01-01T00:00:00.000Z',
displayOrder: 2,
summary: '오늘 점심 메뉴는 두부김치2',
content: '엄청나게 긴 본문2',
postImages: [
{
id: 2,
postId: 2,
url: 'https://~',
},
],
status: 'GENERATED',
uploadTime: '2025-01-01T00:00:00.000Z',
},
]}
/>
</div>

{/* 생성된 주제 카드 */}
<ContentGroupCard
text="생성된 주제"
postGroups={[
{
id: 1,
topic: '점심 메뉴 추천',
purpose: 'OPINION',
reference: 'NONE',
newsCategory: 'ENVIRONMENT',
thumbnailImageUrl:
'https://instead-dev.s3.ap-northeast-2.amazonaws.com/post-group/019504d8-92ee-713e-aea0-347ce4d7bebf',
length: 'SHORT',
content: "'이런 메뉴는 어떨까?'와 같은 마무리 멘트",
eof: false,
createdAt: '2025-01-01T00:00:00.000Z',
},
{
id: 2,
topic: '점심 메뉴 추천 2',
purpose: 'HUMOR',
reference: 'NONE',
newsCategory: 'GAME',
thumbnailImageUrl:
'https://instead-dev.s3.ap-northeast-2.amazonaws.com/post-group/019504d8-92ee-713e-aea0-347ce4d7bebf',
length: 'SHORT',
content: "'이런 메뉴는 어떨까?'와 같은 마무리 멘트",
eof: false,
createdAt: '2025-01-01T00:00:00.000Z',
},
{
id: 3,
topic: '점심 메뉴 추천 3',
purpose: 'HUMOR',
reference: 'NONE',
newsCategory: 'GAME',
thumbnailImageUrl:
'https://instead-dev.s3.ap-northeast-2.amazonaws.com/post-group/019504d8-92ee-713e-aea0-347ce4d7bebf',
length: 'SHORT',
content: "'이런 메뉴는 어떨까?'와 같은 마무리 멘트",
eof: false,
createdAt: '2025-01-01T00:00:00.000Z',
},
]}
onItemClick={function (id: number | string): void {
throw new Error('Function not implemented.');
}}
onItemRemove={function (id: number | string): void {
throw new Error('Function not implemented.');
}}
/>
</div>
</div>
</div>
</div>
);
}
44 changes: 44 additions & 0 deletions apps/web/src/app/home/_components/AccountItem/AccountItem.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { vars } from '@repo/theme';
import { style } from '@vanilla-extract/css';

export const wrapper = style({
display: 'flex',
gap: '2rem',
alignItems: 'center',
padding: '1.6rem 1.2rem',
cursor: 'pointer',
':hover': {
marginLeft: '0.8rem',
},
});

export const image = style({
borderRadius: '100%',
width: '6rem',
height: '6rem',
backgroundColor: vars.colors.grey25,
border: `0.1rem solid ${vars.colors.grey200}`,
objectFit: 'cover',
});

export const emptyImage = style({
borderRadius: '100%',
width: '6rem',
height: '6rem',
border: `0.1rem solid ${vars.colors.grey200}`,
backgroundColor: vars.colors.grey25,
flexShrink: 0,
});

export const agentPlanBadge = style({
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
gap: '0.4rem',
});

export const textWrapper = style({
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
});
Loading
Loading