diff --git a/src/components/.gitkeep b/src/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/components/GameHeader.tsx b/src/components/GameHeader.tsx new file mode 100644 index 00000000..59a869a9 --- /dev/null +++ b/src/components/GameHeader.tsx @@ -0,0 +1,39 @@ +import React, { useState } from 'react'; +import styles from '@styles/components/gameHeader.module.scss'; + +const GameHeader = ({ started, title, timer }: GameHeaderProps) => { + const [isStart, setIsStart] = useState(started); + + if (!isStart) { + return ( +
+

+ {title} +

+ +
+ ); + } + + return ( +
+ 남은시간 : {timer}초 +

{title}

+

+
+ ); +}; + +export default GameHeader; + +type GameHeaderProps = { + started: boolean; + title: string; + timer?: number; +}; diff --git a/src/components/GhostItem.tsx b/src/components/GhostItem.tsx new file mode 100644 index 00000000..32ef560c --- /dev/null +++ b/src/components/GhostItem.tsx @@ -0,0 +1,16 @@ +import React from 'react'; +import { Ghost } from '../pages/game/Vote'; +import styles from '@styles/components/ghostItem.module.scss'; + +const GhostItem = ({ ghost }: { ghost: Ghost }) => { + return ( +
  • +
    + {`${ghost.name}님의 +
    +
    {ghost.name}
    +
  • + ); +}; + +export default GhostItem; diff --git a/src/components/GhostList.tsx b/src/components/GhostList.tsx new file mode 100644 index 00000000..fd41d73f --- /dev/null +++ b/src/components/GhostList.tsx @@ -0,0 +1,16 @@ +import React from 'react'; +import { Ghost } from '../pages/game/Vote'; +import GhostItem from './GhostItem'; +import styles from '@styles/components/ghostList.module.scss'; + +const GhostList = ({ ghosts }: { ghosts: Ghost[] }) => { + return ( + + ); +}; + +export default GhostList; diff --git a/src/pages/game/Vote.tsx b/src/pages/game/Vote.tsx index e46d99f0..675f52af 100644 --- a/src/pages/game/Vote.tsx +++ b/src/pages/game/Vote.tsx @@ -1,7 +1,88 @@ import React from 'react'; +import GameHeader from '../../components/GameHeader'; +import styles from '@styles/pages/vote.module.scss'; +import GhostList from '../../components/GhostList'; const Vote = () => { - return
    Vote
    ; + return ( +
    + + +
    + +
    +
    + ); }; export default Vote; + +export type Ghost = { + id: string; + name: string; + picture: string; +}; + +// 더미 데이터 +const ghosts: Ghost[] = [ + { + id: 'user1', + name: '첫 번째 유령', + picture: + 'https://i.pinimg.com/564x/a7/99/96/a79996fd63dbb958d65384bbf49a59df.jpg', + }, + { + id: 'user2', + name: '두 번째 유령', + picture: + 'https://gravatar.com/avatar/d94869409b4e94903723612a4f93a6f9?s=200&d=retro', + }, + { + id: 'user3', + name: '세 번째 유령', + picture: + 'https://gravatar.com/avatar/c274467c5ef4fe381b154a20c5e7ce26?s=200&d=retro', + }, + { + id: 'user4', + name: '네 번째 유령', + picture: + 'https://gravatar.com/avatar/d94869409b4e94903723612a4f93a6f9?s=200&d=retro', + }, + { + id: 'user5', + name: '다섯 번째 유령', + picture: + 'https://gravatar.com/avatar/c274467c5ef4fe381b154a20c5e7ce26?s=200&d=retro', + }, + { + id: 'user6', + name: '여섯 번째 유령', + picture: + 'https://gravatar.com/avatar/d94869409b4e94903723612a4f93a6f9?s=200&d=retro', + }, + { + id: 'user7', + name: '일곱 번째 유령', + picture: + 'https://gravatar.com/avatar/c274467c5ef4fe381b154a20c5e7ce26?s=200&d=retro', + }, + { + id: 'user8', + name: '여덟 번째 유령', + picture: + 'https://gravatar.com/avatar/d94869409b4e94903723612a4f93a6f9?s=200&d=retro', + }, + { + id: 'user9', + name: '아홉 번째 유령', + picture: + 'https://gravatar.com/avatar/c274467c5ef4fe381b154a20c5e7ce26?s=200&d=retro', + }, + { + id: 'user10', + name: '열 번째 유령', + picture: + 'https://gravatar.com/avatar/d94869409b4e94903723612a4f93a6f9?s=200&d=retro', + }, +]; diff --git a/src/styles/abstracts/_variables.scss b/src/styles/abstracts/_variables.scss index 5af7c027..75426054 100644 --- a/src/styles/abstracts/_variables.scss +++ b/src/styles/abstracts/_variables.scss @@ -1,3 +1,9 @@ +//font family +@import url(//fonts.googleapis.com/earlyaccess/jejuhallasan.css); +@import url('https://rsms.me/inter/inter.css'); +$font-logo: 'Jeju Hallasan', cursive; +$font-main: 'Inter', sans-serif; + // Font Size $font-sm: 1rem; $font-base: 1.6rem; @@ -13,10 +19,11 @@ $font-bold900: 900; // Theme & Color $black: #000000; $white: #fff; +$gray: #f5f5f5; $bg-black: $black; $bg-purple: #360e4f; -$bg-purple-20: rgba(#452b66, 0.83); +$bg-purple-80: rgba(#452b66, 0.8); $placeholder: rgba($black, 0.2); diff --git a/src/styles/components/.gitkeep b/src/styles/components/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/styles/components/gameHeader.module.scss b/src/styles/components/gameHeader.module.scss new file mode 100644 index 00000000..a52d67ed --- /dev/null +++ b/src/styles/components/gameHeader.module.scss @@ -0,0 +1,41 @@ +@use '../abstracts' as *; +@use '../base' as *; + +.header { + @include flex-center-row(); + padding: 1rem; + justify-content: space-between; + background-color: $bg-purple-80; + color: $white; + font-size: $font-base; + font-family: $font-main; + + p { + min-width: 6em; + } + + span { + padding: 1rem; + } + + &__title { + font-weight: $font-bold700; + font-family: $font-logo; + font-size: $font-lg; + } + + &__button { + padding: 1rem; + background-color: transparent; + border: none; + border-radius: 0.3rem; + color: $white; + font-size: $font-base; + cursor: pointer; + + &:hover { + transform: scale(0.95); + background-color: rgba($white, 0.1); + } + } +} diff --git a/src/styles/components/ghostItem.module.scss b/src/styles/components/ghostItem.module.scss new file mode 100644 index 00000000..55d9b571 --- /dev/null +++ b/src/styles/components/ghostItem.module.scss @@ -0,0 +1,42 @@ +@use '../abstracts' as *; +@use '../base' as *; + +.ghost { + @include flex-center-row(); + display: inline-flex; + font-family: $font-main; + padding: 1rem; + width: 40%; + + &__image { + $size: 8rem; + width: $size; + height: $size; + margin-right: 2rem; + + img { + background-color: $gray; + width: 100%; + height: 100%; + object-fit: cover; + border-radius: 50%; + } + } + + &__name { + $size: 10rem; + width: $size; + margin-left: 2rem; + padding: 2rem 3.5rem; + border-radius: 2rem; + background-color: $gray; + font-size: $font-base; + font-weight: $font-normal; + } + + &:hover { + cursor: pointer; + background-color: rgba($white, 0.2); + border-radius: 2rem; + } +} diff --git a/src/styles/components/ghostList.module.scss b/src/styles/components/ghostList.module.scss new file mode 100644 index 00000000..b5d7f6f6 --- /dev/null +++ b/src/styles/components/ghostList.module.scss @@ -0,0 +1,9 @@ +@use '../abstracts' as *; +@use '../base' as *; + +.ghosts { + margin: 0; + padding-top: 4rem; + text-align: center; + max-height: 90%; +} diff --git a/src/styles/pages/vote.module.scss b/src/styles/pages/vote.module.scss new file mode 100644 index 00000000..ed28f07d --- /dev/null +++ b/src/styles/pages/vote.module.scss @@ -0,0 +1,25 @@ +@use '../abstracts' as *; +@use '../base' as *; + +.vote { + background-color: $bg-black; + height: 100vh; + + &__button { + font-size: $font-lg; + width: 100%; + text-align: end; + button { + margin-right: 5rem; + background-color: transparent; + border: none; + color: $white; + + &:hover { + cursor: pointer; + transform: scale(0.95); + text-decoration: underline; + } + } + } +}