rotate
rotate 屿§ã¯ãã¢ãã¡ã¼ã·ã§ã³ããè¦ç´ ãã <animateMotion> è¦ç´ ã§æå®ããããã¹ã«æ²¿ã£ã¦ç§»åããéã«ãã©ã®ããã«å転ãããããæå®ãã¾ãã
ãã®å±æ§ã¯ä»¥ä¸ã® SVG è¦ç´ ã§ä½¿ç¨ã§ãã¾ãã
使ç¨ä¸ã®ã¡ã¢
| å¤ |
auto | auto-reverse |
<number>
|
|---|---|
| ããã©ã«ãå¤ | 0 |
| ã¢ãã¡ã¼ã·ã§ã³ | ä¸å¯ |
auto ããã³ auto-reverse ã®å¤ã«ãããã¢ãã¡ã¼ã·ã§ã³ããè¦ç´ ã®å転ãããã¹ã«æ²¿ã£ã¦ç§»åããéã«åçã«å¤æ´ãããã¨ãã§ãã¾ãã rotate ã®å¤ã auto ã§ããå ´åãè¦ç´ ã¯ç¾å¨ã®ç§»åæ¹åã«åããã¦å³å´ãå転ããããã«é
ç½®ããã¾ãã å¤ã auto-reverse ã§ããå ´åãç¾å¨ã®ç§»åæ¹åã«åããã¦å·¦å´ãå転ããããã«é
ç½®ããã¾ãã
rotate ã®å¤ãæ°å¤ã§è¨å®ããã¨ãã¢ãã¡ã¼ã·ã§ã³ä¸ã«å¤åããªãä¸å®ã®å転è§åº¦ï¼åº¦æ°ï¼ãæå®ãã¾ããæ¢å®å¤ã® 0 ã¯ãã¢ãã¡ã¼ã·ã§ã³ããè¦ç´ ãå
ã®æ¹åã®ã¾ã¾ã«ãã¾ãã
ä¾
>SVG
<svg
width="400"
height="120"
viewBox="0 0 480 120"
xmlns="http://www.w3.org/2000/svg">
<!-- ç§»åçµè·¯ã®è¼ªéãç°è²ã§æç» -->
<path
d="M10,110 A120,120 -45 0,1 110 10 A120,120 -45 0,1 10,110"
stroke="lightgrey"
stroke-width="2"
fill="none"
id="theMotionPath" />
<!-- 赤ãç¢å°ã¯å転ããªã -->
<path fill="red" d="M-5,-5 L10,0 -5,5 0,0 Z">
<!-- ç§»åçµè·¯ã®ã¢ãã¡ã¼ã·ã§ã³ãå®ç¾© -->
<animateMotion dur="6s" repeatCount="indefinite" rotate="0">
<mpath href="#theMotionPath" />
</animateMotion>
</path>
<g transform="translate(100, 0)">
<use href="#theMotionPath" />
<!-- ç·ã®ç¢å°ã¯ç§»åçµè·¯ã«æ²¿ã£ã¦å転 -->
<path fill="green" d="M-5,-5 L10,0 -5,5 0,0 Z">
<!-- ç§»åçµè·¯ã®ã¢ãã¡ã¼ã·ã§ã³ãå®ç¾© -->
<animateMotion dur="6s" repeatCount="indefinite" rotate="auto">
<mpath href="#theMotionPath" />
</animateMotion>
</path>
</g>
<g transform="translate(200, 0)">
<use href="#theMotionPath" />
<!-- éã®ç¢å°ã¯ç§»åçµè·¯ã«æ²¿ã£ã¦éåãã«å転 -->
<path fill="blue" d="M-5,-5 L10,0 -5,5 0,0 Z">
<!-- ç§»åçµè·¯ã®ã¢ãã¡ã¼ã·ã§ã³ãå®ç¾© -->
<animateMotion dur="6s" repeatCount="indefinite" rotate="auto-reverse">
<mpath href="#theMotionPath" />
</animateMotion>
</path>
</g>
<g transform="translate(300, 0)">
<use href="#theMotionPath" />
<!-- ç´«ã®ç¢å°ã¯ 210 度ã®åãã«åºå® -->
<path fill="purple" d="M-5,-5 L10,0 -5,5 0,0 Z">
<!-- ç§»åçµè·¯ã®ã¢ãã¡ã¼ã·ã§ã³ãå®ç¾© -->
<animateMotion dur="6s" repeatCount="indefinite" rotate="210">
<mpath href="#theMotionPath" />
</animateMotion>
</path>
</g>
</svg>
çµæ
仿§æ¸
| 仿§æ¸ |
|---|
| SVG Animations Level 2 > # RotateAttribute > |
| Scalable Vector Graphics (SVG) 2 > # TextElementRotateAttribute > |