如何使用形状变形制作圆形 SVG?
我正在尝试通过有机运动来制作圆圈。
但正如你所看到的,像素似乎有问题。
关于如何使它更好看的任何想法?它甚至是我用来做这件事的正确方法吗?我不是 svg 或形状变形方面的专家。
class App extends React.Component {
render() {
return (
<div>
<svg width="200px" height="200px" viewBox="0 0 120 120">
<defs>
<filter id="distort">
<feTurbulence baseFrequency=".02" type="fractalNoise" />
<feColorMatrix type="hueRotate" values="0">
<animate attributeName="values" from="0" to="360" dur="1s" repeatCount="indefinite" />
</feColorMatrix>
<feDisplacementMap in="SourceGraphic" xChannelSelector="R" yChannelSelector="B" scale="20">
<animate attributeName="scale" values={Math.round(Math.random() * 20) + ';' + Math.round(Math.random() * 10) + ';' + Math.round(Math.random() * 10) + ';' + Math.round(Math.random() * 10) + ';'} dur="5s" repeatCount="indefinite" />
</feDisplacementMap>
</filter>
</defs>
<circle filter="url(#distort)" cx="60" cy="60" r="30" />
</svg>
</div>
);
}
}
// Render it
ReactDOM.render(
<App />,
document.getElementById("app")
);
svg {
stroke-width: 1;
stroke: #293133;
stroke-linecap: round;
fill: white;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
<div id="app"></div>