|
|

楼主 |
发表于 2026-5-14 19:59
|
显示全部楼层
一楼代码:
- <svg id="msvg" width="300" height="300" xmlns="http://www.w3.org/2000/svg" viewBox="-200 -200 400 400"></svg>
- <script>
- function loadJs(url, callback) {
- var script = document.createElement('script');
- script.charset = 'utf-8';
- script.src = url;
- script.onload = function() {
- if (callback) callback();
- };
- document.head.appendChild(script);
- }
-
- function drRun() {
- var dr = _dr(msvg);
- dr.path('M0 -190Q-50 0,0 190Q50 0,0 -190Z', 'transparent', 'green', 5).rotates(9,180);
- const setPathStroke = () => {
- const paths = msvg.querySelectorAll('path');
- paths.forEach(path => {
- path.setAttribute('stroke', `#${Math.random().toString().substring(2,8)}`);
- });
- };
- setPathStroke();
- }
-
- loadJs('https://638183.freep.cn/638183/svgdr/svgdr.min.js', drRun);
- </script>
复制代码
|
|