diff --git a/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/solution.md b/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/solution.md
index a38f01645..15724db5a 100644
--- a/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/solution.md
+++ b/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/solution.md
@@ -1,8 +1,8 @@
-Answer: **1 and 3**.
+Resposta: **1 e 3**.
-Both commands result in adding the `text` "as text" into the `elem`.
+Ambos os comandos resultam em adicionar o `text` "como texto" dentro de `elem`.
-Here's an example:
+Aqui está um exemplo:
```html run height=80
diff --git a/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/task.md b/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/task.md
index 40c75dff3..e99bacac5 100644
--- a/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/task.md
+++ b/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/task.md
@@ -4,9 +4,9 @@ importance: 5
# createTextNode vs innerHTML vs textContent
-We have an empty DOM element `elem` and a string `text`.
+Temos um elemento do DOM vazio `elem` e uma string `text`.
-Which of these 3 commands will do exactly the same?
+Qual destes 3 comandos vai fazer exatamente a mesma coisa?
1. `elem.append(document.createTextNode(text))`
2. `elem.innerHTML = text`
diff --git a/2-ui/1-document/07-modifying-document/10-clock-setinterval/solution.md b/2-ui/1-document/07-modifying-document/10-clock-setinterval/solution.md
index 1414e90c1..4d68c8e24 100644
--- a/2-ui/1-document/07-modifying-document/10-clock-setinterval/solution.md
+++ b/2-ui/1-document/07-modifying-document/10-clock-setinterval/solution.md
@@ -1,6 +1,6 @@
-First, let's make HTML/CSS.
+Primeiro, vamos fazer o HTML/CSS.
-Each component of the time would look great in its own ``:
+Cada componente da hora ficaria ótimo em seu próprio ``:
```html
@@ -8,9 +8,9 @@ Each component of the time would look great in its own ``:
```
-Also we'll need CSS to color them.
+Também vamos precisar de CSS para colori-los.
-The `update` function will refresh the clock, to be called by `setInterval` every second:
+A função `update` vai atualizar o relógio, sendo chamada pelo `setInterval` a cada segundo:
```js
function update() {
@@ -32,15 +32,15 @@ function update() {
}
```
-In the line `(*)` we every time check the current date. The calls to `setInterval` are not reliable: they may happen with delays.
+Na linha `(*)` verificamos a data atual a cada vez. As chamadas a `setInterval` não são confiáveis: podem acontecer com atrasos.
-The clock-managing functions:
+As funções que gerenciam o relógio:
```js
let timerId;
-function clockStart() { // run the clock
- if (!timerId) { // only set a new interval if the clock is not running
+function clockStart() { // inicia o relógio
+ if (!timerId) { // só define um novo intervalo se o relógio não estiver em execução
timerId = setInterval(update, 1000);
}
update(); // (*)
@@ -52,6 +52,6 @@ function clockStop() {
}
```
-Please note that the call to `update()` is not only scheduled in `clockStart()`, but immediately run in the line `(*)`. Otherwise the visitor would have to wait till the first execution of `setInterval`. And the clock would be empty till then.
+Note que a chamada a `update()` não é apenas agendada em `clockStart()`, mas também executada imediatamente na linha `(*)`. Caso contrário, o visitante teria que esperar até a primeira execução do `setInterval`. E o relógio ficaria vazio até então.
-Also it is important to set a new interval in `clockStart()` only when the clock is not running. Otherways clicking the start button several times would set multiple concurrent intervals. Even worse - we would only keep the `timerID` of the last interval, losing references to all others. Then we wouldn't be able to stop the clock ever again! Note that we need to clear the `timerID` when the clock is stopped in the line `(**)`, so that it can be started again by running `clockStart()`.
+Também é importante definir um novo intervalo em `clockStart()` apenas quando o relógio não estiver em execução. Caso contrário, clicar no botão de início várias vezes definiria múltiplos intervalos simultâneos. Pior ainda - manteríamos apenas o `timerId` do último intervalo, perdendo as referências a todos os outros. Então nunca mais conseguiríamos parar o relógio! Note que precisamos limpar o `timerId` quando o relógio é parado na linha `(**)`, para que ele possa ser iniciado novamente ao executar `clockStart()`.
diff --git a/2-ui/1-document/07-modifying-document/10-clock-setinterval/solution.view/index.html b/2-ui/1-document/07-modifying-document/10-clock-setinterval/solution.view/index.html
index 84ee26f19..de626b177 100644
--- a/2-ui/1-document/07-modifying-document/10-clock-setinterval/solution.view/index.html
+++ b/2-ui/1-document/07-modifying-document/10-clock-setinterval/solution.view/index.html
@@ -43,26 +43,26 @@
}
function clockStart() {
- // set a new interval only if the clock is stopped
- // otherwise we would rewrite the timerID reference to the running interval and wouldn't be able to stop the clock ever again
+ // define um novo intervalo apenas se o relógio estiver parado
+ // caso contrário, reescreveríamos a referência timerId do intervalo em execução e nunca mais conseguiríamos parar o relógio
if (!timerId) {
timerId = setInterval(update, 1000);
}
- update(); // <-- start right now, don't wait 1 second till the first setInterval works
+ update(); // <-- começa agora mesmo, não espera 1 segundo até o primeiro setInterval funcionar
}
function clockStop() {
clearInterval(timerId);
- timerId = null; // <-- clear timerID to indicate that the clock has been stopped, so that it is possible to start it again in clockStart()
+ timerId = null; // <-- limpa o timerId para indicar que o relógio foi parado, para que seja possível iniciá-lo novamente em clockStart()
}
-
-
+
+
-
-
+
+