Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions todo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="ko">

<head>
<meta charset="UTF-8">
<title>오늘의 투두</title>

<style>
h1 {
color: blue;
text-decoration: underline;
}

.wrap {
display:flex;
}

.todo-card {
border: 1px solid gray;
border-radius: 5px;
margin: 1em;
padding: 2em;
}

button {
width : calc(80% - 20px);
}

button:hover {
background-color: orange;
}
</style>

</head>

<body>
<h1 id="title">오늘 할 일</h1>
<div class="wrap">
<div class="todo-card">
<h3>고양이 밥주기</h3>
<p>고양이 물, 사료 챙겨주기</p>
<button>완료</button>
</div>

<div class="todo-card">
<h3>장보기</h3>
<p>토마토, 계란, 초코렛 사기</p>
<button>완료</button>
</div>
</div>

<div class="wrap">
<div class="todo-card">
<h3>코딩하기</h3>
<p>리액트 강의 1주차 듣기</p>
<button>완료</button>
</div>
<div class="todo-card">
<h3>코딩하기</h3>
<p>리액트 강의 1주차 듣기</p>
<button>완료</button>
</div>
</div>

<script>
const wraps = document.getElementsByClassName("wrap");
console.log(wraps);

//title의 elemet를 id로 가져온다.
const title = document.getElementById("title");
console.log(title);
//title의 속성인 style에 접근
title.style.backgroundColor = "yellow";

//일어날 일
function sayHello(event) {
console.log("hello");
}
//태그 이름으로 button의 element를 가져온다
const buttons = document.getElementsByTagName("button");
console.log(buttons);
//버튼을 눌렀을때 sayHello를 해!
for(let i=0; i<buttons.length; i++) {
buttons[i].addEventListener("click", sayHello);
}
//.addEventListenr() 이벤트를 연결해 줄 때 사용하는 내장함수
</script>
</body>

</html>
102 changes: 102 additions & 0 deletions todo_hw1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!-- 버튼을 클릭할때 카드 색깔 변화시키기 -->

<!DOCTYPE html>
<html lang="ko">

<head>
<meta charset="UTF-8">
<title>오늘의 투두</title>

<style>
h1 {
color: blue;
text-decoration: underline;
}

.wrap {
display:flex;
}

.todo-card {
border: 1px solid gray;
border-radius: 5px;
margin: 1em;
padding: 2em;
}

button {
width : calc(80% - 20px);
}

button:hover {
background-color: orange;
}
</style>

</head>

<body>
<h1 id="title">오늘 할 일</h1>
<div class="wrap">
<div class="todo-card">
<h3>고양이 밥주기</h3>
<p>고양이 물, 사료 챙겨주기</p>
<button onclick="changeBackgroundColor(0)">완료</button>
</div>

<div class="todo-card">
<h3>장보기</h3>
<p>토마토, 계란, 초코렛 사기</p>
<button>완료</button>
</div>
</div>

<div class="wrap">
<div class="todo-card">
<h3>코딩하기</h3>
<p>리액트 강의 1주차 듣기</p>
<button>완료</button>
</div>
<div class="todo-card">
<h3>코딩하기</h3>
<p>리액트 강의 1주차 듣기</p>
<button>완료</button>
</div>
</div>

<script>
const wraps = document.getElementsByClassName("wrap");
console.log(wraps);

//title의 elemet를 id로 가져온다.
const title = document.getElementById("title");
console.log(title);
//title의 속성인 style에 접근
title.style.backgroundColor = "yellow";


const buttons = document.getElementsByTagName("button");

// 이 구문은 X! html collection은 유사 배열이기 때문에 array의 내장함수를 쓸 수 없어요!
//buttons.map(b => {
//console.log(b);
//});

for (let i=0; i< buttons.length; i++){
// .addEventListener()로 클릭 이벤트를 연결해줍니다.
buttons[i].addEventListener("click", sayHello);
}


function changeBackgroundColor (index) {
// 가장 먼저 클래스 명으로 card들을 가지고 와봅시다! 아래 콘솔로 확인해보세요!
console.log(document.getElementsByClassName("todo-card"));
// 몇 번째 카드의 배경색을 바꿀 지 정해주었어요.
let card = document.getElementsByClassName("todo-card")[index];
// 몇번째 카드인지 설정 안해주면 유사배열로 뽑히기때문에 .style.backgroundColor가 안먹힌다.
card.style.backgroundColor = "gray";
}
</script>
</body>

</html>
23 changes: 23 additions & 0 deletions voca/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
70 changes: 70 additions & 0 deletions voca/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
Loading