-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
111 additions
and
89 deletions.
There are no files selected for viewing
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
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,14 +1,17 @@ | ||
.todo-form { | ||
display: flex; | ||
gap: 10px; | ||
align-items: center; /* 수직 방향으로 가운데 정렬 */ | ||
justify-content: center; /* 수평 방향으로 가운데 정렬 */ | ||
gap: 0; /* 인풋창과 버튼 사이의 간격을 없앱니다 */ | ||
margin-bottom: 20px; | ||
align-items: center; | ||
} | ||
|
||
.todo-form input { | ||
flex: 1; | ||
flex: 1; /* 입력창이 버튼을 제외한 나머지 영역을 차지하도록 설정 */ | ||
margin: 5px; | ||
} | ||
|
||
.todo-form button { | ||
flex-shrink: 0; | ||
flex-shrink: 0; /* 버튼 크기가 축소되지 않도록 설정 */ | ||
margin-left: 5px; | ||
} |
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,4 +1,4 @@ | ||
.todo-list { | ||
max-width: 600px; | ||
max-width: 600px; /* 600px 이상 커지지 않도록 제한 */ | ||
margin: 0 auto; | ||
} |
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,38 +0,0 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
import React from 'react'; | ||
import { MOVIES } from './mocks/movies'; // API | ||
import MovieList from './components/MovieList'; | ||
|
||
function App() { | ||
/* MOVIES : 전체 영화 데이터를 가지는 객체 | ||
MOVIES.results : 영화 목록을 가지는 배열 */ | ||
return ( | ||
<div className = "App"> | ||
<MovieList movies={MOVIES.results} /> {/* MovieList 컴포넌트에 movies라는 이름의 props로 영화 목록 전달 */} | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
File renamed without changes
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 @@ | ||
.movie-item { | ||
border-style: none; | ||
padding: 4px; | ||
margin: 4px; | ||
width: 8.5%; | ||
display: inline-block; | ||
vertical-align: top; | ||
text-align: center; | ||
} | ||
|
||
.img-container { | ||
position: relative; /* 자식 요소들이 부모 요소를 기준으로 위치하도록 함 */ | ||
width: 100%; | ||
height: auto; | ||
} | ||
|
||
.img-container img { | ||
border-radius: 5px; | ||
width: 100%; | ||
height: auto; /* 이미지의 원래 비율에 맞게 높이가 너비에 따라 자동 조정 */ | ||
display: block; /* 이미지의 하단 여백 제거 */ | ||
} | ||
|
||
.overlay { | ||
position: absolute; /* 부모 요소를 기준으로 위치 */ | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
opacity: 0; | ||
transition: 0.15s ease; | ||
background-color: rgba(0, 0, 0, 0.5); /* 배경색을 지정 */ | ||
border-radius: 5px; | ||
} | ||
|
||
.img-container:hover .overlay { | ||
opacity: 1; /* img-container에 hover 되었을 때 overlay가 보이도록 설정 */ | ||
} |
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,21 @@ | ||
import React from 'react'; | ||
import './MovieItem.css'; | ||
|
||
function MovieItem({ movie }) { | ||
/* movie : MovieList 컴포넌트로부터 전달 받은 영화 1개의 정보를 담고 있는 객체 */ | ||
/* const movie = props.movie; 대신 구조 분해 할당을 사용 | ||
-> props 객체 안에 movie 데이터를 꺼내 사용하겠다! */ | ||
return ( | ||
<div className="movie-item"> | ||
<div className="img-container"> | ||
<img | ||
src={`https://image.tmdb.org/t/p/w200${movie.poster_path}`} // 영화 포스터 경로로 이미지 출력 | ||
alt={movie.title} | ||
/> | ||
<div className="overlay"></div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default MovieItem; |
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,18 @@ | ||
// 영화 목록을 보여주는 컴포넌트 | ||
import React from 'react'; | ||
import MovieItem from './MovieItem'; | ||
|
||
function MovieList({ movies }) { | ||
/* 부모 컴포넌트인 App.jsx 로부터 movies라는 props를 받음 */ | ||
return ( | ||
<div className="movie-list"> | ||
{movies.map((movie) => ( | ||
<MovieItem key={movie.id} movie={movie} /> // 각 영화를 MovieItem으로 전달 | ||
))} | ||
</div> | ||
/* 여기서 movies : 영화 목록을 가진 배열(results 배열) | ||
movie : 1개의 영화 객체(results 배열의 각 항목) */ | ||
); | ||
} | ||
|
||
export default MovieList; |
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,13 +0,0 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} | ||
File renamed without changes.