1e41f4b71Sopenharmony_ci# Animation Styles
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ciComponents support dynamic rotation, translation, and scaling effects. These effects can be set in the **style** attribute or **.css** files.
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci| Name                       | Type                                | Default Value        | Description                                      |
8e41f4b71Sopenharmony_ci| ------------------------- | ---------------------------------- | ----------- | ---------------------------------------- |
9e41f4b71Sopenharmony_ci| transform                 | string                             | -           | Translation, rotation, and scaling attributes. For details, see Table 1.                                   |
10e41f4b71Sopenharmony_ci| animation-name            | string                             | -           | \@keyframes rule. For details, see Table 2.                     |
11e41f4b71Sopenharmony_ci| animation-delay           | <time>                       | 0           | Delay for playing the animation, in ms or s, for example, **1000 ms** or **1s**. \|The default unit is ms.|
12e41f4b71Sopenharmony_ci| animation-duration        | &lt;time&gt;                       | 0           | Animation duration, in ms or s, for example, **1000 ms** or **1s**. \|The default unit is ms.<br>**NOTE**<br>**animation-duration** must be specified. Otherwise, the duration is **0**, which means the animation will not be played.|
13e41f4b71Sopenharmony_ci| animation-iteration-count | number  \| infinite | 1           | Number of times that an animation is played. The animation is played once by default. You can set the value to **infinite** to play the animation infinitely.   |
14e41f4b71Sopenharmony_ci| animation-timing-function | string                             | <br>linear | Speed curve of an animation, which makes the animation more fluent.<br>Available values are as follows:<br>- **linear**: The animation speed keeps unchanged.<br>- **ease-in**: The animation starts at a low speed. The cubic-bezier curve (0.42, 0.0, 1.0, 1.0) is used<br>- **ease-out**: The animation ends at a low speed. The cubic-bezier curve (0.0, 0.0, 0.58, 1.0) is used.<br>- **ease-in-out**: The animation starts and ends at a low speed. The cubic-bezier curve (0.42, 0.0, 0.58, 1.0) is used.|
15e41f4b71Sopenharmony_ci| animation-fill-mode       | string                             | none        | Start and end styles of the animation.<br>- **none**: No style is applied to the target before or after the animation is executed.<br>- **forwards**: The target keeps the state at the end of the animation (defined in the last key frame) after the animation is executed.|
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci  **Table 1** transform
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci| Name        | Type                                  | Description        |
21e41f4b71Sopenharmony_ci| ---------- | ------------------------------------ | ---------- |
22e41f4b71Sopenharmony_ci| translateX | &lt;length&gt;                       | Moves an element along the x-axis.|
23e41f4b71Sopenharmony_ci| translateY | &lt;length&gt;                       | Moves an element along the y-axis.|
24e41f4b71Sopenharmony_ci| rotate     | &lt;deg&gt; \| &lt;rad&gt; | Rotates an element.    |
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci>  **NOTE**
27e41f4b71Sopenharmony_ci>
28e41f4b71Sopenharmony_ci>  Only images of the original size can be rotated on lite wearables.
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci  **Table 2** \@keyframes
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci| Name              | Type            | Default Value | Description                |
34e41f4b71Sopenharmony_ci| ---------------- | -------------- | ---- | ------------------ |
35e41f4b71Sopenharmony_ci| background-color | &lt;color&gt;  | -    | Background color applied to the component after the animation is played. |
36e41f4b71Sopenharmony_ci| width            | &lt;length&gt; | -    | Width value applied to the component after the animation is played.  |
37e41f4b71Sopenharmony_ci| height           | &lt;length&gt; | -    | Height value applied to the component after the animation is played.  |
38e41f4b71Sopenharmony_ci| transform        | string         | -    | Transformation type applied to a component. For details, see Table 1.|
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ciIf there is no default value for when an animation will start or end, use **from** and **to** to specify the start and end of the display. The following is an example:
42e41f4b71Sopenharmony_ci
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci```css
45e41f4b71Sopenharmony_ci@keyframes Go
46e41f4b71Sopenharmony_ci{
47e41f4b71Sopenharmony_ci   from {
48e41f4b71Sopenharmony_ci     background-color: #f76160;
49e41f4b71Sopenharmony_ci   }
50e41f4b71Sopenharmony_ci   to {
51e41f4b71Sopenharmony_ci     background-color: #09ba07;
52e41f4b71Sopenharmony_ci   }
53e41f4b71Sopenharmony_ci}
54e41f4b71Sopenharmony_ci```
55e41f4b71Sopenharmony_ci
56e41f4b71Sopenharmony_ci
57e41f4b71Sopenharmony_ci![animation-demo1](figures/animation-demo1.gif)
58e41f4b71Sopenharmony_ci
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci
61e41f4b71Sopenharmony_ci
62e41f4b71Sopenharmony_ci
63e41f4b71Sopenharmony_ci>  **NOTE**
64e41f4b71Sopenharmony_ci>
65e41f4b71Sopenharmony_ci>  The \@keyframes rule with **from** and **to** defined cannot be dynamically bound to an element.
66