Skip to content

Commit 935199a

Browse files
authored
Update article.md
80%
1 parent d4c6a64 commit 935199a

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

‎7-animation/2-css-animations/article.md‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -318,17 +318,17 @@ CSS:
318318

319319
Ці значення рідко використовуються, тому що це насправді не анімація, а однокрокова зміна.
320320

321-
## Event transitionend
321+
## Подія transitionend
322322

323-
When the CSS animation finishes the `transitionend` event triggers.
323+
Коли закінчується CSS анімація, запускається подія `transitionend`.
324324

325-
It is widely used to do an action after the animation is done. Also we can join animations.
325+
Вона широко використовується для виконання дії після завершення анімації. Також ми можемо приєднатися до анімації з її допомогою.
326326

327-
For instance, the ship in the example below starts to sail there and back when clicked, each time farther and farther to the right:
327+
Наприклад, якщо натиснути на корабель у наведеному нижче прикладі, він починає плисти туди й назад, щоразу все далі й далі праворуч:
328328

329329
[iframe src="boat" height=300 edit link]
330330

331-
The animation is initiated by the function `go` that re-runs each time the transition finishes, and flips the direction:
331+
Анімація ініціюється функцією `go`, яка повторно запускається кожного разу, коли закінчується перехід, і повертає напрямок:
332332

333333
```js
334334
boat.onclick = function() {
@@ -337,11 +337,11 @@ boat.onclick = function() {
337337

338338
function go() {
339339
if (times % 2) {
340-
// sail to the right
340+
// пливти праворуч
341341
boat.classList.remove('back');
342342
boat.style.marginLeft = 100 * times + 200 + 'px';
343343
} else {
344-
// sail to the left
344+
// пливти ліворуч
345345
boat.classList.add('back');
346346
boat.style.marginLeft = 100 * times - 200 + 'px';
347347
}
@@ -357,40 +357,40 @@ boat.onclick = function() {
357357
};
358358
```
359359

360-
The event object for `transitionend` has a few specific properties:
360+
Об’єкт події для `transitionend` має кілька конкретних властивостей:
361361

362362
`event.propertyName`
363-
: The property that has finished animating. Can be good if we animate multiple properties simultaneously.
363+
: Властивість, яка завершила анімацію. Може бути корисна коли ми анімуємо кілька властивостей одночасно.
364364

365365
`event.elapsedTime`
366-
: The time (in seconds) that the animation took, without `transition-delay`.
366+
: Час (у секундах), який займала анімація, без `transition-delay`.
367367

368-
## Keyframes
368+
## Ключові кадри
369369

370-
We can join multiple simple animations together using the `@keyframes` CSS rule.
370+
Ми можемо об’єднати кілька простих анімацій разом за допомогою правила CSS `@keyframes`.
371371

372-
It specifies the "name" of the animation and rules - what, when and where to animate. Then using the `animation` property, we can attach the animation to the element and specify additional parameters for it.
372+
Воно визначає "ім’я" анімації та правила - що, коли і де анімувати. Використовуючи властивість `animation`, ми можемо приєднати анімацію до елемента та вказати додаткові параметри.
373373

374-
Here's an example with explanations:
374+
Ось приклад із поясненнями:
375375

376376
```html run height=60 autorun="no-epub" no-beautify
377377
<div class="progress"></div>
378378

379379
<style>
380380
*!*
381-
@keyframes go-left-right { /* give it a name: "go-left-right" */
382-
from { left: 0px; } /* animate from left: 0px */
383-
to { left: calc(100% - 50px); } /* animate to left: 100%-50px */
381+
@keyframes go-left-right { /* ім’я анімації: "go-left-right" */
382+
from { left: 0px; } /* початок анімації від left: 0px */
383+
to { left: calc(100% - 50px); } /* кінець анімації до left: 100%-50px */
384384
}
385385
*/!*
386386
387387
.progress {
388388
*!*
389389
animation: go-left-right 3s infinite alternate;
390-
/* apply the animation "go-left-right" to the element
391-
duration 3 seconds
392-
number of times: infinite
393-
alternate direction every time
390+
/* застосувати анімацію "go-left-right" до еменета
391+
тривалість 3 секунди
392+
кількість разів: нескінченно
393+
щоразу змінювати напрямок
394394
*/
395395
*/!*
396396
@@ -403,11 +403,11 @@ Here's an example with explanations:
403403
</style>
404404
```
405405

406-
There are many articles about `@keyframes` and a [detailed specification](https://drafts.csswg.org/css-animations/).
406+
Є багато статей про `@keyframes` та [датальна специфікація](https://drafts.csswg.org/css-animations/).
407407

408-
You probably won't need `@keyframes` often, unless everything is in constant motion on your sites.
408+
Ймовірно, `@keyframes` не знадобляться вам часто, хіба якщо на ваших сайтах все постійно рухається.
409409

410-
## Performance
410+
## Продуктивність
411411

412412
Most CSS properties can be animated, because most of them are numeric values. For instance, `width`, `color`, `font-size` are all numbers. When you animate them, the browser gradually changes these numbers frame by frame, creating a smooth effect.
413413

0 commit comments

Comments
 (0)