-
Notifications
You must be signed in to change notification settings - Fork 844
[브라우저 이벤트 소개] 과제 번역 #712
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
Open
taeyoonyy
wants to merge
3
commits into
javascript-tutorial:master
Choose a base branch
from
taeyoonyy:tasks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[브라우저 이벤트 소개] 과제 번역 #712
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
2-ui/2-events/01-introduction-browser-events/01-hide-other/task.md
This file contains hidden or 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,11 +1,11 @@ | ||
importance: 5 | ||
중요도: 5 | ||
|
||
--- | ||
|
||
# Hide on click | ||
# 클릭하여 숨기기 | ||
|
||
Add JavaScript to the `button` to make `<div id="text">` disappear when we click it. | ||
`button`에 자바스크립트를 추가해 클릭할 때 `<div id="text">`가 사라지게 합니다. | ||
|
||
The demo: | ||
데모: | ||
|
||
[iframe border=1 src="solution" height=80] |
4 changes: 2 additions & 2 deletions
4
2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/solution.md
This file contains hidden or 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,5 +1,5 @@ | ||
Can use `this` in the handler to reference "the element itself" here: | ||
핸들러에서 `this` 를 사용하여 여기서 "요소 자체"를 참조할 수 있습니다. | ||
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. |
||
|
||
```html run height=50 | ||
<input type="button" onclick="this.hidden=true" value="Click to hide"> | ||
<input type="button" onclick="this.hidden=true" value="숨기려면 클릭해 주세요."> | ||
``` |
10 changes: 5 additions & 5 deletions
10
2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/task.md
This file contains hidden or 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,12 +1,12 @@ | ||
importance: 5 | ||
중요도: 5 | ||
|
||
--- | ||
|
||
# Hide self | ||
# 자기 자신 숨기기 | ||
|
||
Create a button that hides itself on click. | ||
클릭할 때 자기 자신을 숨기는 버튼을 만드세요. | ||
|
||
```online | ||
Like this: | ||
<input type="button" onclick="this.hidden=true" value="Click to hide"> | ||
이것처럼 말이죠: | ||
<input type="button" onclick="this.hidden=true" value="숨기려면 클릭해 주세요."> | ||
``` |
12 changes: 6 additions & 6 deletions
12
2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/solution.md
This file contains hidden or 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,16 +1,16 @@ | ||
The answer: `1` and `2`. | ||
정답: `1` 그리고 `2`. | ||
|
||
The first handler triggers, because it's not removed by `removeEventListener`. To remove the handler we need to pass exactly the function that was assigned. And in the code a new function is passed, that looks the same, but is still another function. | ||
첫 번째 핸들러는 `removeEventListener`에 의해 제거되지 않았기 때문에 트리거 됩니다. 핸들러를 제거하기 위해서는 할당된 함수를 정확히 전달해야 합니다. 그리고 코드에서 새로운 함수가 전달되는데, 기능은 같아 보이지만 다른 함수입니다. | ||
|
||
To remove a function object, we need to store a reference to it, like this: | ||
함수 객체를 제거하려면, 다음과 같은 참조를 저장해야 합니다. | ||
|
||
```js | ||
function handler() { | ||
alert(1); | ||
} | ||
|
||
button.addEventListener("click", handler); | ||
button.removeEventListener("click", handler); | ||
button.addEventListener("클릭해 주세요.", handler); | ||
button.removeEventListener("클릭해 주세요.", handler); | ||
``` | ||
|
||
The handler `button.onclick` works independently and in addition to `addEventListener`. | ||
핸들러 `button.onclick`는 독립적으로 작동하며 `addEventListener`를 추가합니다. |
12 changes: 6 additions & 6 deletions
12
2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/task.md
This file contains hidden or 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,17 +1,17 @@ | ||
importance: 5 | ||
중요도: 5 | ||
|
||
--- | ||
|
||
# Which handlers run? | ||
# 어떤 핸들러가 실행될까요? | ||
|
||
There's a button in the variable. There are no handlers on it. | ||
변수에 버튼이 있습니다. 여기에 핸들러는 없습니다. | ||
|
||
Which handlers run on click after the following code? Which alerts show up? | ||
다음 코드 클릭 후 어떤 핸들러가 실행되나요? 어떤 경고가 출력 되나요? | ||
|
||
```js no-beautify | ||
button.addEventListener("click", () => alert("1")); | ||
button.addEventListener("클릭해 주세요.", () => alert("1")); | ||
|
||
button.removeEventListener("click", () => alert("1")); | ||
button.removeEventListener("클릭해 주세요.", () => alert("1")); | ||
|
||
button.onclick = () => alert(2); | ||
``` |
20 changes: 10 additions & 10 deletions
20
2-ui/2-events/01-introduction-browser-events/04-move-ball-field/task.md
This file contains hidden or 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,21 +1,21 @@ | ||
importance: 5 | ||
중요도: 5 | ||
|
||
--- | ||
|
||
# Move the ball across the field | ||
# 공을 운동장 건너편으로 옮겨 보세요. | ||
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. |
||
|
||
Move the ball across the field to a click. Like this: | ||
클릭하여 공을 운동장 건너편으로 옮겨 보세요. 아래와 같이 말이죠: | ||
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. |
||
|
||
[iframe src="solution" height="260" link] | ||
|
||
Requirements: | ||
요구사항: | ||
|
||
- The ball center should come exactly under the pointer on click (if possible without crossing the field edge). | ||
- CSS-animation is welcome. | ||
- The ball must not cross field boundaries. | ||
- When the page is scrolled, nothing should break. | ||
- 클릭 시 공의 중심은 마우스 포인터 바로 아래에 위치해야 합니다(가능한 필드 가장자리를 넘지 않고). | ||
- CSS-애니메이션을 사용해도 괜찮습니다. | ||
- 공은 절대로 필드 가장자리를 넘으면 안됩니다. | ||
- 페이지를 스크롤 할 때, 어떤것도 깨지지 않아야 합니다. | ||
|
||
Notes: | ||
|
||
- The code should also work with different ball and field sizes, not be bound to any fixed values. | ||
- Use properties `event.clientX/event.clientY` for click coordinates. | ||
- 코드는 다른 공과 필드 크기에서도 동작해야 하며, 고정된 값에 영향을 받지 않습니다. | ||
- 클릭 좌표에는 `event.clientX/event.clientY`을 사용하세요. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
importance는 번역하지 않습니다.
과제 번역 관련된 커밋을 살펴봐주세요.