[Element] how to use animateTransform? #2709
-
|
SVG source code: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<g>
<rect width="2" height="5" x="11" y="1" fill="currentColor" opacity="0.14" />
<rect width="2" height="5" x="11" y="1" fill="currentColor" opacity="0.29" transform="rotate(30 12 12)" />
<rect width="2" height="5" x="11" y="1" fill="currentColor" opacity="0.43" transform="rotate(60 12 12)" />
<rect width="2" height="5" x="11" y="1" fill="currentColor" opacity="0.57" transform="rotate(90 12 12)" />
<rect width="2" height="5" x="11" y="1" fill="currentColor" opacity="0.71" transform="rotate(120 12 12)" />
<rect width="2" height="5" x="11" y="1" fill="currentColor" opacity="0.86" transform="rotate(150 12 12)" />
<rect width="2" height="5" x="11" y="1" fill="currentColor" transform="rotate(180 12 12)" />
<animateTransform attributeName="transform" calcMode="discrete" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12" />
</g>
</svg>but we cannot find anything about |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
|
Beta Was this translation helpful? Give feedback.
-
Here’s a short, clean, GitHub-ready version you can post directly:You can use <g transform="rotate(0 12 12)">
<!-- your rects here -->
attributeName="transform"
type="rotate"
from="0 12 12"
to="360 12 12"
dur="1s"
repeatCount="indefinite" />
</g>
This keeps the SVG lightweight and fully animated in modern browsers. |
Beta Was this translation helpful? Give feedback.
react-native-svgcurrently does not support any of theanimate*components form SVG standard. To achieve the same results you can re-create the animation using react-native-reanimated or React Native's animated API.