You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/guide/transitions-overview.md
+34-33Lines changed: 34 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,74 +141,76 @@ Podemos verificar recursos como [Gatilhos CSS](https://csstriggers.com) para ver
141
141
142
142
A opacidade se comporta de maneira similar. Assim, são candidatos ideais para movimentos na web.
143
143
144
-
### Hardware Acceleration
144
+
### Aceleração de Hardware
145
145
146
-
Properties such as `perspective`, `backface-visibility`, and `transform: translateZ(x)` will allow the browser to know you need hardware acceleration.
146
+
Propriedades como `perspective`, `backface-visibility`, e `transform: translateZ(x)` vão permitir ao browser saber quando se necessite de aceleração de hardware.
147
+
148
+
Se você gostaria de acelerar o hardware de um elemento, você pode aplicar qualquer uma dessas propriedades (não necessariamente só uma):
147
149
148
-
If you wish to hardware-accelerate an element, you can apply any of these properties (not all are necessary, only one):
149
150
150
151
```css
151
152
perspective: 1000px;
152
153
backface-visibility: hidden;
153
154
transform: translateZ(0);
154
155
```
156
+
Muitas bibliotecas JS como GreenSock vão assumir que você quer aceleração de hardware e as vão aplicar por padrão, assim você não precisa configurar-las manualmente.
157
+
155
158
156
-
Many JS libraries like GreenSock will assume you want hardware acceleration and will apply them by default, so you do not need to set them manually.
159
+
## Tempo de Animação
157
160
158
-
## Timing
161
+
Para transições de UI simples, de um estado para outro sem estados intermediários, é comum usar tempos entre 0.1s e 0.4s, e muitas pessoas acham que _0.25s_ tende a ser o ponto certo. Você pode usar este tempo para tudo? Não necessáriamente. Se você tem algo que precisa se mover uma distância maior ou que tenha mais passos ou mudanças de estado, 0.25s não vai funcionar tão bem e você terá que ser muito mais intencional, e o tempo terá a necessidade de ser mais único. O que não significa que você pode ter ótimos padrões que você repete dentro da sua aplicação.
159
162
160
-
For simple UI transitions, meaning from just one state to another with no intermediary states, it's common to use timings between 0.1s and 0.4s, and most folks find that _0.25s_ tends to be a sweet spot. Can you use that timing for everything? No, not really. If you have something that needs to move a greater distance or has more steps or state changes, 0.25s is not going to work as well and you will have to be much more intentional, and the timing will need to be more unique. That doesn't mean you can't have nice defaults that you repeat within your application, though.
163
+
Você também pode se dar conta de que entradas têm uma aparência melhor com um pouco mais de tempo que uma saída. O usuário tipicamente está sendo guiado durante uma entrada e é um pouco menos paciente na saída, por que querem seguir seu caminho.
161
164
162
-
You may also find that entrances look better with slightly more time than an exit. The user typically is being guided during the entrance, and is a little less patient upon exit because they want to go on their way.
163
165
164
-
## Easing
166
+
## Atenuação
165
167
166
-
Easing is an important way to convey depth in an animation. One of the most common mistakes newcomers to animation have is to use `ease-in`for entrances, and`ease-out`for exits. You'll actually need the opposite.
168
+
A atenuação é um modo importante de transmitir profundidade em uma animação. Um dos erros mais comuns que novatos em animação é usar `ease-in`para entradas, e`ease-out`para saídas. Quando, na verdade, você vai precisar do oposto.
167
169
168
-
If we were to apply these states to a transition, it would look something like this:
170
+
Se tivéssemos que aplicar estes estados a uma transição, ela ficaria algo assim:
169
171
170
172
```css
171
173
.button {
172
174
background: #1b8f5a;
173
-
/*applied to the initial state, so this transition will be applied to the return state*/
175
+
/*aplicada ao estado inicial, assim esta transição será aplicada para o estado de retorno*/
174
176
transition: background0.25sease-in;
175
177
}
176
178
177
179
.button:hover {
178
180
background: #3eaf7c;
179
-
/*applied to the hover state, so this transition will be applied when a hover is triggered*/
181
+
/*aplicada ao estado de hover, assim esta transição será aplicada quando um hover é acionado.*/
Easing can also convey the quality of material being animated. Take this pen for example, which ball do you think is hard and which is soft?
193
+
A atenuação pode inclusive transmitir a qualidade do material sendo animado. Olhe este pen, por exemplo, qual bola você acha que é rígida e qual é macia?
You can get a lot of unique effects and make your animation very stylish by adjusting your easing. CSS allows you to modify this by adjusting a cubic bezier property, [this playground](https://cubic-bezier.com/#.17,.67,.83,.67)by Lea Verou is very helpful for exploring this.
202
+
Você pode obter muitos efeitos únicos e fazer sua animação bem estilosa ajustando sua acentuação. O CSS lhe permite modificar isso ajustando uma propriedade bezier cúbica, [este playground](https://cubic-bezier.com/#.17,.67,.83,.67)por Lea Verou é muito útil para explorar isso.
201
203
202
-
Though you can achieve great effects for simple animation with the two handles the cubic-bezier ease offers, JavaScript allows multiple handles, and therefore, allows for much more variance.
204
+
Apesar de que você possa alcançar grandes efeitos de animações simples com os dois handles que a acentuação por bezier-cúbico oferece, Javascript permite múltiples handles, e portanto, permite muito mais variação.
203
205
204
-

206
+

205
207
206
-
Take a bounce, for instance. In CSS we have to declare each keyframe, up and down. In JavaScript, we can express all of that movement within the ease, by declaring `bounce`in the [GreenSock API (GSAP)](https://greensock.com/) (other JS libraries have other types of easing defaults).
208
+
Tomemos um efeito de salto, por exemplo. Em CSS temos que declarar cada keyframe, para cima e para baixo. Em JavaScript, podemos expressar todo o movimento dentro da acentuação declarando `bounce`na [API GreenSock (GSAP)](https://greensock.com/)(outras bibliotecas JS têm outros tipos de padrões de acentuação).
207
209
208
-
Here is the code used for a bounce in CSS (example from animate.css):
210
+
Aqui está o código usado para o salto em CSS (exemplo de animate.css):
209
211
210
212
```css
211
-
@keyframesbounceInDown {
213
+
@keyframessaltoParaBaixo {
212
214
from,
213
215
60%,
214
216
75%,
@@ -240,20 +242,19 @@ Here is the code used for a bounce in CSS (example from animate.css):
240
242
}
241
243
}
242
244
243
-
.bounceInDown {
244
-
animation-name: bounceInDown;
245
+
.saltoParaBaixo {
246
+
animation-name: saltoParaBaixo;
245
247
}
246
248
```
247
-
248
-
And here is the same bounce in JS using GreenSock:
We'll be using GreenSock in some of the examples in the sections following. They have a great [ease visualizer](https://greensock.com/ease-visualizer)that will help you build nicely crafted eases.
255
+
Vamos usar o GreenSock para alguns dos exemplos nas seções seguintes. Eles têm um ótimo [visualizador de atenuação](https://greensock.com/ease-visualizer)que vai lhe permitir construir atenuações bem trabalhadas.
255
256
256
-
## Further Reading
257
+
## Leituras adicionais
257
258
258
-
-[Designing Interface Animation: Improving the User Experience Through Animation by Val Head](https://www.amazon.com/dp/B01J4NKSZA/)
259
+
-[Designing Interface Animation: Improving the User Experience Through Animation by Val Head](https://www.amazon.com.br/dp/B01J4NKSZA)
259
260
-[Animation at Work by Rachel Nabors](https://abookapart.com/products/animation-at-work)
0 commit comments