【发布时间】:2018-06-18 03:15:25
【问题描述】:
我正在尝试使用 SVG 为眉毛设置动画。但是因为我没有得到正确的教程来显示path=""中使用的数字的含义和用法而被卡住了(如果你知道的话,请分享一个教程链接)。任何人都请帮助我提高笑脸的眉毛。
这是我的代码
<svg height="100" width="100">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="none" />
<ellipse cx="35" cy="45" rx="4" ry="5" stroke="red" stroke-width="2" fill="none" />
<ellipse cx="65" cy="45" rx="4" ry="5" stroke="red" stroke-width="2" fill="none" />
<path d="M16, 20 Q27, 10 35, 20" transform="translate(9, 17)" fill="none" stroke="#000" stroke-width="1.5px" id="eyebrow1"/>
<path d="M16, 20 Q27, 10 35, 20" transform="translate(40, 17)" fill="none" stroke="#000" stroke-width="1.5px" id="eyebrow2"/>
</svg>
我正在尝试关注。抱歉代码不好:P
<svg height="100" width="100">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="none" />
<ellipse cx="35" cy="45" rx="4" ry="5" stroke="red" stroke-width="2" fill="none" />
<ellipse cx="65" cy="45" rx="4" ry="5" stroke="red" stroke-width="2" fill="none" />
<path d="M16, 20 Q27, 10 35, 20" transform="translate(9, 17)" fill="none" stroke="#000" stroke-width="1.5px" id="eyebrow1"/>
<animateMotion
xlink:href="#eyebrow1"
dur="1.2s"
fill="freeze"
calcMode="spline"
keyTimes="0; 0.5; 1"
keySplines="0 0 1 1;
.42 0 .58 1;"
path ="M30, 20 Q27, 10 35, 20"
/>
<path d="M16, 20 Q27, 10 35, 20" transform="translate(40, 17)" fill="none" stroke="#000" stroke-width="1.5px" id="eyebrow2"/>
</svg>
【问题讨论】: