1e41f4b71Sopenharmony_ci# animateTransform 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci> **NOTE** 5e41f4b71Sopenharmony_ci> 6e41f4b71Sopenharmony_ci> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ciThe **\<animateTransform>** component is used to apply a transform animation and supports the following components: 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci<circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text> 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## Required Permissions 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciNone 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci## Child Components 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ciNot supported 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci## Attributes 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ciThe **animate** attributes and the attributes in the following table are supported. 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci| Name| Type| Default Value| Mandatory| Description| 28e41f4b71Sopenharmony_ci| -------- | -------- | -------- | -------- | -------- | 29e41f4b71Sopenharmony_ci| type | [translate \| scale \| rotate \| skewX \| skewY] | - | Yes| Transform animation type.| 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci## Example 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci```html 35e41f4b71Sopenharmony_ci<!-- xxx.hml --> 36e41f4b71Sopenharmony_ci<div class="container"> 37e41f4b71Sopenharmony_ci <div class="back_container"> 38e41f4b71Sopenharmony_ci <svg> 39e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="red"> 40e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0 120 140" to="360 360 420" dur="3s" repeatCount="indefinite"></animateTransform> 41e41f4b71Sopenharmony_ci </polygon> 42e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="red"> 43e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0" to="360" dur="3s" repeatCount="indefinite"></animateTransform> 44e41f4b71Sopenharmony_ci </polygon> 45e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="green"> 46e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="scale" from="1" to="2" dur="3s" repeatCount="indefinite"></animateTransform> 47e41f4b71Sopenharmony_ci </polygon> 48e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="green"> 49e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="scale" from="1 1" to="2 4" dur="3s" repeatCount="indefinite"></animateTransform> 50e41f4b71Sopenharmony_ci </polygon> 51e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="#D2691E"> 52e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="skewX" from="10" to="100" dur="3s" repeatCount="indefinite"></animateTransform> 53e41f4b71Sopenharmony_ci </polygon> 54e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="#D2691E"> 55e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="skewY" from="10" to="100" dur="3s" repeatCount="indefinite"></animateTransform> 56e41f4b71Sopenharmony_ci </polygon> 57e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="#D2691E"> 58e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="skewX" from="10" to="100" dur="3s" repeatCount="indefinite"></animateTransform> 59e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="skewY" from="10" to="100" dur="3s" repeatCount="indefinite"></animateTransform> 60e41f4b71Sopenharmony_ci </polygon> 61e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="blue"> 62e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0" to="300" dur="3s" repeatCount="indefinite"></animateTransform> 63e41f4b71Sopenharmony_ci </polygon> 64e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="blue"> 65e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0 0" to="0 300" dur="3s" repeatCount="indefinite"></animateTransform> 66e41f4b71Sopenharmony_ci </polygon> 67e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="blue"> 68e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0 0" to="300 300" dur="3s" repeatCount="indefinite"></animateTransform> 69e41f4b71Sopenharmony_ci </polygon> 70e41f4b71Sopenharmony_ci </svg> 71e41f4b71Sopenharmony_ci </div> 72e41f4b71Sopenharmony_ci</div> 73e41f4b71Sopenharmony_ci``` 74e41f4b71Sopenharmony_ci 75e41f4b71Sopenharmony_ci```css 76e41f4b71Sopenharmony_ci/* xxx.css */ 77e41f4b71Sopenharmony_ci.container { 78e41f4b71Sopenharmony_ci flex-direction: column; 79e41f4b71Sopenharmony_ci justify-content: flex-start; 80e41f4b71Sopenharmony_ci align-items: flex-start; 81e41f4b71Sopenharmony_ci background-color: #f8f8ff; 82e41f4b71Sopenharmony_ci} 83e41f4b71Sopenharmony_ci 84e41f4b71Sopenharmony_ci.back_container { 85e41f4b71Sopenharmony_ci flex-direction: row; 86e41f4b71Sopenharmony_ci justify-content: flex-start; 87e41f4b71Sopenharmony_ci align-items: flex-start; 88e41f4b71Sopenharmony_ci height: 1000px; 89e41f4b71Sopenharmony_ci width: 1080px; 90e41f4b71Sopenharmony_ci} 91e41f4b71Sopenharmony_ci``` 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ci 96e41f4b71Sopenharmony_ci 97e41f4b71Sopenharmony_ciAnimation overlay 98e41f4b71Sopenharmony_ci 99e41f4b71Sopenharmony_ci 100e41f4b71Sopenharmony_ci```html 101e41f4b71Sopenharmony_ci<!-- xxx.hml --> 102e41f4b71Sopenharmony_ci<div class="container"> 103e41f4b71Sopenharmony_ci <div class="back_container"> 104e41f4b71Sopenharmony_ci <svg> 105e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="black"> 106e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" values="0 0; 200 200; 400 0; 107e41f4b71Sopenharmony_ci 600 200" keyTimes="0; 0.4; 0.8;1.0" dur="3s" repeatCount="indefinite"></animateTransform> 108e41f4b71Sopenharmony_ci </polygon> 109e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="green"> 110e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" values="0 0; 200 200; 400 0; 111e41f4b71Sopenharmony_ci 600 200" keyTimes="0; 0.4; 0.8;1.0" dur="3s" repeatCount="indefinite"></animateTransform> 112e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="rotate" values="0; 5; 0; 10" keyTimes="0; 113e41f4b71Sopenharmony_ci 0.4; 0.8; 1.0" dur="3s" repeatCount="indefinite"></animateTransform> 114e41f4b71Sopenharmony_ci </polygon> 115e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="blue"> 116e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" values="0 0; 200 200; 400 0; 117e41f4b71Sopenharmony_ci 600 200" keyTimes="0; 0.4; 0.8;1.0" dur="3s" repeatCount="indefinite"></animateTransform> 118e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="scale" values="1; 1.2; 1; 1.2" 119e41f4b71Sopenharmony_ci keyTimes="0; 0.4; 0.8; 1.0" dur="3s" repeatCount="indefinite"></animateTransform> 120e41f4b71Sopenharmony_ci </polygon> 121e41f4b71Sopenharmony_ci <polygon points="60,30 90,90 30,90" fill="red"> 122e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" values="0 0; 200 200; 400 0; 123e41f4b71Sopenharmony_ci 600 200" keyTimes="0; 0.4; 0.8;1.0" dur="3s" repeatCount="indefinite"></animateTransform> 124e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="scale" values="1; 1.2; 1; 1.2" 125e41f4b71Sopenharmony_ci keyTimes="0; 0.4; 0.8; 1.0" dur="3s" repeatCount="indefinite"></animateTransform> 126e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="skewX" values="0; 10; 0; 10" 127e41f4b71Sopenharmony_ci keyTimes="0; 0.4; 0.8; 1.0" dur="3s" repeatCount="indefinite"></animateTransform> 128e41f4b71Sopenharmony_ci </polygon> 129e41f4b71Sopenharmony_ci </svg> 130e41f4b71Sopenharmony_ci </div> 131e41f4b71Sopenharmony_ci</div> 132e41f4b71Sopenharmony_ci``` 133e41f4b71Sopenharmony_ci 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci```css 136e41f4b71Sopenharmony_ci/* xxx.css */ 137e41f4b71Sopenharmony_ci.container { 138e41f4b71Sopenharmony_ci flex-direction: column; 139e41f4b71Sopenharmony_ci justify-content: flex-start; 140e41f4b71Sopenharmony_ci align-items: flex-start; 141e41f4b71Sopenharmony_ci background-color: #f8f8ff; 142e41f4b71Sopenharmony_ci} 143e41f4b71Sopenharmony_ci.back_container { 144e41f4b71Sopenharmony_ci flex-direction: row; 145e41f4b71Sopenharmony_ci justify-content: flex-start; 146e41f4b71Sopenharmony_ci align-items: flex-start; 147e41f4b71Sopenharmony_ci height: 1000px; 148e41f4b71Sopenharmony_ci width: 1080px; 149e41f4b71Sopenharmony_ci} 150e41f4b71Sopenharmony_ci``` 151e41f4b71Sopenharmony_ci 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ci 154e41f4b71Sopenharmony_ci 155e41f4b71Sopenharmony_ci 156e41f4b71Sopenharmony_ciExample of involved components 157e41f4b71Sopenharmony_ci 158e41f4b71Sopenharmony_ci 159e41f4b71Sopenharmony_ci```html 160e41f4b71Sopenharmony_ci<!-- xxx.hml --> 161e41f4b71Sopenharmony_ci<div class="container"> 162e41f4b71Sopenharmony_ci <div class="back_container"> 163e41f4b71Sopenharmony_ci <svg> 164e41f4b71Sopenharmony_ci <svg fill="white" width="600" height="600" viewBox="0 0 50 50"> 165e41f4b71Sopenharmony_ci <path stroke="black" fill="none" stroke-linejoin="miter" stroke-miterlimit="1" id="p2" 166e41f4b71Sopenharmony_ci d="M1,19 l7,-3 l7,3 m2,0 l3.5,-3 l3.5 ,3 m2,0 l2 ,-3 l2 ,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5 ,-3 l0.5,3"> 167e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0" to="25" 168e41f4b71Sopenharmony_ci dur="3s" repeatCount="indefinite"></animateTransform> 169e41f4b71Sopenharmony_ci </path> 170e41f4b71Sopenharmony_ci </svg> 171e41f4b71Sopenharmony_ci <polygon points="60,20 90,80 30,80" fill="black"> 172e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0" to="300" 173e41f4b71Sopenharmony_ci dur="3s" repeatCount="indefinite"></animateTransform> 174e41f4b71Sopenharmony_ci </polygon> 175e41f4b71Sopenharmony_ci <circle cx="60" cy="130" r="40" stroke-width="4" fill="white" stroke="blue"> 176e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0" to="300" 177e41f4b71Sopenharmony_ci dur="3s" repeatCount="indefinite"></animateTransform> 178e41f4b71Sopenharmony_ci </circle> 179e41f4b71Sopenharmony_ci <line x1="10" x2="300" y1="280" y2="280" stroke-width="10" stroke="black" stroke-linecap="square"> 180e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0" to="300" 181e41f4b71Sopenharmony_ci dur="3s" repeatCount="indefinite"></animateTransform> 182e41f4b71Sopenharmony_ci </line> 183e41f4b71Sopenharmony_ci <polyline points="10,380 50,335 50,385 100,310" fill="white" stroke="black"> 184e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0" to="300" 185e41f4b71Sopenharmony_ci dur="3s" repeatCount="indefinite"></animateTransform> 186e41f4b71Sopenharmony_ci </polyline> 187e41f4b71Sopenharmony_ci <ellipse cx="100" cy="450" rx="70" ry="50" fill="blue"> 188e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0" to="300" 189e41f4b71Sopenharmony_ci dur="3s" repeatCount="indefinite"></animateTransform> 190e41f4b71Sopenharmony_ci </ellipse> 191e41f4b71Sopenharmony_ci <rect width="100" height="100" x="50" y="540" stroke-width="10" stroke="red" rx="10" ry="10" 192e41f4b71Sopenharmony_ci stroke-dasharray="5 3" stroke-dashoffset="3"> 193e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0" to="300" 194e41f4b71Sopenharmony_ci dur="3s" repeatCount="indefinite"></animateTransform> 195e41f4b71Sopenharmony_ci </rect> 196e41f4b71Sopenharmony_ci <text x="20" y="700" fill="#D2691E" font-size="40"> 197e41f4b71Sopenharmony_ci animate-transform 198e41f4b71Sopenharmony_ci <animateTransform attributeName="transform" attributeType="XML" type="translate" from="0" to="300" 199e41f4b71Sopenharmony_ci dur="3s" repeatCount="indefinite"></animateTransform> 200e41f4b71Sopenharmony_ci </text> 201e41f4b71Sopenharmony_ci </svg> 202e41f4b71Sopenharmony_ci </div> 203e41f4b71Sopenharmony_ci</div> 204e41f4b71Sopenharmony_ci``` 205e41f4b71Sopenharmony_ci 206e41f4b71Sopenharmony_ci 207e41f4b71Sopenharmony_ci```css 208e41f4b71Sopenharmony_ci/* xxx.css */ 209e41f4b71Sopenharmony_ci.container { 210e41f4b71Sopenharmony_ci flex-direction: column; 211e41f4b71Sopenharmony_ci justify-content: flex-start; 212e41f4b71Sopenharmony_ci align-items: flex-start; 213e41f4b71Sopenharmony_ci background-color: #f8f8ff; 214e41f4b71Sopenharmony_ci} 215e41f4b71Sopenharmony_ci.back_container { 216e41f4b71Sopenharmony_ci flex-direction: row; 217e41f4b71Sopenharmony_ci justify-content: flex-start; 218e41f4b71Sopenharmony_ci align-items: flex-start; 219e41f4b71Sopenharmony_ci height: 1000px; 220e41f4b71Sopenharmony_ci width: 1080px; 221e41f4b71Sopenharmony_ci} 222e41f4b71Sopenharmony_ci``` 223e41f4b71Sopenharmony_ci 224e41f4b71Sopenharmony_ci 225e41f4b71Sopenharmony_ci 226