【发布时间】:2020-01-29 20:16:05
【问题描述】:
我已经建立了一个路径动画,但是我在 svg 中的锯片有问题。
我想为 Sawblade 制作动画(旋转 360 度)。
<style>html {
background-color: #337ab7;
}
.cutline {
stroke: #222;
stroke-width: .1%;
stroke-width: .5%;
stroke-dasharray: 1% 2%;
stroke-linecap: round;
fill: none;
}
.sawblade {
fill: #eee;
width: 200px;
height: auto;
margin: 30px;
}
</style>
<svg viewBox="0 0 3387 1270">
<path id="cutline" class="cutline" d="M 2700 1000 L 100 1000 " />
<g class="sawblade">
<path id="sawblade" d="M1089.22,696.4s15.26-47.61-89.24-73.22c-1.24-.3-2.45-.58-3.65-.84,20.57-19,50.83-37.45,85.5-28.49,0,0,2.29-50-105.27-47.38-1.2,0-2.36.08-3.51.13C988,523,1012.33,497.42,1048,497c0,0-10.8-48.82-114-18.32l-1.63.49c8.62-26.2,25.66-55.9,59.27-65.14,0,0-22.88-44.46-114.87,11.33-1.1.66-2.15,1.32-3.18,2,1.12-28,9.45-62.41,40.3-80.6,0,0-33.69-36.94-107.93,40.94-.82.87-1.62,1.72-2.39,2.57-6.15-27.25-7-62.55,18-88.07,0,0-42.16-26.89-93.55,67.63-.27.51-.53,1-.8,1.5-12.43-24.62-21.38-57.66-4.15-88,0,0-47.61-15.25-73.22,89.24-.3,1.24-.58,2.46-.84,3.65-19-20.57-37.45-50.82-28.49-85.49,0,0-50-2.3-47.38,105.26,0,1.2.08,2.37.13,3.52-23.62-14.93-49.18-39.29-49.56-75,0,0-48.82,10.79-18.32,114,.16.55.32,1.09.49,1.62-26.2-8.61-55.9-25.66-65.14-59.27,0,0-44.46,22.88,11.33,114.88q1,1.64,2,3.18c-28-1.12-62.42-9.46-80.6-40.31,0,0-36.94,33.7,40.94,107.93.86.83,1.72,1.62,2.57,2.4-27.25,6.15-62.55,7-88.07-18,0,0-26.89,42.15,67.63,93.54l1.5.8c-24.62,12.44-57.66,21.38-88,4.15,0,0-15.26,47.62,89.24,73.22,1.24.31,2.46.58,3.65.85-20.57,19-50.82,37.44-85.49,28.49,0,0-2.3,49.94,105.26,47.37,1.2,0,2.37-.07,3.52-.13-14.93,23.63-39.29,49.19-75,49.57,0,0,10.79,48.82,114,18.32l1.62-.5c-8.61,26.21-25.66,55.9-59.27,65.14,0,0,22.88,44.46,114.88-11.32,1.09-.67,2.15-1.33,3.18-2-1.12,28-9.46,62.42-40.31,80.6,0,0,33.7,36.94,107.93-40.93.83-.87,1.62-1.73,2.4-2.58,6.15,27.26,7,62.56-18,88.07,0,0,42.15,26.89,93.54-67.63.28-.51.54-1,.8-1.5,12.44,24.62,21.38,57.67,4.15,88,0,0,47.62,15.26,73.22-89.24.31-1.24.58-2.45.85-3.65,19,20.57,37.44,50.83,28.49,85.5,0,0,49.94,2.29,47.37-105.27,0-1.2-.07-2.36-.13-3.51,23.63,14.92,49.18,39.28,49.57,75,0,0,48.82-10.8,18.32-114-.16-.55-.33-1.09-.5-1.63,26.21,8.62,55.9,25.66,65.14,59.27,0,0,44.46-22.88-11.32-114.87-.67-1.1-1.33-2.15-2-3.18,28,1.12,62.42,9.46,80.6,40.31,0,0,36.94-33.7-40.93-107.94-.87-.82-1.73-1.62-2.58-2.39,27.26-6.15,62.56-7,88.07,18,0,0,26.89-42.16-67.63-93.55l-1.5-.8C1025.87,688.12,1058.92,679.17,1089.22,696.4Zm-442.7-23.46a53.14,53.14,0,1,1,53.14,53.14A53.15,53.15,0,0,1,646.52,672.94Z" transform="translate(-309.32 -282.6)"/>
</g>
<!-- Define the motion path animation -->
<animateMotion xlink:href="#sawblade" dur="2s" repeatCount="indefinite" rotate="auto" >
<mpath xlink:href="#cutline" />
</animateMotion>
</svg>
你能帮帮我吗?
【问题讨论】:
标签: svg path jquery-animate