-
Notifications
You must be signed in to change notification settings - Fork 10
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
[2주차] 이규호 미션 제출합니다. #9
base: master
Are you sure you want to change the base?
Changes from 1 commit
7b70be2
1b90ebb
2f3f0f5
ca8c2a0
31c0cd6
1761c96
25aa120
474f8ac
30ff7ce
12444f3
a904ba5
040a0f2
a90782a
d5f8656
4b077c1
aefd4f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
node_modules | ||
node_modules |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
@font-face { | ||
font-family: 'GmarketSansMedium'; | ||
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/GmarketSansMedium.woff') format('woff'); | ||
font-weight: normal; | ||
font-style: normal; | ||
} | ||
.header{ | ||
display: flex; | ||
height: 150px; | ||
width: 500px; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.logo{ | ||
font-size: 2em; | ||
font-weight: 700; | ||
width: 300px; | ||
} | ||
.detail{ | ||
font-size: 1em; | ||
width: 180px; | ||
} | ||
#clock-js{ | ||
padding-top: 5px; | ||
} | ||
.todoList{ | ||
display:flex; | ||
flex-direction: column; | ||
width: 28em; | ||
} | ||
.todoInput{/*input container*/ | ||
display:flex; | ||
height:35px; | ||
padding-bottom: 5px; | ||
} | ||
input{/*input 태그 따로 설정*/ | ||
background-color: black; | ||
color: #ECECEC; | ||
border: solid 2px #ECECEC; | ||
border-radius: 6px; | ||
width: 400px; | ||
} | ||
#plusButton{ | ||
background-color: black; | ||
color: #ECECEC; | ||
border: solid 2px #ECECEC; | ||
border-radius: 6px; | ||
width: 35px; | ||
margin-left: 5px; | ||
transition : border 0.3s, color 0.3s; | ||
} | ||
#plusButton:hover{ | ||
border : solid 2px #5f5f5f; | ||
color : #5f5f5f; | ||
} | ||
.todoCard{ | ||
background-color: #ECECEC; | ||
color : black; | ||
display:flex; /*todoElem 세로축 가운데 정렬*/ | ||
align-items:center; | ||
justify-content:space-between;/* item 사이 간격 균일하게 */ | ||
height: 100px; | ||
margin : 7px 0; | ||
border-radius: 8px; | ||
} | ||
.todoCard.checked{ | ||
transition : opacity 0.3s; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 디테일이 좋습니다!! |
||
opacity: 0.5; | ||
} | ||
.todoCard.checked:hover{ /*마우스 올렸을 때 살짝 밝게*/ | ||
opacity: 0.6; | ||
} | ||
.todoElem{ | ||
flex:1; /*여백 다 채우게끔*/ | ||
margin-left:30px; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 코드 변경하면서 예외처리를 신경쓰지 못했네요 ㅠㅠ 감사합니다1! |
||
input[type=checkbox]{ | ||
margin-left: 20px; | ||
} | ||
.todoDelete{ | ||
border: none; | ||
margin-bottom: 80px; | ||
margin-right: 5px; | ||
font-size: 7px; | ||
border-radius: 2px; | ||
transition : background-color 0.3s; | ||
} | ||
.todoDelete:hover{ | ||
background-color: #b1b1b1; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,51 @@ | ||
import "./App.css"; | ||
import { useState, useEffect } from "react"; | ||
import Cards from "./components/Cards.js"; | ||
function App() { | ||
return ( | ||
<div> | ||
<h1>18기 프론트 화이팅~ 푸하항ㅋ</h1> | ||
</div> | ||
); | ||
const [todo, setTodo] = useState(["운동하기", "밥먹기"]); | ||
const [currentTime, setCurrentTime] = useState(new Date()); | ||
|
||
// 시간 업데이트 | ||
const updateClock = () => { | ||
setCurrentTime(new Date()); | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 카드 넘어갈 때마다 다른 색으로 바뀌는 거 신박하네요! 색 지정해주는 방식도 나머지 연산자 활용해서 하신 거 정말 좋은 아이디어인 것 같습니다👍 |
||
|
||
useEffect(() => { | ||
const timer = setInterval(updateClock, 1000); | ||
|
||
return () => { | ||
clearInterval(timer); | ||
}; | ||
}, []); | ||
|
||
const options = { | ||
weekday: "long", | ||
month: "numeric", | ||
day: "numeric", | ||
hour: "2-digit", | ||
minute: "2-digit", | ||
second: "2-digit", | ||
hour12: false, //오전 오후 나누는거 false 처리 | ||
}; | ||
//string으로 만들어 변수로 변환한다. | ||
const stringTime = currentTime.toLocaleDateString("ko-KR", options); | ||
|
||
return ( | ||
<> | ||
<div className="header"> | ||
<div className="logo">TODO-list</div> | ||
<div className="detail"> | ||
<div>투두리스트를 작성하고 오늘 하루를 기록해요</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 / 늘 떨어지는거 약간 킹받습니다... br 해서 띄우면 좋을 것 같습니다... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 앗 떨어지는 줄 몰랐습니다...감사합니다! |
||
<div id="clock-js">{stringTime}</div> | ||
</div> | ||
</div> | ||
<div className="todoInput"> | ||
<input placeholder=" ADD TODO"></input> | ||
<button id="plusButton">+</button> | ||
</div> | ||
<Cards todo={todo}></Cards> | ||
</> | ||
); | ||
} | ||
|
||
export default App; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createGlobalStyle } from "styled-components"; | ||
import reset from "styled-reset"; | ||
|
||
const GlobalStyle = createGlobalStyle` | ||
${reset}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저는 css reset한거 좋은 것 같아요! 저도 다음과제부터 해야겠어요 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 배워갑니다!!! 써봐야겠어요!~! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 배워갑니다••• |
||
body{ | ||
background-color: black; | ||
color : #ECECEC; | ||
font-family: 'GmarketSansMedium'; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
`; | ||
|
||
export default GlobalStyle; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import "../App"; | ||
function Cards(props) { | ||
return ( | ||
<> | ||
{props.todo.map((element, i) => { | ||
return ( | ||
<div className="todoList"> | ||
<div className="todoCard"> | ||
<div className="todoElem">{element}</div> | ||
<div className="todoDelete">X</div> | ||
</div> | ||
</div> | ||
); | ||
})} | ||
</> | ||
); | ||
} | ||
|
||
export default Cards; | ||
|
||
// .todoList{ | ||
// display:flex; | ||
// flex-direction: column; | ||
// width: 450px; | ||
// } | ||
// .todoCard{ | ||
// background-color: #ECECEC; | ||
// color : black; | ||
// display:flex; /*todoElem 세로축 가운데 정렬*/ | ||
// align-items:center; | ||
// justify-content:space-between;/* item 사이 간격 균일하게 */ | ||
// height: 100px; | ||
// margin : 7px 0; | ||
// border-radius: 8px; | ||
// } | ||
// .todoCard.checked{ | ||
// transition : opacity 0.3s; | ||
// opacity: 0.5; | ||
// } | ||
// .todoCard.checked:hover{ /*마우스 올렸을 때 살짝 밝게*/ | ||
// opacity: 0.6; | ||
// } | ||
// .todoElem{ | ||
// flex:1; /*여백 다 채우게끔*/ | ||
// margin-left:30px; | ||
// } | ||
// input[type=checkbox]{ | ||
// margin-left: 20px; | ||
// } | ||
// .todoDelete{ | ||
// border: none; | ||
// margin-bottom: 80px; | ||
// margin-right: 5px; | ||
// font-size: 7px; | ||
// border-radius: 2px; | ||
// transition : background-color 0.3s; | ||
// } | ||
// .todoDelete:hover{ | ||
// background-color: #b1b1b1; | ||
// } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App'; | ||
|
||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import App from "./App"; | ||
import GlobalStyle from "./GlobalStyle"; | ||
ReactDOM.render( | ||
<React.StrictMode> | ||
<GlobalStyle /> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById('root') | ||
); | ||
document.getElementById("root") | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GlobalStyle 따로 정의하신 만큼 전체 컴포넌트에 중복되는 속성의 경우 GlobalStyle 사용해도 좋을 것 같아요!