◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
8 changes: 4 additions & 4 deletions 7-animation/2-css-animations/1-animate-logo-css/solution.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

CSS to animate both `width` and `height`:
```css
/* original class */

#flyjet {
transition: all 3s;
}

/* JS adds .growing */
#flyjet.growing {
width: 400px;
height: 240px;
}
```

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.
12 changes: 6 additions & 6 deletions 7-animation/2-css-animations/1-animate-logo-css/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ importance: 5

---

# Animate a plane (CSS)

Show the animation like on the picture below (click the plane):

[iframe src="solution" height=300]

- The picture grows on click from `40x24px` to `400x240px` (10 times larger).
- The animation takes 3 seconds.
- At the end output: "Done!".
- During the animation process, there may be more clicks on the plane. They shouldn't "break" anything.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
We need to choose the right Bezier curve for that animation. It should have `y>1` somewhere for the plane to "jump out".

For instance, we can take both control points with `y>1`, like: `cubic-bezier(0.25, 1.5, 0.75, 1.5)`.

The graph:

![](bezier-up.svg)
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ importance: 5

---

# Animate the flying plane (CSS)

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.

Here's how it should look (click on the plane):

[iframe src="solution" height=350]

Take the solution of the previous task as the source.
12 changes: 6 additions & 6 deletions 7-animation/2-css-animations/3-animate-circle/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ importance: 5

---

# Animated circle

Create a function `showCircle(cx, cy, radius)` that shows an animated growing circle.

- `cx,cy` are window-relative coordinates of the center of the circle,
- `radius` is the radius of the circle.

Click the button below to see how it should look like:

[iframe src="solution" height=260]

The source document has an example of a circle with right styles, so the task is precisely to do the animation right.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

<body>

<button onclick="go()">Click me</button>

<script>

function go() {
showCircle(150, 150, 100, div => {
div.classList.add('message-ball');
div.append("Hello, world!");
});
}

Expand Down
Loading
Toggle all file notes Toggle all file annotations