如何为anime.js旋转设置任意轴?

时间:2019-03-10 14:28:53

标签: javascript animation svg anime.js

说我想旋转一条以线的中点(x ='250',y ='250')为轴的线,如下所示:

index.html

<svg width='500' height='500'>
    <rect x='0', y='0' width="500px" height='500px' fill='black'></rect>
    <circle cx='250' cy='250' r='250' fill='white'></circle>
    <line class='line' x1='250' y1='0' x2='250' y2='500' stroke='black' stroke-width='10px'></line>
</svg>

script.js

const line = document.querySelector('.line');

anime({
    targets: 'line',
    rotateY: '360deg'
});

是否可以为旋转分配任意轴?

0 个答案:

没有答案