Skip to content

Commit c671551

Browse files
authoredJan 1, 2023
Merge pull request #163
CSS-animations
2 parents f9397e3 + 53c81ae commit c671551

File tree

15 files changed

+214
-192
lines changed

15 files changed

+214
-192
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

2-
CSS to animate both `width` and `height`:
2+
CSS pentru a anima atât `width` cât și `height`:
33
```css
4-
/* original class */
4+
/* clasa originală */
55

66
#flyjet {
77
transition: all 3s;
88
}
99

10-
/* JS adds .growing */
10+
/* JS adaugă .growing */
1111
#flyjet.growing {
1212
width: 400px;
1313
height: 240px;
1414
}
1515
```
1616

17-
Please note that `transitionend` triggers two times -- once for every property. So if we don't perform an additional check then the message would show up 2 times.
17+
Vă rugăm să notați că `transitionend` se declanșează de două ori -- o dată pentru fiecare proprietate. Deci dacă nu efectuăm o verificare suplimentară atunci mesajul va apărea de 2 ori.

‎7-animation/2-css-animations/1-animate-logo-css/solution.view/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
flyjet.addEventListener('transitionend', function() {
3535
if (!ended) {
3636
ended = true;
37-
alert('Done!');
37+
alert('Gata!');
3838
}
3939
});
4040

‎7-animation/2-css-animations/1-animate-logo-css/task.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ importance: 5
22

33
---
44

5-
# Animate a plane (CSS)
5+
# Animați un avion (CSS)
66

7-
Show the animation like on the picture below (click the plane):
7+
Afișați animația ca în imaginea de mai jos (faceți clic pe avion):
88

99
[iframe src="solution" height=300]
1010

11-
- The picture grows on click from `40x24px` to `400x240px` (10 times larger).
12-
- The animation takes 3 seconds.
13-
- At the end output: "Done!".
14-
- During the animation process, there may be more clicks on the plane. They shouldn't "break" anything.
11+
- Imaginea crește când faceți clic de la `40x24px` la `400x240px` (de 10 ori mai mare).
12+
- Animația durează 3 secunde.
13+
- La final arătați output: "Gata!".
14+
- În timpul procesului de animație, pot exista mai multe click-uri pe avion. Acestea nu ar trebui să "strice" nimic.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
We need to choose the right Bezier curve for that animation. It should have `y>1` somewhere for the plane to "jump out".
1+
Trebuie să alegem curba Bezier potrivită pentru acea animație. Aceasta ar trebui să aibă `y>1` undeva pentru ca avionul să "sară".
22

3-
For instance, we can take both control points with `y>1`, like: `cubic-bezier(0.25, 1.5, 0.75, 1.5)`.
3+
De exemplu, putem lua ambele puncte de control cu `y>1`, ca: `cubic-bezier(0.25, 1.5, 0.75, 1.5)`.
44

5-
The graph:
5+
Graficul:
66

77
![](bezier-up.svg)

‎7-animation/2-css-animations/2-animate-logo-bezier-css/task.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ importance: 5
22

33
---
44

5-
# Animate the flying plane (CSS)
5+
# Animați avionul care zboară (CSS)
66

7-
Modify the solution of the previous task <info:task/animate-logo-css> to make the plane grow more than its original size 400x240px (jump out), and then return to that size.
7+
Modificați soluția din sarcina anterioară <info:task/animate-logo-css> pentru a face avionul să crească mai mult decât dimensiunea sa originală de 400x240px (să sară în afară), apoi să revină la această dimensiune.
88

9-
Here's how it should look (click on the plane):
9+
Iată cum ar trebui să arate (faceți clic pe avion):
1010

1111
[iframe src="solution" height=350]
1212

13-
Take the solution of the previous task as the source.
13+
Luați ca sursă soluția din sarcina anterioară.

‎7-animation/2-css-animations/3-animate-circle/task.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ importance: 5
22

33
---
44

5-
# Animated circle
5+
# Cerc animat
66

7-
Create a function `showCircle(cx, cy, radius)` that shows an animated growing circle.
7+
Creați o funcție `showCircle(cx, cy, radius)` care arată un cerc animat în creștere.
88

9-
- `cx,cy` are window-relative coordinates of the center of the circle,
10-
- `radius` is the radius of the circle.
9+
- `cx,cy` sunt coordonatele relative la fereastră ale centrului cercului,
10+
- `radius` este raza cercului.
1111

12-
Click the button below to see how it should look like:
12+
Faceți clic pe butonul de mai jos pentru a vedea cum ar trebui să arate:
1313

1414
[iframe src="solution" height=260]
1515

16-
The source document has an example of a circle with right styles, so the task is precisely to do the animation right.
16+
Documentul sursă are un exemplu de cerc cu stiluri corecte, deci sarcina este tocmai de a face animația corect.

‎7-animation/2-css-animations/4-animate-circle-callback/solution.view/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222

2323
<body>
2424

25-
<button onclick="go()">Click me</button>
25+
<button onclick="go()">Apasă-mă</button>
2626

2727
<script>
2828

2929
function go() {
3030
showCircle(150, 150, 100, div => {
3131
div.classList.add('message-ball');
32-
div.append("Hello, world!");
32+
div.append("Salut, lume!");
3333
});
3434
}
3535

Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

2-
# Animated circle with callback
2+
# Cerc animat cu callback
33

4-
In the task <info:task/animate-circle> an animated growing circle is shown.
4+
În sarcina <info:task/animate-circle> este afișat un cerc animat în creștere.
55

6-
Now let's say we need not just a circle, but to show a message inside it. The message should appear *after* the animation is complete (the circle is fully grown), otherwise it would look ugly.
6+
Acum să spunem că avem nevoie nu doar de un cerc, ci și de un mesaj în interiorul acestuia. Mesajul ar trebui să apară *după* finalizarea animației (cercul a crescut complet), altfel ar arăta urât.
77

8-
In the solution of the task, the function `showCircle(cx, cy, radius)` draws the circle, but gives no way to track when it's ready.
8+
În soluția sarcinii, funcția `showCircle(cx, cy, radius)` desenează cercul, dar nu oferă nicio modalitate de a urmări când este gata.
99

10-
Add a callback argument: `showCircle(cx, cy, radius, callback)` to be called when the animation is complete. The `callback` should receive the circle `<div>` as an argument.
10+
Adăugați un argument de callback: `showCircle(cx, cy, radius, callback)` care va fi apelată atunci când animația este finalizată. `callback`-ul trebuie să primească `<div>`-ul cercului ca argument.
1111

12-
Here's the example:
12+
Iată exemplul:
1313

1414
```js
1515
showCircle(150, 150, 100, div => {
1616
div.classList.add('message-ball');
17-
div.append("Hello, world!");
17+
div.append("Salut, lume!");
1818
});
1919
```
2020

2121
Demo:
2222

2323
[iframe src="solution" height=260]
2424

25-
Take the solution of the task <info:task/animate-circle> as the base.
25+
Luați ca bază soluția sarcinii <info:task/animate-circle>.

0 commit comments

Comments
 (0)
Please sign in to comment.