diff --git a/2-ui/2-events/01-introduction-browser-events/01-hide-other/task.md b/2-ui/2-events/01-introduction-browser-events/01-hide-other/task.md
index 7cb0cb0c9..15eeef668 100644
--- a/2-ui/2-events/01-introduction-browser-events/01-hide-other/task.md
+++ b/2-ui/2-events/01-introduction-browser-events/01-hide-other/task.md
@@ -2,10 +2,10 @@ importance: 5
---
-# Hide on click
+# Ocultar ao clicar
-Add JavaScript to the `button` to make `
` disappear when we click it.
+Adicione JavaScript ao `button` para fazer `
` desaparecer quando clicarmos nele.
-The demo:
+A demo:
[iframe border=1 src="solution" height=80]
diff --git a/2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/solution.md b/2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/solution.md
index cded5b622..f774e3f6b 100644
--- a/2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/solution.md
+++ b/2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/solution.md
@@ -1,5 +1,5 @@
-Can use `this` in the handler to reference "the element itself" here:
+Podemos usar `this` no manipulador para referenciar "o próprio elemento" aqui:
```html run height=50
-
+
```
diff --git a/2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/task.md b/2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/task.md
index 9ee8f18e1..0c811ad66 100644
--- a/2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/task.md
+++ b/2-ui/2-events/01-introduction-browser-events/02-hide-self-onclick/task.md
@@ -2,11 +2,11 @@ importance: 5
---
-# Hide self
+# Oculte a si mesmo
-Create a button that hides itself on click.
+Crie um botão que se oculte ao ser clicado.
```online
-Like this:
-
+Assim:
+
```
diff --git a/2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/solution.md b/2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/solution.md
index d569f0e4d..c854918cf 100644
--- a/2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/solution.md
+++ b/2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/solution.md
@@ -1,8 +1,8 @@
-The answer: `1` and `2`.
+A resposta: `1` e `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.
+O primeiro manipulador é acionado, porque não é removido por `removeEventListener`. Para remover o manipulador precisamos passar exatamente a função que foi atribuída. E no código uma nova função é passada, que parece a mesma, mas ainda é outra função.
-To remove a function object, we need to store a reference to it, like this:
+Para remover um objeto de função, precisamos armazenar uma referência a ele, assim:
```js
function handler() {
@@ -13,4 +13,4 @@ button.addEventListener("click", handler);
button.removeEventListener("click", handler);
```
-The handler `button.onclick` works independently and in addition to `addEventListener`.
+O manipulador `button.onclick` funciona independentemente, além do `addEventListener`.
diff --git a/2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/task.md b/2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/task.md
index f8cd75d5a..433192b64 100644
--- a/2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/task.md
+++ b/2-ui/2-events/01-introduction-browser-events/03-which-handlers-run/task.md
@@ -2,11 +2,11 @@ importance: 5
---
-# Which handlers run?
+# Quais manipuladores são executados?
-There's a button in the variable. There are no handlers on it.
+Há um botão na variável. Não há manipuladores nele.
-Which handlers run on click after the following code? Which alerts show up?
+Quais manipuladores são executados no clique depois do código a seguir? Quais alertas aparecem?
```js no-beautify
button.addEventListener("click", () => alert("1"));
diff --git a/2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.md b/2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.md
index b04cb8231..09d7133a2 100644
--- a/2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.md
+++ b/2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.md
@@ -1,11 +1,11 @@
-First we need to choose a method of positioning the ball.
+Primeiro precisamos escolher um método de posicionamento da bola.
-We can't use `position:fixed` for it, because scrolling the page would move the ball from the field.
+Não podemos usar `position:fixed` para ela, porque rolar a página moveria a bola para fora do campo.
-So we should use `position:absolute` and, to make the positioning really solid, make `field` itself positioned.
+Então devemos usar `position:absolute` e, para tornar o posicionamento realmente sólido, tornar o próprio `field` posicionado.
-Then the ball will be positioned relatively to the field:
+Então a bola será posicionada em relação ao campo:
```css
#field {
@@ -16,36 +16,36 @@ Then the ball will be positioned relatively to the field:
#ball {
position: absolute;
- left: 0; /* relative to the closest positioned ancestor (field) */
+ left: 0; /* relativo ao ancestral posicionado mais próximo (field) */
top: 0;
- transition: 1s all; /* CSS animation for left/top makes the ball fly */
+ transition: 1s all; /* animação CSS para left/top faz a bola "voar" */
}
```
-Next we need to assign the correct `ball.style.left/top`. They contain field-relative coordinates now.
+Agora precisamos atribuir o `ball.style.left/top` correto. Eles agora contêm coordenadas relativas ao campo.
-Here's the picture:
+Aqui está a imagem:

-We have `event.clientX/clientY` -- window-relative coordinates of the click.
+Temos `event.clientX/clientY` -- coordenadas do clique relativas à janela.
-To get field-relative `left` coordinate of the click, we can substract the field left edge and the border width:
+Para obter a coordenada `left` do clique relativa ao campo, podemos subtrair a borda esquerda do campo e a largura da borda:
```js
let left = event.clientX - fieldCoords.left - field.clientLeft;
```
-Normally, `ball.style.left` means the "left edge of the element" (the ball). So if we assign that `left`, then the ball edge, not center, would be under the mouse cursor.
+Normalmente, `ball.style.left` significa "a borda esquerda do elemento" (a bola). Então, se atribuirmos esse `left`, a borda da bola, não o centro, ficaria sob o cursor do mouse.
-We need to move the ball half-width left and half-height up to make it center.
+Precisamos mover a bola metade da largura para a esquerda e metade da altura para cima, para centralizá-la.
-So the final `left` would be:
+Então o `left` final seria:
```js
let left = event.clientX - fieldCoords.left - field.clientLeft - ball.offsetWidth/2;
```
-The vertical coordinate is calculated using the same logic.
+A coordenada vertical é calculada usando a mesma lógica.
-Please note that the ball width/height must be known at the time we access `ball.offsetWidth`. Should be specified in HTML or CSS.
+Note que a largura/altura da bola deve ser conhecida no momento em que acessamos `ball.offsetWidth`. Deve ser especificada em HTML ou CSS.
diff --git a/2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.view/index.html b/2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.view/index.html
index 3ebe8739e..d365c14c1 100644
--- a/2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.view/index.html
+++ b/2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.view/index.html
@@ -27,7 +27,7 @@
- Click on a field to move the ball there.
+ Clique em um campo para mover a bola para lá.
@@ -39,29 +39,29 @@
diff --git a/2-ui/2-events/01-introduction-browser-events/06-hide-message/source.view/index.html b/2-ui/2-events/01-introduction-browser-events/06-hide-message/source.view/index.html
index 07adbf985..5ca1001f5 100644
--- a/2-ui/2-events/01-introduction-browser-events/06-hide-message/source.view/index.html
+++ b/2-ui/2-events/01-introduction-browser-events/06-hide-message/source.view/index.html
@@ -8,21 +8,21 @@
- The button code (may need to adjust CSS):
+ O código do botão (pode precisar ajustar o CSS):
-
Horse
-
The horse is one of two extant subspecies of Equus ferus. It is an odd-toed ungulate mammal belonging to the taxonomic family Equidae. The horse has evolved over the past 45 to 55 million years from a small multi-toed creature, Eohippus, into the large, single-toed animal of today.
+
Cavalo
+
O cavalo é uma das duas subespécies existentes de Equus ferus. É um mamífero ungulado de dedo ímpar pertencente à família taxonômica Equidae. O cavalo evoluiu nos últimos 45 a 55 milhões de anos, de uma pequena criatura de vários dedos, o Eohippus, até o grande animal de dedo único de hoje.
-
Donkey
-
The donkey or ass (Equus africanus asinus) is a domesticated member of the horse family, Equidae. The wild ancestor of the donkey is the African wild ass, E. africanus. The donkey has been used as a working animal for at least 5000 years.
+
Burro
+
O burro ou jumento (Equus africanus asinus) é um membro domesticado da família dos cavalos, Equidae. O ancestral selvagem do burro é o jumento-selvagem-africano, E. africanus. O burro é usado como animal de trabalho há pelo menos 5000 anos.
-
Cat
-
The domestic cat (Latin: Felis catus) is a small, typically furry, carnivorous mammal. They are often called house cats when kept as indoor pets or simply cats when there is no need to distinguish them from other felids and felines. Cats are often valued by humans for companionship and for their ability to hunt vermin.
+
Gato
+
O gato doméstico (em latim: Felis catus) é um mamífero carnívoro pequeno, geralmente peludo. Eles são frequentemente chamados de gatos domésticos quando mantidos como animais de estimação dentro de casa, ou simplesmente gatos quando não há necessidade de distingui-los de outros felídeos e felinos. Os gatos são frequentemente valorizados pelos humanos por companhia e por sua habilidade de caçar pragas.
diff --git a/2-ui/2-events/01-introduction-browser-events/06-hide-message/task.md b/2-ui/2-events/01-introduction-browser-events/06-hide-message/task.md
index 152cf41fe..31033c3ba 100644
--- a/2-ui/2-events/01-introduction-browser-events/06-hide-message/task.md
+++ b/2-ui/2-events/01-introduction-browser-events/06-hide-message/task.md
@@ -2,12 +2,12 @@ importance: 5
---
-# Add a closing button
+# Adicione um botão de fechar
-There's a list of messages.
+Há uma lista de mensagens.
-Use JavaScript to add a closing button to the right-upper corner of each message.
+Use JavaScript para adicionar um botão de fechar no canto superior-direito de cada mensagem.
-The result should look like this:
+O resultado deve ficar assim:
[iframe src="solution" height=450]
diff --git a/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.md b/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.md
index 1c6b52cea..6a90c9da5 100644
--- a/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.md
+++ b/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.md
@@ -1,17 +1,17 @@
-The images ribbon can be represented as `ul/li` list of images ``.
+A faixa de imagens pode ser representada como uma lista `ul/li` de imagens ``.
-Normally, such a ribbon is wide, but we put a fixed-size `
` around to "cut" it, so that only a part of the ribbon is visible:
+Normalmente, essa faixa é larga, mas colocamos um `
` de tamanho fixo em volta para "cortá-la", de forma que apenas uma parte da faixa fique visível:

-To make the list show horizontally we need to apply correct CSS properties for `
`, like `display: inline-block`.
+Para fazer a lista aparecer horizontalmente, precisamos aplicar as propriedades CSS corretas para `
`, como `display: inline-block`.
-For `` we should also adjust `display`, because by default it's `inline`. There's extra space reserved under `inline` elements for "letter tails", so we can use `display:block` to remove it.
+Para `` também devemos ajustar o `display`, porque por padrão ele é `inline`. Há um espaço extra reservado sob elementos `inline` para "rabos de letras", então podemos usar `display:block` para removê-lo.
-To do the scrolling, we can shift `
`. There are many ways to do it, for instance by changing `margin-left` or (better performance) use `transform: translateX()`:
+Para fazer a rolagem, podemos deslocar o `
`. Há várias formas de fazer isso, por exemplo alterando `margin-left` ou (com melhor desempenho) usando `transform: translateX()`:

-The outer `
` has a fixed width, so "extra" images are cut.
+O `
` externo tem uma largura fixa, então as imagens "extras" são cortadas.
-The whole carousel is a self-contained "graphical component" on the page, so we'd better wrap it into a single `
` and style things inside it.
+O carrossel inteiro é um "componente gráfico" independente na página, então é melhor envolvê-lo em um único `
` e estilizar as coisas dentro dele.
diff --git a/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.view/index.html b/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.view/index.html
index baf867664..7e2844c03 100644
--- a/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.view/index.html
+++ b/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.view/index.html
@@ -27,7 +27,7 @@
diff --git a/2-ui/2-events/01-introduction-browser-events/07-carousel/task.md b/2-ui/2-events/01-introduction-browser-events/07-carousel/task.md
index a6adbffa5..5b9d293cd 100644
--- a/2-ui/2-events/01-introduction-browser-events/07-carousel/task.md
+++ b/2-ui/2-events/01-introduction-browser-events/07-carousel/task.md
@@ -2,12 +2,12 @@ importance: 4
---
-# Carousel
+# Carrossel
-Create a "carousel" -- a ribbon of images that can be scrolled by clicking on arrows.
+Crie um "carrossel" -- uma faixa de imagens que pode ser rolada clicando em setas.
[iframe height=200 src="solution"]
-Later we can add more features to it: infinite scrolling, dynamic loading etc.
+Mais tarde podemos adicionar mais recursos a ele: rolagem infinita, carregamento dinâmico etc.
-P.S. For this task HTML/CSS structure is actually 90% of the solution.
+P.S. Para esta tarefa, a estrutura HTML/CSS é, na verdade, 90% da solução.
diff --git a/2-ui/2-events/01-introduction-browser-events/article.md b/2-ui/2-events/01-introduction-browser-events/article.md
index 4eca222aa..483a97e76 100644
--- a/2-ui/2-events/01-introduction-browser-events/article.md
+++ b/2-ui/2-events/01-introduction-browser-events/article.md
@@ -1,256 +1,256 @@
-# Introduction to browser events
+# Introdução aos eventos do navegador
-*An event* is a signal that something has happened. All DOM nodes generate such signals (but events are not limited to DOM).
+*Um evento* é um sinal de que algo aconteceu. Todos os nós do DOM geram esses sinais (mas os eventos não se limitam ao DOM).
-Here's a list of the most useful DOM events, just to take a look at:
+Aqui está uma lista dos eventos DOM mais úteis, só para dar uma olhada:
-**Mouse events:**
-- `click` -- when the mouse clicks on an element (touchscreen devices generate it on a tap).
-- `contextmenu` -- when the mouse right-clicks on an element.
-- `mouseover` / `mouseout` -- when the mouse cursor comes over / leaves an element.
-- `mousedown` / `mouseup` -- when the mouse button is pressed / released over an element.
-- `mousemove` -- when the mouse is moved.
+**Eventos de mouse:**
+- `click` -- quando o mouse clica em um elemento (dispositivos de tela sensível ao toque o geram em um toque).
+- `contextmenu` -- quando o mouse clica com o botão direito em um elemento.
+- `mouseover` / `mouseout` -- quando o cursor do mouse entra em / sai de um elemento.
+- `mousedown` / `mouseup` -- quando o botão do mouse é pressionado / liberado sobre um elemento.
+- `mousemove` -- quando o mouse é movido.
-**Keyboard events:**
-- `keydown` and `keyup` -- when a keyboard key is pressed and released.
+**Eventos de teclado:**
+- `keydown` e `keyup` -- quando uma tecla do teclado é pressionada e liberada.
-**Form element events:**
-- `submit` -- when the visitor submits a `