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: content/tutorial/02-advanced-svelte/03-animations/01-animate/README.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
-
title: The animate directive
2
+
title: Chỉ thị animate
3
3
---
4
4
5
-
In the [previous chapter](/tutorial/deferred-transitions), we used deferred transitions to create the illusion of motion as elements move from one todo list to the other.
5
+
Trong [chương trước](/tutorial/deferred-transitions), chúng ta đã sử dụng các hiệu ứng chuyển tiếp trì hoãn để tạo hiệu ứng về chuyển động khi các phần tử di chuyển từ một danh sách công việc sang danh sách khác.
6
6
7
-
To complete the illusion, we also need to apply motion to the elements that _aren't_ transitioning. For this, we use the `animate` directive.
7
+
Để hoàn tất hiệu ứng, chúng ta cũng cần áp dụng chuyển động cho các phần tử _không_ tham gia chuyển tiếp. Để làm điều này, chúng ta sử dụng chỉ thị `animate`.
8
8
9
-
First, import the`flip`function — flip stands for ['First, Last, Invert, Play'](https://aerotwist.com/blog/flip-your-animations/) — from`svelte/animate`into`TodoList.svelte`:
9
+
Đầu tiên, nhập hàm`flip` — flip viết tắt của ['First, Last, Invert, Play'](https://aerotwist.com/blog/flip-your-animations/) — từ`svelte/animate`vào`TodoList.svelte`:
10
10
11
11
```svelte
12
12
/// file: TodoList.svelte
@@ -19,7 +19,7 @@ First, import the `flip` function — flip stands for ['First, Last, Invert, Pla
19
19
</script>
20
20
```
21
21
22
-
Then add it to the `<li>` elements:
22
+
Sau đó thêm nó vào các phần tử <li>:
23
23
24
24
```svelte
25
25
/// file: TodoList.svelte
@@ -31,7 +31,7 @@ Then add it to the `<li>` elements:
31
31
>
32
32
```
33
33
34
-
The movement is a little slow in this case, so we can add a `duration` parameter:
34
+
Chuyển động hơi chậm trong trường hợp này, nên chúng ta có thể thêm một tham số `duration`:
35
35
36
36
```svelte
37
37
/// file: TodoList.svelte
@@ -43,6 +43,6 @@ The movement is a little slow in this case, so we can add a `duration` parameter
43
43
>
44
44
```
45
45
46
-
> `duration`can also be a `d => milliseconds` function, where `d`is the number of pixels the element has to travel
46
+
> `duration`cũng có thể là một hàm `d => milliseconds`, trong đó `d`là số pixel mà phần tử phải di chuyển
47
47
48
-
Note that all the transitions and animations are being applied with CSS, rather than JavaScript, meaning they won't block (or be blocked by) the main thread.
48
+
Lưu ý rằng tất cả các hiệu ứng chuyển tiếp và chuyển động đều được áp dụng bằng CSS, chứ không phải JavaScript, có nghĩa là chúng sẽ không chặn (hoặc bị chặn bởi) luồng chính.
0 commit comments